summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz
tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip
TQt4 port tellico
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--src/barcode/barcode.cpp96
-rw-r--r--src/barcode/barcode.h51
-rw-r--r--src/barcode/barcode_v4l.cpp36
-rw-r--r--src/barcode/barcode_v4l.h36
-rw-r--r--src/borrower.cpp4
-rw-r--r--src/borrower.h36
-rw-r--r--src/borrowerdialog.cpp50
-rw-r--r--src/borrowerdialog.h25
-rw-r--r--src/borroweritem.cpp8
-rw-r--r--src/borroweritem.h2
-rw-r--r--src/calendarhandler.cpp28
-rw-r--r--src/calendarhandler.h2
-rw-r--r--src/cite/clipboard.cpp12
-rw-r--r--src/cite/lyxpipe.cpp20
-rw-r--r--src/cite/ooo/interface.cpp74
-rw-r--r--src/cite/ooo/ooohandler.cpp16
-rw-r--r--src/cite/ooo/ooohandler.h4
-rw-r--r--src/cite/openoffice.cpp84
-rw-r--r--src/collection.cpp178
-rw-r--r--src/collection.h89
-rw-r--r--src/collectionfactory.cpp36
-rw-r--r--src/collectionfactory.h10
-rw-r--r--src/collectionfieldsdialog.cpp346
-rw-r--r--src/collectionfieldsdialog.h43
-rw-r--r--src/collections/bibtexcollection.cpp220
-rw-r--r--src/collections/bibtexcollection.h15
-rw-r--r--src/collections/boardgamecollection.cpp34
-rw-r--r--src/collections/boardgamecollection.h3
-rw-r--r--src/collections/bookcollection.cpp78
-rw-r--r--src/collections/bookcollection.h3
-rw-r--r--src/collections/cardcollection.cpp40
-rw-r--r--src/collections/cardcollection.h3
-rw-r--r--src/collections/coincollection.cpp42
-rw-r--r--src/collections/coincollection.h3
-rw-r--r--src/collections/comicbookcollection.cpp50
-rw-r--r--src/collections/comicbookcollection.h3
-rw-r--r--src/collections/filecatalog.cpp38
-rw-r--r--src/collections/filecatalog.h3
-rw-r--r--src/collections/gamecollection.cpp40
-rw-r--r--src/collections/gamecollection.h3
-rw-r--r--src/collections/musiccollection.cpp54
-rw-r--r--src/collections/musiccollection.h3
-rw-r--r--src/collections/stampcollection.cpp44
-rw-r--r--src/collections/stampcollection.h3
-rw-r--r--src/collections/videocollection.cpp92
-rw-r--r--src/collections/videocollection.h3
-rw-r--r--src/collections/winecollection.cpp40
-rw-r--r--src/collections/winecollection.h3
-rw-r--r--src/commands/addentries.cpp6
-rw-r--r--src/commands/addentries.h2
-rw-r--r--src/commands/addloans.cpp10
-rw-r--r--src/commands/addloans.h2
-rw-r--r--src/commands/collectioncommand.cpp4
-rw-r--r--src/commands/collectioncommand.h2
-rw-r--r--src/commands/fieldcommand.cpp10
-rw-r--r--src/commands/fieldcommand.h2
-rw-r--r--src/commands/filtercommand.cpp4
-rw-r--r--src/commands/filtercommand.h2
-rw-r--r--src/commands/group.cpp2
-rw-r--r--src/commands/group.h4
-rw-r--r--src/commands/modifyentries.cpp6
-rw-r--r--src/commands/modifyentries.h2
-rw-r--r--src/commands/modifyloans.cpp2
-rw-r--r--src/commands/modifyloans.h2
-rw-r--r--src/commands/removeentries.cpp4
-rw-r--r--src/commands/removeentries.h2
-rw-r--r--src/commands/removeloans.cpp4
-rw-r--r--src/commands/removeloans.h2
-rw-r--r--src/commands/renamecollection.cpp4
-rw-r--r--src/commands/renamecollection.h8
-rw-r--r--src/commands/reorderfields.cpp2
-rw-r--r--src/commands/reorderfields.h2
-rw-r--r--src/commands/updateentries.cpp6
-rw-r--r--src/configdialog.cpp538
-rw-r--r--src/configdialog.h61
-rw-r--r--src/controller.cpp74
-rw-r--r--src/controller.h35
-rw-r--r--src/core/dcopinterface.cpp40
-rw-r--r--src/core/dcopinterface.h51
-rw-r--r--src/core/dcopinterface_skel.cpp228
-rw-r--r--src/core/drophandler.cpp34
-rw-r--r--src/core/drophandler.h13
-rw-r--r--src/core/netaccess.cpp30
-rw-r--r--src/core/netaccess.h21
-rw-r--r--src/core/tellico_config.cpp506
-rw-r--r--src/core/tellico_config_addons.cpp54
-rw-r--r--src/core/tellico_config_addons.h32
-rw-r--r--src/datavectors.h10
-rw-r--r--src/detailedentryitem.cpp46
-rw-r--r--src/detailedentryitem.h16
-rw-r--r--src/detailedlistview.cpp192
-rw-r--r--src/detailedlistview.h41
-rw-r--r--src/document.cpp50
-rw-r--r--src/document.h19
-rw-r--r--src/entry.cpp126
-rw-r--r--src/entry.h69
-rw-r--r--src/entryeditdialog.cpp208
-rw-r--r--src/entryeditdialog.h13
-rw-r--r--src/entrygroupitem.cpp50
-rw-r--r--src/entrygroupitem.h22
-rw-r--r--src/entryiconfactory.cpp22
-rw-r--r--src/entryiconfactory.h6
-rw-r--r--src/entryiconview.cpp124
-rw-r--r--src/entryiconview.h39
-rw-r--r--src/entryitem.cpp14
-rw-r--r--src/entryitem.h16
-rw-r--r--src/entrymerger.cpp30
-rw-r--r--src/entrymerger.h7
-rw-r--r--src/entryupdater.cpp66
-rw-r--r--src/entryupdater.h15
-rw-r--r--src/entryview.cpp112
-rw-r--r--src/entryview.h19
-rw-r--r--src/exportdialog.cpp52
-rw-r--r--src/exportdialog.h17
-rw-r--r--src/fetch/amazonfetcher.cpp438
-rw-r--r--src/fetch/amazonfetcher.h44
-rw-r--r--src/fetch/animenfofetcher.cpp162
-rw-r--r--src/fetch/animenfofetcher.h33
-rw-r--r--src/fetch/arxivfetcher.cpp122
-rw-r--r--src/fetch/arxivfetcher.h31
-rw-r--r--src/fetch/bibsonomyfetcher.cpp70
-rw-r--r--src/fetch/bibsonomyfetcher.h31
-rw-r--r--src/fetch/citebasefetcher.cpp84
-rw-r--r--src/fetch/citebasefetcher.h31
-rw-r--r--src/fetch/configwidget.cpp30
-rw-r--r--src/fetch/configwidget.h25
-rw-r--r--src/fetch/crossreffetcher.cpp128
-rw-r--r--src/fetch/crossreffetcher.h35
-rw-r--r--src/fetch/discogsfetcher.cpp162
-rw-r--r--src/fetch/discogsfetcher.h37
-rw-r--r--src/fetch/entrezfetcher.cpp232
-rw-r--r--src/fetch/entrezfetcher.h37
-rw-r--r--src/fetch/execexternalfetcher.cpp248
-rw-r--r--src/fetch/execexternalfetcher.h49
-rw-r--r--src/fetch/fetcher.cpp8
-rw-r--r--src/fetch/fetcher.h35
-rw-r--r--src/fetch/fetchmanager.cpp154
-rw-r--r--src/fetch/fetchmanager.h39
-rw-r--r--src/fetch/gcstarpluginfetcher.cpp236
-rw-r--r--src/fetch/gcstarpluginfetcher.h48
-rw-r--r--src/fetch/googlescholarfetcher.cpp78
-rw-r--r--src/fetch/googlescholarfetcher.h31
-rw-r--r--src/fetch/ibsfetcher.cpp186
-rw-r--r--src/fetch/ibsfetcher.h33
-rw-r--r--src/fetch/imdbfetcher.cpp578
-rw-r--r--src/fetch/imdbfetcher.h87
-rw-r--r--src/fetch/isbndbfetcher.cpp138
-rw-r--r--src/fetch/isbndbfetcher.h29
-rw-r--r--src/fetch/messagehandler.cpp6
-rw-r--r--src/fetch/messagehandler.h14
-rw-r--r--src/fetch/scripts/dark_horse_comics.py16
-rwxr-xr-xsrc/fetch/scripts/fr.allocine.py24
-rw-r--r--src/fetch/scripts/ministerio_de_cultura.py10
-rw-r--r--src/fetch/srufetcher.cpp228
-rw-r--r--src/fetch/srufetcher.h42
-rw-r--r--src/fetch/yahoofetcher.cpp174
-rw-r--r--src/fetch/yahoofetcher.h31
-rw-r--r--src/fetch/z3950connection.cpp134
-rw-r--r--src/fetch/z3950connection.h74
-rw-r--r--src/fetch/z3950fetcher.cpp268
-rw-r--r--src/fetch/z3950fetcher.h54
-rw-r--r--src/fetchdialog.cpp334
-rw-r--r--src/fetchdialog.h47
-rw-r--r--src/fetcherconfigdialog.cpp84
-rw-r--r--src/fetcherconfigdialog.h27
-rw-r--r--src/field.cpp240
-rw-r--r--src/field.h90
-rw-r--r--src/fieldcompletion.cpp14
-rw-r--r--src/fieldcompletion.h9
-rw-r--r--src/filehandler.cpp118
-rw-r--r--src/filehandler.h42
-rw-r--r--src/filter.cpp48
-rw-r--r--src/filter.h32
-rw-r--r--src/filterdialog.cpp122
-rw-r--r--src/filterdialog.h39
-rw-r--r--src/filteritem.cpp8
-rw-r--r--src/filteritem.h2
-rw-r--r--src/filterview.cpp48
-rw-r--r--src/filterview.h9
-rw-r--r--src/groupiterator.cpp4
-rw-r--r--src/groupiterator.h4
-rw-r--r--src/groupview.cpp96
-rw-r--r--src/groupview.h33
-rw-r--r--src/gui/boolfieldwidget.cpp24
-rw-r--r--src/gui/boolfieldwidget.h15
-rw-r--r--src/gui/choicefieldwidget.cpp22
-rw-r--r--src/gui/choicefieldwidget.h9
-rw-r--r--src/gui/collectiontypecombo.cpp8
-rw-r--r--src/gui/collectiontypecombo.h2
-rw-r--r--src/gui/combobox.cpp16
-rw-r--r--src/gui/combobox.h22
-rw-r--r--src/gui/counteditem.cpp28
-rw-r--r--src/gui/counteditem.h16
-rw-r--r--src/gui/datefieldwidget.cpp12
-rw-r--r--src/gui/datefieldwidget.h11
-rw-r--r--src/gui/datewidget.cpp100
-rw-r--r--src/gui/datewidget.h32
-rw-r--r--src/gui/fieldwidget.cpp78
-rw-r--r--src/gui/fieldwidget.h33
-rw-r--r--src/gui/imagefieldwidget.cpp14
-rw-r--r--src/gui/imagefieldwidget.h11
-rw-r--r--src/gui/imagewidget.cpp88
-rw-r--r--src/gui/imagewidget.h49
-rw-r--r--src/gui/kwidgetlister.cpp60
-rw-r--r--src/gui/kwidgetlister.h41
-rw-r--r--src/gui/lineedit.cpp66
-rw-r--r--src/gui/lineedit.h25
-rw-r--r--src/gui/linefieldwidget.cpp20
-rw-r--r--src/gui/linefieldwidget.h11
-rw-r--r--src/gui/listboxtext.cpp34
-rw-r--r--src/gui/listboxtext.h18
-rw-r--r--src/gui/listview.cpp94
-rw-r--r--src/gui/listview.h45
-rw-r--r--src/gui/numberfieldwidget.cpp46
-rw-r--r--src/gui/numberfieldwidget.h9
-rw-r--r--src/gui/overlaywidget.cpp34
-rw-r--r--src/gui/overlaywidget.h17
-rw-r--r--src/gui/parafieldwidget.cpp26
-rw-r--r--src/gui/parafieldwidget.h9
-rw-r--r--src/gui/previewdialog.cpp10
-rw-r--r--src/gui/previewdialog.h5
-rw-r--r--src/gui/progress.cpp4
-rw-r--r--src/gui/progress.h5
-rw-r--r--src/gui/ratingfieldwidget.cpp12
-rw-r--r--src/gui/ratingfieldwidget.h9
-rw-r--r--src/gui/ratingwidget.cpp52
-rw-r--r--src/gui/ratingwidget.h27
-rw-r--r--src/gui/richtextlabel.cpp20
-rw-r--r--src/gui/richtextlabel.h19
-rw-r--r--src/gui/stringmapdialog.cpp60
-rw-r--r--src/gui/stringmapdialog.h13
-rw-r--r--src/gui/tabcontrol.cpp26
-rw-r--r--src/gui/tabcontrol.h9
-rw-r--r--src/gui/tablefieldwidget.cpp110
-rw-r--r--src/gui/tablefieldwidget.h19
-rw-r--r--src/gui/urlfieldwidget.cpp24
-rw-r--r--src/gui/urlfieldwidget.h17
-rw-r--r--src/image.cpp52
-rw-r--r--src/image.h40
-rw-r--r--src/imagefactory.cpp150
-rw-r--r--src/imagefactory.h74
-rw-r--r--src/importdialog.cpp112
-rw-r--r--src/importdialog.h23
-rw-r--r--src/isbnvalidator.cpp128
-rw-r--r--src/isbnvalidator.h30
-rw-r--r--src/iso5426converter.cpp14
-rw-r--r--src/iso5426converter.h14
-rw-r--r--src/iso6937converter.cpp30
-rw-r--r--src/iso6937converter.h12
-rw-r--r--src/latin1literal.h18
-rw-r--r--src/lccnvalidator.cpp22
-rw-r--r--src/lccnvalidator.h8
-rw-r--r--src/listviewcomparison.cpp82
-rw-r--r--src/listviewcomparison.h36
-rw-r--r--src/loandialog.cpp108
-rw-r--r--src/loandialog.h15
-rw-r--r--src/loanitem.cpp4
-rw-r--r--src/loanitem.h2
-rw-r--r--src/loanview.cpp36
-rw-r--r--src/loanview.h13
-rw-r--r--src/mainwindow.cpp788
-rw-r--r--src/mainwindow.h29
-rw-r--r--src/newstuff/dialog.cpp246
-rw-r--r--src/newstuff/dialog.h47
-rw-r--r--src/newstuff/manager.cpp170
-rw-r--r--src/newstuff/manager.h47
-rw-r--r--src/newstuff/newscript.cpp10
-rw-r--r--src/newstuff/newscript.h9
-rw-r--r--src/newstuff/providerloader.cpp38
-rw-r--r--src/newstuff/providerloader.h27
-rw-r--r--src/progressmanager.cpp36
-rw-r--r--src/progressmanager.h36
-rw-r--r--src/ptrvector.h20
-rw-r--r--src/reportdialog.cpp80
-rw-r--r--src/reportdialog.h7
-rw-r--r--src/rtf2html/rtf2html.cpp6
-rw-r--r--src/rtf2html/rtf2html.h8
-rw-r--r--src/statusbar.cpp50
-rw-r--r--src/statusbar.h11
-rw-r--r--src/stringset.h22
-rw-r--r--src/tellico_debug.h14
-rw-r--r--src/tellico_kernel.cpp66
-rw-r--r--src/tellico_kernel.h34
-rw-r--r--src/tellico_map.h6
-rw-r--r--src/tellico_utils.cpp82
-rw-r--r--src/tellico_utils.h42
-rw-r--r--src/tests/entitytest.cpp4
-rw-r--r--src/tests/isbntest.cpp6
-rw-r--r--src/tests/latin1test.cpp24
-rw-r--r--src/translators/alexandriaexporter.cpp64
-rw-r--r--src/translators/alexandriaexporter.h13
-rw-r--r--src/translators/alexandriaimporter.cpp130
-rw-r--r--src/translators/alexandriaimporter.h13
-rw-r--r--src/translators/amcimporter.cpp128
-rw-r--r--src/translators/amcimporter.h11
-rw-r--r--src/translators/audiofileimporter.cpp168
-rw-r--r--src/translators/audiofileimporter.h15
-rw-r--r--src/translators/bibtexexporter.cpp126
-rw-r--r--src/translators/bibtexexporter.h21
-rw-r--r--src/translators/bibtexhandler.cpp138
-rw-r--r--src/translators/bibtexhandler.h30
-rw-r--r--src/translators/bibteximporter.cpp84
-rw-r--r--src/translators/bibteximporter.h27
-rw-r--r--src/translators/bibtexmlexporter.cpp74
-rw-r--r--src/translators/bibtexmlexporter.h7
-rw-r--r--src/translators/bibtexmlimporter.cpp56
-rw-r--r--src/translators/bibtexmlimporter.h5
-rw-r--r--src/translators/btparse/ast.c2
-rw-r--r--src/translators/btparse/ast.h4
-rw-r--r--src/translators/btparse/bibtex.c2
-rw-r--r--src/translators/btparse/btparse.h6
-rw-r--r--src/translators/btparse/err.c2
-rw-r--r--src/translators/btparse/err.h18
-rw-r--r--src/translators/btparse/input.c14
-rw-r--r--src/translators/btparse/lex_auxiliary.c18
-rw-r--r--src/translators/btparse/parse_auxiliary.c14
-rw-r--r--src/translators/btparse/postprocess.c26
-rw-r--r--src/translators/btparse/scan.c2
-rw-r--r--src/translators/btparse/sym.c2
-rw-r--r--src/translators/btparse/tokens.h2
-rw-r--r--src/translators/csvexporter.cpp94
-rw-r--r--src/translators/csvexporter.h31
-rw-r--r--src/translators/csvimporter.cpp178
-rw-r--r--src/translators/csvimporter.h29
-rw-r--r--src/translators/dataimporter.h11
-rw-r--r--src/translators/dcimporter.cpp52
-rw-r--r--src/translators/dcimporter.h4
-rw-r--r--src/translators/deliciousimporter.cpp32
-rw-r--r--src/translators/deliciousimporter.h3
-rw-r--r--src/translators/exporter.cpp4
-rw-r--r--src/translators/exporter.h15
-rw-r--r--src/translators/filelistingimporter.cpp96
-rw-r--r--src/translators/filelistingimporter.h19
-rw-r--r--src/translators/freedb_util.cpp18
-rw-r--r--src/translators/freedbimporter.cpp220
-rw-r--r--src/translators/freedbimporter.h31
-rw-r--r--src/translators/gcfilmsexporter.cpp50
-rw-r--r--src/translators/gcfilmsexporter.h11
-rw-r--r--src/translators/gcfilmsimporter.cpp116
-rw-r--r--src/translators/gcfilmsimporter.h11
-rwxr-xr-xsrc/translators/griffith2tellico.py12
-rw-r--r--src/translators/griffithimporter.cpp24
-rw-r--r--src/translators/griffithimporter.h3
-rw-r--r--src/translators/grs1importer.cpp56
-rw-r--r--src/translators/grs1importer.h21
-rw-r--r--src/translators/htmlexporter.cpp240
-rw-r--r--src/translators/htmlexporter.h57
-rw-r--r--src/translators/importer.h35
-rw-r--r--src/translators/libcsv.c2
-rw-r--r--src/translators/libcsv.h2
-rw-r--r--src/translators/onixexporter.cpp90
-rw-r--r--src/translators/onixexporter.h17
-rw-r--r--src/translators/pdfimporter.cpp66
-rw-r--r--src/translators/pdfimporter.h1
-rw-r--r--src/translators/pilotdb/pilotdb.cpp8
-rw-r--r--src/translators/pilotdb/pilotdb.h4
-rw-r--r--src/translators/pilotdb/strop.cpp32
-rw-r--r--src/translators/pilotdbexporter.cpp68
-rw-r--r--src/translators/pilotdbexporter.h19
-rw-r--r--src/translators/referencerimporter.cpp12
-rw-r--r--src/translators/referencerimporter.h3
-rw-r--r--src/translators/risimporter.cpp198
-rw-r--r--src/translators/risimporter.h17
-rw-r--r--src/translators/tellico_xml.cpp36
-rw-r--r--src/translators/tellico_xml.h26
-rw-r--r--src/translators/tellicoimporter.cpp378
-rw-r--r--src/translators/tellicoimporter.h25
-rw-r--r--src/translators/tellicoxmlexporter.cpp270
-rw-r--r--src/translators/tellicoxmlexporter.h35
-rw-r--r--src/translators/tellicozipexporter.cpp36
-rw-r--r--src/translators/tellicozipexporter.h7
-rw-r--r--src/translators/textimporter.cpp2
-rw-r--r--src/translators/textimporter.h3
-rw-r--r--src/translators/xmlimporter.cpp28
-rw-r--r--src/translators/xmlimporter.h15
-rw-r--r--src/translators/xsltexporter.cpp36
-rw-r--r--src/translators/xsltexporter.h8
-rw-r--r--src/translators/xslthandler.cpp82
-rw-r--r--src/translators/xslthandler.h30
-rw-r--r--src/translators/xsltimporter.cpp28
-rw-r--r--src/translators/xsltimporter.h5
-rw-r--r--src/upcvalidator.cpp46
-rw-r--r--src/upcvalidator.h13
-rw-r--r--src/viewstack.cpp8
-rw-r--r--src/viewstack.h7
-rw-r--r--src/xmphandler.cpp16
-rw-r--r--src/xmphandler.h4
387 files changed, 10320 insertions, 10186 deletions
diff --git a/src/barcode/barcode.cpp b/src/barcode/barcode.cpp
index 2427f4e..1c2d1f2 100644
--- a/src/barcode/barcode.cpp
+++ b/src/barcode/barcode.cpp
@@ -15,8 +15,8 @@
// includes code from http://v4l2spec.bytesex.org/spec/a16323.htm
-#include <qimage.h>
-#include <qmutex.h>
+#include <tqimage.h>
+#include <tqmutex.h>
#include "barcode.h"
#include <stdlib.h>
@@ -53,13 +53,13 @@ void barcodeRecognitionThread::run()
Barcode_EAN13 old;
while (!stop) {
- QImage img;
+ TQImage img;
m_barcode_img_mutex.lock();
if (m_barcode_img.isNull())
img = m_barcode_v4l->grab_one2();
else {
img = m_barcode_img;
- m_barcode_img = QImage();
+ m_barcode_img = TQImage();
}
m_barcode_img_mutex.unlock();
@@ -69,7 +69,7 @@ void barcodeRecognitionThread::run()
// //DEBUG
if (!img.isNull()) {
- QImage preview = img.scale( 320, 240, QImage::ScaleMin );
+ TQImage preview = img.scale( 320, 240, TQ_ScaleMin );
emit gotImage( preview );
Barcode_EAN13 barcode = recognize( img );
if (barcode.isValid() && (old != barcode)) {
@@ -94,7 +94,7 @@ void barcodeRecognitionThread::stop()
}
-void barcodeRecognitionThread::recognizeBarcode( QImage img )
+void barcodeRecognitionThread::recognizeBarcode( TQImage img )
{
// attention! This function is called from GUI context
m_barcode_img_mutex.lock();
@@ -102,7 +102,7 @@ void barcodeRecognitionThread::recognizeBarcode( QImage img )
m_barcode_img_mutex.unlock();
}
-Barcode_EAN13 barcodeRecognitionThread::recognize( QImage img )
+Barcode_EAN13 barcodeRecognitionThread::recognize( TQImage img )
{
// PARAMETERS:
int amount_scanlines = 30;
@@ -110,7 +110,7 @@ Barcode_EAN13 barcodeRecognitionThread::recognize( QImage img )
int h = img.height();
// the array which will contain the result:
- QValueVector< QValueVector<int> > numbers( amount_scanlines, QValueVector<int>(13,-1) ); // no init in java source!!!!!!!!!
+ TQValueVector< TQValueVector<int> > numbers( amount_scanlines, TQValueVector<int>(13,-1) ); // no init in java source!!!!!!!!!
// generate and initialize the array that will contain all detected
// digits at a specific code position:
@@ -170,14 +170,14 @@ Barcode_EAN13 barcodeRecognitionThread::recognize( QImage img )
void barcodeRecognitionThread::printArray( int array[10][13][2], int level )
{
for (int i = 0; i < 10; i++) {
- QCString temp;
+ TQCString temp;
temp.setNum( i );
fprintf( stderr, temp + " : " );
for (int j = 0; j < 13; j++) {
if (array[i][j][level] == -1)
fprintf( stderr, "x " );
else {
- QCString temp;
+ TQCString temp;
temp.setNum( array[i][j][level] );
fprintf( stderr, temp + " " );
}
@@ -186,20 +186,20 @@ void barcodeRecognitionThread::printArray( int array[10][13][2], int level )
}
}
-barcodeRecognition::Barcode_EAN13 barcodeRecognitionThread::recognizeCode( QImage img, int x1, int x2, int y )
+barcodeRecognition::Barcode_EAN13 barcodeRecognitionThread::recognizeCode( TQImage img, int x1, int x2, int y )
{
- QValueVector<QRgb> raw_path(x2-x1+1);
+ TQValueVector<TQRgb> raw_path(x2-x1+1);
for (int x=x1; x<=x2; x++)
raw_path[x-x1] = img.pixel(x,y);
// convert the given path into a string of black and white pixels:
- QValueVector<int> string = transformPathToBW( raw_path );
+ TQValueVector<int> string = transformPathToBW( raw_path );
// convert the string of black&white pixels into a list, containing
// information about the black and white fields
// first indes = field nr.
// second index: 0 = color of the field
// 1 = field length
- QValueVector< QValueVector<int> > fields = extractFieldInformation( string );
+ TQValueVector< TQValueVector<int> > fields = extractFieldInformation( string );
// try to recognize a EAN13 code:
Barcode_EAN13 barcode = Decoder_EAN13::recognize( fields );
@@ -207,7 +207,7 @@ barcodeRecognition::Barcode_EAN13 barcodeRecognitionThread::recognizeCode( QImag
return barcode;
}
-void barcodeRecognitionThread::addNumberToPossibleNumbers( QValueVector<int> number, int possible_numbers[10][13][2], bool correct_code )
+void barcodeRecognitionThread::addNumberToPossibleNumbers( TQValueVector<int> number, int possible_numbers[10][13][2], bool correct_code )
{
int i;
bool digit_contained;
@@ -278,7 +278,7 @@ void barcodeRecognitionThread::sortDigits( int possible_numbers[10][13][2] )
Barcode_EAN13 barcodeRecognitionThread::extractBarcode( int possible_numbers[10][13][2] )
{
// create and initialize the temporary variables:
- QValueVector<int> temp_code(13);
+ TQValueVector<int> temp_code(13);
for (int i = 0; i < 13; i++)
temp_code[i] = possible_numbers[0][i][0];
@@ -295,13 +295,13 @@ Barcode_EAN13 barcodeRecognitionThread::extractBarcode( int possible_numbers[10]
Barcode_EAN13 barcodeRecognitionThread::detectValidBarcode ( int possible_numbers[10][13][2], int max_amount_of_considered_codes )
{
// create and initialize the temporary variables:
- QValueVector<int> temp_code(13);
+ TQValueVector<int> temp_code(13);
for ( int i = 0; i < 13; i++ )
temp_code[i] = possible_numbers[0][i][0];
int alternative_amount = 0;
- QValueVector<int> counter( 13 ); // no init in java source!!!
+ TQValueVector<int> counter( 13 ); // no init in java source!!!
int counter_nr = 11;
// check if there is at least one complete code present:
@@ -367,12 +367,12 @@ Barcode_EAN13 barcodeRecognitionThread::detectValidBarcode ( int possible_number
bool barcodeRecognitionThread::isValid( int numbers[13] )
{
- QValueVector<int> temp(13);
+ TQValueVector<int> temp(13);
for (int i=0; i<13; i++)
temp[i] = numbers[i];
return isValid( temp );
}
-bool barcodeRecognitionThread::isValid( QValueVector<int> numbers )
+bool barcodeRecognitionThread::isValid( TQValueVector<int> numbers )
{
Q_ASSERT( numbers.count() == 13 );
// calculate the checksum of the barcode:
@@ -393,17 +393,17 @@ bool barcodeRecognitionThread::isValid( QValueVector<int> numbers )
return (numbers[12] == checksum_digit);
}
-QValueVector<int> barcodeRecognitionThread::transformPathToBW( QValueVector<QRgb> line )
+TQValueVector<int> barcodeRecognitionThread::transformPathToBW( TQValueVector<TQRgb> line )
{
int w = line.count();
- QValueVector<int> bw_line(w,0);
+ TQValueVector<int> bw_line(w,0);
bw_line[0] = 255;
// create greyscale values:
- QValueVector<int> grey_line(w,0);
+ TQValueVector<int> grey_line(w,0);
int average_illumination = 0;
for (int x = 0; x < w; x++) {
- grey_line[x] = (qRed(line.at(x)) + qGreen(line.at(x)) + qBlue(line.at(x))) / 3;
+ grey_line[x] = (tqRed(line.at(x)) + tqGreen(line.at(x)) + tqBlue(line.at(x))) / 3;
average_illumination = average_illumination + grey_line[x];
}
average_illumination = average_illumination / w;
@@ -452,7 +452,7 @@ QValueVector<int> barcodeRecognitionThread::transformPathToBW( QValueVector<QRgb
}
}
- QValueVector<int> ret(w,0);
+ TQValueVector<int> ret(w,0);
for (int i=0; i<w; i++)
ret[i] = bw_line[i];
@@ -469,12 +469,12 @@ QValueVector<int> barcodeRecognitionThread::transformPathToBW( QValueVector<QRgb
return ret;
}
-QValueVector< QValueVector<int> > barcodeRecognitionThread::extractFieldInformation( QValueVector<int> string )
+TQValueVector< TQValueVector<int> > barcodeRecognitionThread::extractFieldInformation( TQValueVector<int> string )
{
- QValueVector< QValueVector<int> > temp_fields( string.count(), QValueVector<int>(2,0) );
+ TQValueVector< TQValueVector<int> > temp_fields( string.count(), TQValueVector<int>(2,0) );
if (string.count() == 0)
- return QValueVector< QValueVector<int> >();
+ return TQValueVector< TQValueVector<int> >();
int field_counter = 0;
int last_value = string.at(0);
@@ -513,13 +513,13 @@ Barcode_EAN13::Barcode_EAN13()
}
//ok
-Barcode_EAN13::Barcode_EAN13( QValueVector<int> code )
+Barcode_EAN13::Barcode_EAN13( TQValueVector<int> code )
{
setCode( code );
}
//ok
-void Barcode_EAN13::setCode( QValueVector<int> code )
+void Barcode_EAN13::setCode( TQValueVector<int> code )
{
if (code.count() != 13) {
m_numbers.clear();
@@ -553,18 +553,18 @@ bool Barcode_EAN13::isValid() const
}
//ok
-QValueVector<int> Barcode_EAN13::getNumbers() const
+TQValueVector<int> Barcode_EAN13::getNumbers() const
{
return m_numbers;
}
//ok
-QString Barcode_EAN13::toString() const
+TQString Barcode_EAN13::toString() const
{
- QString s;
+ TQString s;
for (int i = 0; i < 13; i++)
if ((m_numbers[i] >= 0) && (m_numbers[i] <= 9))
- s += QString::number(m_numbers[i]);
+ s += TQString::number(m_numbers[i]);
else
s += '?';
return s;
@@ -583,17 +583,17 @@ bool Barcode_EAN13::operator!= ( const Barcode_EAN13 &code )
}
//ok
-Barcode_EAN13 Decoder_EAN13::recognize( QValueVector< QValueVector<int> > fields )
+Barcode_EAN13 Decoder_EAN13::recognize( TQValueVector< TQValueVector<int> > fields )
{
// try to extract the encoded information from the field series:
- QValueVector<int> numbers = decode( fields, 0, fields.count() );
+ TQValueVector<int> numbers = decode( fields, 0, fields.count() );
Barcode_EAN13 barcode( numbers );
// return the results:
return barcode;
}
-QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > fields, int start_i, int end_i )
+TQValueVector<int> Decoder_EAN13::decode( TQValueVector< TQValueVector<int> > fields, int start_i, int end_i )
{
// determine the length of the path in pixels
int length = 0;
@@ -617,11 +617,11 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field
// consistency checks:
if (fields.count() <= 0)
- return QValueVector<int>();
+ return TQValueVector<int>();
if (start_i > end_i - 3)
- return QValueVector<int>();
+ return TQValueVector<int>();
if (end_i - start_i < 30)
- return QValueVector<int>(); // (just a rough value)
+ return TQValueVector<int>(); // (just a rough value)
// relevant indexes:
int start_sentinel_i;
@@ -634,7 +634,7 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field
float unit_length;
// results:
- QValueVector<int> numbers( 13, -1 ); // the java source does no initialization
+ TQValueVector<int> numbers( 13, -1 ); // the java source does no initialization
// determine the relevant positions:
@@ -657,7 +657,7 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field
#endif
if (start_sentinel_i < 0)
- return QValueVector<int>();
+ return TQValueVector<int>();
// calculate the other positions:
left_numbers_i = start_sentinel_i + 3;
@@ -666,7 +666,7 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field
end_sentinel_i = right_numbers_i + 6 * 4;
if (end_sentinel_i + 3 > end_i)
- return QValueVector<int>();
+ return TQValueVector<int>();
// calculate the average (pixel) length of a bar that is one unit wide:
// (a complete barcode consists out of 95 length units)
@@ -680,10 +680,10 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field
fprintf( stderr, "unit_width: %f\n", unit_length );
#endif
- QValueVector< QValueVector<int> > current_number_field( 4, QValueVector<int>(2,0) );
+ TQValueVector< TQValueVector<int> > current_number_field( 4, TQValueVector<int>(2,0) );
if (left_numbers_i + 1 > end_i)
- return QValueVector<int>();
+ return TQValueVector<int>();
// test the side from which we are reading the barcode:
@@ -773,7 +773,7 @@ QValueVector<int> Decoder_EAN13::decode( QValueVector< QValueVector<int> > field
return numbers;
}
-MatchMakerResult Decoder_EAN13::recognizeNumber( QValueVector< QValueVector<int> > fields, int code_table_to_use)
+MatchMakerResult Decoder_EAN13::recognizeNumber( TQValueVector< TQValueVector<int> > fields, int code_table_to_use)
{
// convert the pixel lenghts of the four black&white fields into
// normed values that have together a length of 70;
@@ -799,7 +799,7 @@ MatchMakerResult Decoder_EAN13::recognizeNumber( QValueVector< QValueVector<int>
int odd_min_difference_index = 0;
if ((code_table_to_use == BOTH_TABLES)||(code_table_to_use == EVEN_TABLE)) {
- QValueVector<int> even_differences(10,0);
+ TQValueVector<int> even_differences(10,0);
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 4; j++) {
@@ -818,7 +818,7 @@ MatchMakerResult Decoder_EAN13::recognizeNumber( QValueVector< QValueVector<int>
}
if ((code_table_to_use == BOTH_TABLES) || (code_table_to_use == ODD_TABLE)) {
- QValueVector<int> odd_differences(10,0);
+ TQValueVector<int> odd_differences(10,0);
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 4; j++) {
diff --git a/src/barcode/barcode.h b/src/barcode/barcode.h
index b8d71bc..6155108 100644
--- a/src/barcode/barcode.h
+++ b/src/barcode/barcode.h
@@ -16,11 +16,11 @@
#ifndef BARCODE_H
#define BARCODE_H
-#include <qthread.h>
-#include <qimage.h>
-#include <qvaluevector.h>
-#include <qobject.h>
-#include <qmutex.h>
+#include <tqthread.h>
+#include <tqimage.h>
+#include <tqvaluevector.h>
+#include <tqobject.h>
+#include <tqmutex.h>
#include <math.h>
#include "barcode_v4l.h"
@@ -66,15 +66,15 @@ namespace barcodeRecognition {
class Barcode_EAN13 {
public:
Barcode_EAN13();
- Barcode_EAN13( QValueVector<int> code );
+ Barcode_EAN13( TQValueVector<int> code );
bool isNull() const { return m_null; }
bool isValid() const;
- QValueVector<int> getNumbers() const;
- void setCode( QValueVector<int> code );
- QString toString() const;
+ TQValueVector<int> getNumbers() const;
+ void setCode( TQValueVector<int> code );
+ TQString toString() const;
bool operator!= ( const Barcode_EAN13 &code );
protected:
- QValueVector<int> m_numbers;
+ TQValueVector<int> m_numbers;
bool m_null;
};
@@ -91,43 +91,44 @@ namespace barcodeRecognition {
class Decoder_EAN13 {
public:
enum { BOTH_TABLES = 0, EVEN_TABLE = 1, ODD_TABLE = 2 };
- static Barcode_EAN13 recognize( QValueVector< QValueVector<int> > fields );
- static QValueVector<int> decode( QValueVector< QValueVector<int> > fields, int start_i, int end_i );
- static MatchMakerResult recognizeNumber( QValueVector< QValueVector<int> > fields, int code_table_to_use );
+ static Barcode_EAN13 recognize( TQValueVector< TQValueVector<int> > fields );
+ static TQValueVector<int> decode( TQValueVector< TQValueVector<int> > fields, int start_i, int end_i );
+ static MatchMakerResult recognizeNumber( TQValueVector< TQValueVector<int> > fields, int code_table_to_use );
static MatchMakerResult recognizeSystemCode( bool parity_pattern[6] );
};
/** \brief this thread handles barcode recognition using webcams
* @author Sebastian Held <[email protected]>
*/
- class barcodeRecognitionThread : public QObject, public QThread {
+ class barcodeRecognitionThread : public TQObject, public TQThread {
Q_OBJECT
+ TQ_OBJECT
public:
barcodeRecognitionThread();
~barcodeRecognitionThread();
virtual void run();
void stop();
- void recognizeBarcode( QImage img );
+ void recognizeBarcode( TQImage img );
bool isWebcamAvailable();
signals:
- void recognized( QString barcode );
- void gotImage( QImage &img );
+ void recognized( TQString barcode );
+ void gotImage( TQImage &img );
protected:
volatile bool m_stop;
- QImage m_barcode_img;
- QMutex m_stop_mutex, m_barcode_img_mutex;
+ TQImage m_barcode_img;
+ TQMutex m_stop_mutex, m_barcode_img_mutex;
barcode_v4l *m_barcode_v4l;
- Barcode_EAN13 recognize( QImage img );
- Barcode_EAN13 recognizeCode( QImage img, int x1, int x2, int y );
- void addNumberToPossibleNumbers( QValueVector<int> number, int possible_numbers[10][13][2], bool correct_code );
+ Barcode_EAN13 recognize( TQImage img );
+ Barcode_EAN13 recognizeCode( TQImage img, int x1, int x2, int y );
+ void addNumberToPossibleNumbers( TQValueVector<int> number, int possible_numbers[10][13][2], bool correct_code );
void sortDigits( int possible_numbers[10][13][2] );
Barcode_EAN13 extractBarcode( int possible_numbers[10][13][2] );
- QValueVector<int> transformPathToBW( QValueVector<QRgb> line);
- QValueVector< QValueVector<int> > extractFieldInformation( QValueVector<int> string );
+ TQValueVector<int> transformPathToBW( TQValueVector<TQRgb> line);
+ TQValueVector< TQValueVector<int> > extractFieldInformation( TQValueVector<int> string );
Barcode_EAN13 detectValidBarcode ( int possible_numbers[10][13][2], int max_amount_of_considered_codes );
bool isValid( int numbers[13] );
- bool isValid( QValueVector<int> numbers );
+ bool isValid( TQValueVector<int> numbers );
void printArray( int array[10][13][2], int level );
};
}
diff --git a/src/barcode/barcode_v4l.cpp b/src/barcode/barcode_v4l.cpp
index f644fe1..73cbbd2 100644
--- a/src/barcode/barcode_v4l.cpp
+++ b/src/barcode/barcode_v4l.cpp
@@ -34,7 +34,7 @@ using barcodeRecognition::ng_vid_driver_v4l;
using barcodeRecognition::barcode_v4l;
using barcodeRecognition::video_converter;
-QPtrList<barcodeRecognition::video_converter> barcodeRecognition::ng_vid_driver::m_converter;
+TQPtrList<barcodeRecognition::video_converter> barcodeRecognition::ng_vid_driver::m_converter;
const char *barcodeRecognition::device_cap[] = { "capture", "tuner", "teletext", "overlay", "chromakey", "clipping", "frameram", "scales", "monochrome", 0 };
const unsigned int barcodeRecognition::ng_vfmt_to_depth[] = {
0, /* unused */
@@ -157,30 +157,30 @@ bool barcode_v4l::isOpen()
return m_drv;
}
-QImage barcode_v4l::grab_one2()
+TQImage barcode_v4l::grab_one2()
{
if (!m_drv) {
myDebug() << "no driver/device available" << endl;
- return QImage();
+ return TQImage();
}
- QByteArray *cap;
+ TQByteArray *cap;
if (!(cap = m_drv->getimage2())) {
myDebug() << "capturing image failed" << endl;
- return QImage();
+ return TQImage();
}
- QByteArray *buf;
+ TQByteArray *buf;
if (m_conv) {
- buf = new QByteArray( 3*m_fmt.width*m_fmt.height );
+ buf = new TQByteArray( 3*m_fmt.width*m_fmt.height );
m_conv->frame( buf, cap, m_fmt_drv );
} else {
- buf = new QByteArray(*cap);
+ buf = new TQByteArray(*cap);
}
delete cap;
int depth = 32;
- QByteArray *buf2 = new QByteArray( depth/8 *m_fmt.width*m_fmt.height );
+ TQByteArray *buf2 = new TQByteArray( depth/8 *m_fmt.width*m_fmt.height );
for (uint i=0; i<m_fmt.width*m_fmt.height; i++) {
(*buf2)[i*4+0] = buf->at(i*3+2);
(*buf2)[i*4+1] = buf->at(i*3+1);
@@ -188,8 +188,8 @@ QImage barcode_v4l::grab_one2()
(*buf2)[i*4+3] = 0;
}
delete buf;
- QImage *temp = new QImage( (uchar*)buf2->data(), m_fmt.width, m_fmt.height, depth, 0, 0, QImage::LittleEndian );
- QImage temp2 = temp->copy();
+ TQImage *temp = new TQImage( (uchar*)buf2->data(), m_fmt.width, m_fmt.height, depth, 0, 0, TQImage::LittleEndian );
+ TQImage temp2 = temp->copy();
delete temp;
delete buf2;
@@ -253,7 +253,7 @@ bool barcode_v4l::grab_init()
}
-ng_vid_driver* ng_vid_driver::createDriver( QString device )
+ng_vid_driver* ng_vid_driver::createDriver( TQString device )
{
/* check all grabber drivers */
ng_vid_driver *drv = new ng_vid_driver_v4l();
@@ -336,7 +336,7 @@ ng_vid_driver_v4l::ng_vid_driver_v4l()
format2palette[VIDEO_YUV420P] = VIDEO_PALETTE_YUV420P;
}
-bool ng_vid_driver_v4l::open2( QString device )
+bool ng_vid_driver_v4l::open2( TQString device )
{
/* open device */
if ((m_fd = ::open( device.latin1(), O_RDWR )) == -1) {
@@ -445,7 +445,7 @@ bool ng_vid_driver_v4l::read_setformat( ng_video_fmt *fmt )
return true;
}
-QByteArray* ng_vid_driver_v4l::getimage2()
+TQByteArray* ng_vid_driver_v4l::getimage2()
{
#ifdef Barcode_DEBUG
myDebug() << "v4l: getimage2" << endl;
@@ -455,13 +455,13 @@ QByteArray* ng_vid_driver_v4l::getimage2()
}
-QByteArray* ng_vid_driver_v4l::read_getframe2()
+TQByteArray* ng_vid_driver_v4l::read_getframe2()
{
- QByteArray* buf;
+ TQByteArray* buf;
int size;
size = m_fmt.bytesperline * m_fmt.height;
- buf = new QByteArray( size );
+ buf = new TQByteArray( size );
if (size != read( m_fd, buf->data(), size )) {
delete( buf );
return 0;
@@ -502,7 +502,7 @@ QByteArray* ng_vid_driver_v4l::read_getframe2()
barcodeRecognition::ng_yuv_g2[blue] ]
#define BLUE(gray,blue) ng_clip[ CLIP + gray + barcodeRecognition::ng_yuv_blue[blue] ]
-void barcodeRecognition::yuv420p_to_rgb24::frame( QByteArray *out, const QByteArray *in, const ng_video_fmt fmt )
+void barcodeRecognition::yuv420p_to_rgb24::frame( TQByteArray *out, const TQByteArray *in, const ng_video_fmt fmt )
{
unsigned char *y, *u, *v, *d;
unsigned char *us,*vs;
diff --git a/src/barcode/barcode_v4l.h b/src/barcode/barcode_v4l.h
index f0cde90..3ab1a32 100644
--- a/src/barcode/barcode_v4l.h
+++ b/src/barcode/barcode_v4l.h
@@ -33,8 +33,8 @@
//#include <linux/videodev2.h>
#include <linux/videodev.h>
-#include <qstring.h>
-#include <qimage.h>
+#include <tqstring.h>
+#include <tqimage.h>
namespace barcodeRecognition {
@@ -72,7 +72,7 @@ public:
virtual ~video_converter() {;}
virtual void init( ng_video_fmt* ) {;}
virtual void exit() {;}
- virtual void frame( QByteArray*, const QByteArray*, ng_video_fmt ) {;}
+ virtual void frame( TQByteArray*, const TQByteArray*, ng_video_fmt ) {;}
int fmtid_in() {return m_fmtid_in;}
int fmtid_out() {return m_fmtid_out;}
protected:
@@ -83,46 +83,46 @@ class yuv422p_to_rgb24 : public video_converter
{
public:
yuv422p_to_rgb24() {m_fmtid_in=VIDEO_YUV422P; m_fmtid_out=VIDEO_RGB24;}
- virtual void frame( QByteArray *, const QByteArray *, ng_video_fmt ) {;}
+ virtual void frame( TQByteArray *, const TQByteArray *, ng_video_fmt ) {;}
};
class yuv422_to_rgb24 : public video_converter
{
public:
yuv422_to_rgb24() {m_fmtid_in=VIDEO_YUYV; m_fmtid_out=VIDEO_RGB24;}
- virtual void frame( QByteArray *, const QByteArray *, ng_video_fmt ) {;}
+ virtual void frame( TQByteArray *, const TQByteArray *, ng_video_fmt ) {;}
};
class yuv420p_to_rgb24 : public video_converter
{
public:
yuv420p_to_rgb24() {m_fmtid_in=VIDEO_YUV420P; m_fmtid_out=VIDEO_RGB24;}
- virtual void frame( QByteArray *, const QByteArray *, ng_video_fmt );
+ virtual void frame( TQByteArray *, const TQByteArray *, ng_video_fmt );
};
class ng_vid_driver
{
public:
- static ng_vid_driver *createDriver( QString device );
+ static ng_vid_driver *createDriver( TQString device );
static int xioctl( int fd, int cmd, void *arg );
/* open/close */
- virtual bool open2( QString device ) = 0;
+ virtual bool open2( TQString device ) = 0;
virtual void close() = 0;
/* attributes */
- virtual QString get_devname() {return m_name;}
+ virtual TQString get_devname() {return m_name;}
virtual int capabilities() = 0;
/* capture */
virtual bool setformat( ng_video_fmt *fmt ) = 0;
- virtual QByteArray* getimage2() = 0; /* single image */
+ virtual TQByteArray* getimage2() = 0; /* single image */
// video converter
static void register_video_converter( video_converter *conv );
static video_converter *find_video_converter( int out, int in );
protected:
- QString m_name;
- static QPtrList<video_converter> m_converter;
+ TQString m_name;
+ static TQPtrList<video_converter> m_converter;
};
@@ -131,13 +131,13 @@ class barcode_v4l
public:
barcode_v4l();
~barcode_v4l();
- QImage grab_one2();
+ TQImage grab_one2();
bool isOpen();
protected:
bool grab_init();
- QString m_devname;
+ TQString m_devname;
int m_grab_width, m_grab_height;
ng_vid_driver *m_drv;
ng_video_fmt m_fmt, m_fmt_drv;
@@ -152,8 +152,8 @@ public:
ng_vid_driver_v4l();
/* open/close */
- //virtual bool open( QString device );
- virtual bool open2( QString device );
+ //virtual bool open( TQString device );
+ virtual bool open2( TQString device );
virtual void close();
/* attributes */
@@ -162,11 +162,11 @@ public:
/* capture */
virtual bool setformat( ng_video_fmt *fmt );
//virtual ng_video_buf* getimage(); /* single image */
- virtual QByteArray* getimage2(); /* single image */
+ virtual TQByteArray* getimage2(); /* single image */
protected:
bool read_setformat( ng_video_fmt *fmt );
- QByteArray* read_getframe2();
+ TQByteArray* read_getframe2();
void *m_drv;
int m_fd;
video_capability m_capability;
diff --git a/src/borrower.cpp b/src/borrower.cpp
index 2e3fa0b..594c946 100644
--- a/src/borrower.cpp
+++ b/src/borrower.cpp
@@ -18,7 +18,7 @@
using Tellico::Data::Loan;
using Tellico::Data::Borrower;
-Loan::Loan(Data::EntryPtr entry, const QDate& loanDate, const QDate& dueDate, const QString& note)
+Loan::Loan(Data::EntryPtr entry, const TQDate& loanDate, const TQDate& dueDate, const TQString& note)
: KShared(), m_uid(Tellico::uid()), m_borrower(0), m_entry(entry), m_loanDate(loanDate), m_dueDate(dueDate),
m_note(note), m_inCalendar(false) {
}
@@ -36,7 +36,7 @@ Tellico::Data::EntryPtr Loan::entry() const {
return m_entry;
}
-Borrower::Borrower(const QString& name_, const QString& uid_)
+Borrower::Borrower(const TQString& name_, const TQString& uid_)
: KShared(), m_name(name_), m_uid(uid_) {
}
diff --git a/src/borrower.h b/src/borrower.h
index 049badf..7b6e051 100644
--- a/src/borrower.h
+++ b/src/borrower.h
@@ -18,7 +18,7 @@
#include <ksharedptr.h>
-#include <qdatetime.h>
+#include <tqdatetime.h>
namespace Tellico {
namespace Data {
@@ -26,24 +26,24 @@ namespace Tellico {
class Loan : public KShared {
public:
- Loan(Data::EntryPtr entry, const QDate& loanDate, const QDate& dueDate, const QString& note);
+ Loan(Data::EntryPtr entry, const TQDate& loanDate, const TQDate& dueDate, const TQString& note);
Loan(const Loan& other);
Data::BorrowerPtr borrower() const;
void setBorrower(Data::BorrowerPtr b) { m_borrower = b; }
- const QString& uid() const { return m_uid; }
- void setUID(const QString& uid) { m_uid = uid; }
+ const TQString& uid() const { return m_uid; }
+ void setUID(const TQString& uid) { m_uid = uid; }
Data::EntryPtr entry() const;
- const QDate& loanDate() const { return m_loanDate; }
+ const TQDate& loanDate() const { return m_loanDate; }
- const QDate& dueDate() const { return m_dueDate; }
- void setDueDate(const QDate& date) { m_dueDate = date; }
+ const TQDate& dueDate() const { return m_dueDate; }
+ void setDueDate(const TQDate& date) { m_dueDate = date; }
- const QString& note() const { return m_note; }
- void setNote(const QString& text) { m_note = text; }
+ const TQString& note() const { return m_note; }
+ void setNote(const TQString& text) { m_note = text; }
bool inCalendar() const { return m_inCalendar; }
void setInCalendar(bool inCalendar) { m_inCalendar = inCalendar; }
@@ -51,12 +51,12 @@ public:
private:
Loan& operator=(const Loan&);
- QString m_uid;
+ TQString m_uid;
Data::BorrowerPtr m_borrower;
Data::EntryPtr m_entry;
- QDate m_loanDate;
- QDate m_dueDate;
- QString m_note;
+ TQDate m_loanDate;
+ TQDate m_dueDate;
+ TQString m_note;
bool m_inCalendar;
};
@@ -70,12 +70,12 @@ typedef LoanVec::Iterator LoanVecIt;
class Borrower : public KShared {
public:
- Borrower(const QString& name, const QString& uid);
+ Borrower(const TQString& name, const TQString& uid);
Borrower(const Borrower& other);
Borrower& operator=(const Borrower& other);
- const QString& uid() const { return m_uid; }
- const QString& name() const { return m_name; }
+ const TQString& uid() const { return m_uid; }
+ const TQString& name() const { return m_name; }
const LoanVec& loans() const { return m_loans; }
bool isEmpty() const { return m_loans.isEmpty(); }
int count() const { return m_loans.count(); }
@@ -85,8 +85,8 @@ public:
bool removeLoan(Data::LoanPtr loan);
private:
- QString m_name;
- QString m_uid; // uid used by KABC
+ TQString m_name;
+ TQString m_uid; // uid used by KABC
LoanVec m_loans;
};
diff --git a/src/borrowerdialog.cpp b/src/borrowerdialog.cpp
index 4346b6b..d7a8b22 100644
--- a/src/borrowerdialog.cpp
+++ b/src/borrowerdialog.cpp
@@ -21,48 +21,48 @@
#include <kabc/stdaddressbook.h>
#include <kiconloader.h>
-#include <qlayout.h>
+#include <tqlayout.h>
using Tellico::BorrowerDialog;
-BorrowerDialog::Item::Item(KListView* parent_, const KABC::Addressee& add_)
- : KListViewItem(parent_), m_uid(add_.uid()) {
+BorrowerDialog::Item::Item(KListView* tqparent_, const KABC::Addressee& add_)
+ : KListViewItem(tqparent_), m_uid(add_.uid()) {
setText(0, add_.realName());
- setPixmap(0, SmallIcon(QString::fromLatin1("kaddressbook")));
+ setPixmap(0, SmallIcon(TQString::tqfromLatin1("kaddressbook")));
}
-BorrowerDialog::Item::Item(KListView* parent_, const Data::Borrower& bor_)
- : KListViewItem(parent_), m_uid(bor_.uid()) {
+BorrowerDialog::Item::Item(KListView* tqparent_, const Data::Borrower& bor_)
+ : KListViewItem(tqparent_), m_uid(bor_.uid()) {
setText(0, bor_.name());
- setPixmap(0, SmallIcon(QString::fromLatin1("tellico")));
+ setPixmap(0, SmallIcon(TQString::tqfromLatin1("tellico")));
}
// default button is going to be used as a print button, so it's separated
-BorrowerDialog::BorrowerDialog(QWidget* parent_, const char* name_/*=0*/)
- : KDialogBase(parent_, name_, true, i18n("Select Borrower"), Ok|Cancel) {
- QWidget* mainWidget = new QWidget(this, "BorrowerDialog mainWidget");
+BorrowerDialog::BorrowerDialog(TQWidget* tqparent_, const char* name_/*=0*/)
+ : KDialogBase(tqparent_, name_, true, i18n("Select Borrower"), Ok|Cancel) {
+ TQWidget* mainWidget = new TQWidget(this, "BorrowerDialog mainWidget");
setMainWidget(mainWidget);
- QVBoxLayout* topLayout = new QVBoxLayout(mainWidget, 0, KDialog::spacingHint());
+ TQVBoxLayout* topLayout = new TQVBoxLayout(mainWidget, 0, KDialog::spacingHint());
m_listView = new KListView(mainWidget);
topLayout->addWidget(m_listView);
m_listView->addColumn(i18n("Name"));
m_listView->setFullWidth(true);
- connect(m_listView, SIGNAL(doubleClicked(QListViewItem*)), SLOT(slotOk()));
- connect(m_listView, SIGNAL(selectionChanged(QListViewItem*)), SLOT(updateEdit(QListViewItem*)));
+ connect(m_listView, TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_SLOT(slotOk()));
+ connect(m_listView, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(updateEdit(TQListViewItem*)));
m_lineEdit = new KLineEdit(mainWidget);
topLayout->addWidget(m_lineEdit);
- connect(m_lineEdit->completionObject(), SIGNAL(match(const QString&)),
- SLOT(selectItem(const QString&)));
+ connect(m_lineEdit->completionObject(), TQT_SIGNAL(match(const TQString&)),
+ TQT_SLOT(selectItem(const TQString&)));
m_lineEdit->setFocus();
m_lineEdit->completionObject()->setIgnoreCase(true);
KABC::AddressBook* abook = KABC::StdAddressBook::self(true);
- connect(abook, SIGNAL(addressBookChanged(AddressBook*)),
- SLOT(slotLoadAddressBook()));
- connect(abook, SIGNAL(loadingFinished(Resource*)),
- SLOT(slotLoadAddressBook()));
+ connect(abook, TQT_SIGNAL(addressBookChanged(AddressBook*)),
+ TQT_SLOT(slotLoadAddressBook()));
+ connect(abook, TQT_SIGNAL(loadingFinished(Resource*)),
+ TQT_SLOT(slotLoadAddressBook()));
slotLoadAddressBook();
setMinimumWidth(400);
@@ -99,12 +99,12 @@ void BorrowerDialog::slotLoadAddressBook() {
m_listView->sort();
}
-void BorrowerDialog::selectItem(const QString& str_) {
+void BorrowerDialog::selectItem(const TQString& str_) {
if(str_.isEmpty()) {
return;
}
- QListViewItem* item = m_itemDict.find(str_);
+ TQListViewItem* item = m_itemDict.tqfind(str_);
if(item) {
m_listView->blockSignals(true);
m_listView->setSelected(item, true);
@@ -113,7 +113,7 @@ void BorrowerDialog::selectItem(const QString& str_) {
}
}
-void BorrowerDialog::updateEdit(QListViewItem* item_) {
+void BorrowerDialog::updateEdit(TQListViewItem* item_) {
m_lineEdit->setText(item_->text(0));
m_lineEdit->setSelection(0, item_->text(0).length());
m_uid = static_cast<Item*>(item_)->uid();
@@ -124,10 +124,10 @@ Tellico::Data::BorrowerPtr BorrowerDialog::borrower() {
}
// static
-Tellico::Data::BorrowerPtr BorrowerDialog::getBorrower(QWidget* parent_) {
- BorrowerDialog dlg(parent_);
+Tellico::Data::BorrowerPtr BorrowerDialog::getBorrower(TQWidget* tqparent_) {
+ BorrowerDialog dlg(tqparent_);
- if(dlg.exec() == QDialog::Accepted) {
+ if(dlg.exec() == TQDialog::Accepted) {
return dlg.borrower();
}
return 0;
diff --git a/src/borrowerdialog.h b/src/borrowerdialog.h
index 2ad2684..0b490b5 100644
--- a/src/borrowerdialog.h
+++ b/src/borrowerdialog.h
@@ -21,7 +21,7 @@ class KLineEdit;
#include <kdialogbase.h>
#include <klistview.h>
-#include <qdict.h>
+#include <tqdict.h>
namespace KABC {
class Addressee;
@@ -34,38 +34,39 @@ namespace Tellico {
*/
class BorrowerDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- static Data::BorrowerPtr getBorrower(QWidget* parent);
+ static Data::BorrowerPtr getBorrower(TQWidget* tqparent);
private slots:
- void selectItem(const QString& name);
- void updateEdit(QListViewItem* item);
+ void selectItem(const TQString& name);
+ void updateEdit(TQListViewItem* item);
void slotLoadAddressBook();
private:
/**
* The constructor sets up the dialog.
*
- * @param parent A pointer to the parent widget
+ * @param tqparent A pointer to the tqparent widget
* @param name The widget name
*/
- BorrowerDialog(QWidget* parent, const char* name=0);
+ BorrowerDialog(TQWidget* tqparent, const char* name=0);
Data::BorrowerPtr borrower();
- QString m_uid;
+ TQString m_uid;
KListView* m_listView;
KLineEdit* m_lineEdit;
- QDict<KListViewItem> m_itemDict;
+ TQDict<KListViewItem> m_itemDict;
class Item : public KListViewItem {
public:
- Item(KListView* parent, const KABC::Addressee& addressee);
- Item(KListView* parent, const Data::Borrower& borrower);
- const QString& uid() const { return m_uid; }
+ Item(KListView* tqparent, const KABC::Addressee& addressee);
+ Item(KListView* tqparent, const Data::Borrower& borrower);
+ const TQString& uid() const { return m_uid; }
private:
- QString m_uid;
+ TQString m_uid;
};
};
diff --git a/src/borroweritem.cpp b/src/borroweritem.cpp
index 0a9ee51..9b920e8 100644
--- a/src/borroweritem.cpp
+++ b/src/borroweritem.cpp
@@ -19,10 +19,10 @@
using Tellico::BorrowerItem;
-BorrowerItem::BorrowerItem(GUI::ListView* parent_, Data::BorrowerPtr borrower_)
- : GUI::CountedItem(parent_), m_borrower(borrower_) {
+BorrowerItem::BorrowerItem(GUI::ListView* tqparent_, Data::BorrowerPtr borrower_)
+ : GUI::CountedItem(tqparent_), m_borrower(borrower_) {
setText(0, borrower_->name());
- setPixmap(0, SmallIcon(QString::fromLatin1("kaddressbook")));
+ setPixmap(0, SmallIcon(TQString::tqfromLatin1("kaddressbook")));
}
int BorrowerItem::count() const {
@@ -32,7 +32,7 @@ int BorrowerItem::count() const {
Tellico::Data::EntryVec BorrowerItem::entries() const {
Data::EntryVec entries;
for(Data::LoanVec::ConstIterator loan = m_borrower->loans().begin(); loan != m_borrower->loans().end(); ++loan) {
- if(!entries.contains(loan->entry())) {
+ if(!entries.tqcontains(loan->entry())) {
entries.append(loan->entry());
}
}
diff --git a/src/borroweritem.h b/src/borroweritem.h
index ad0b7d6..9adca82 100644
--- a/src/borroweritem.h
+++ b/src/borroweritem.h
@@ -24,7 +24,7 @@ namespace Tellico {
*/
class BorrowerItem : public GUI::CountedItem {
public:
- BorrowerItem(GUI::ListView* parent, Data::BorrowerPtr filter);
+ BorrowerItem(GUI::ListView* tqparent, Data::BorrowerPtr filter);
virtual bool isBorrowerItem() const { return true; }
Data::BorrowerPtr borrower() { return m_borrower; }
diff --git a/src/calendarhandler.cpp b/src/calendarhandler.cpp
index c8953fd..b377485 100644
--- a/src/calendarhandler.cpp
+++ b/src/calendarhandler.cpp
@@ -156,14 +156,14 @@ bool CalendarHandler::checkCalendar(KCal::CalendarResources* resources) {
KCal::CalendarResourceManager* manager = resources->resourceManager();
if(manager->isEmpty()) {
kdWarning() << "Tellico::CalendarHandler::checkCalendar() - adding default calendar" << endl;
- KConfig config(QString::fromLatin1("korganizerrc"));
+ KConfig config(TQString::tqfromLatin1("korganizerrc"));
config.setGroup("General");
- QString fileName = config.readPathEntry("Active Calendar");
+ TQString fileName = config.readPathEntry("Active Calendar");
- QString resourceName;
+ TQString resourceName;
KCal::ResourceCalendar* defaultResource = 0;
if(fileName.isEmpty()) {
- fileName = locateLocal("appdata", QString::fromLatin1("std.ics"));
+ fileName = locateLocal("appdata", TQString::tqfromLatin1("std.ics"));
resourceName = i18n("Default Calendar");
defaultResource = new KCal::ResourceLocal(fileName);
} else {
@@ -199,10 +199,10 @@ void CalendarHandler::populateTodo(KCal::Todo* todo_, Data::LoanPtr loan_) {
todo_->setHasStartDate(true);
todo_->setDtDue(loan_->dueDate());
todo_->setHasDueDate(true);
- QString person = loan_->borrower()->name();
- QString summary = i18n("Tellico: %1 is due to return \"%2\"").arg(person).arg(loan_->entry()->title());
+ TQString person = loan_->borrower()->name();
+ TQString summary = i18n("Tellico: %1 is due to return \"%2\"").tqarg(person).tqarg(loan_->entry()->title());
todo_->setSummary(summary);
- QString note = loan_->note();
+ TQString note = loan_->note();
if(note.isEmpty()) {
note = summary;
}
@@ -212,7 +212,7 @@ void CalendarHandler::populateTodo(KCal::Todo* todo_, Data::LoanPtr loan_) {
todo_->clearAttendees();
// not adding email of borrower for now, but request RSVP?
KCal::Attendee* attendee = new KCal::Attendee(loan_->borrower()->name(),
- QString::null, false /*rsvp*/,
+ TQString(), false /*rsvp*/,
KCal::Attendee::NeedsAction,
KCal::Attendee::ReqParticipant,
loan_->borrower()->uid());
@@ -225,12 +225,12 @@ void CalendarHandler::populateTodo(KCal::Todo* todo_, Data::LoanPtr loan_) {
}
// taken from kpimprefs.cpp
-QString CalendarHandler::timezone() {
- QString zone;
+TQString CalendarHandler::timezone() {
+ TQString zone;
- KConfig korgcfg(locate(QString::fromLatin1("config"), QString::fromLatin1("korganizerrc")));
+ KConfig korgcfg(locate(TQString::tqfromLatin1("config"), TQString::tqfromLatin1("korganizerrc")));
korgcfg.setGroup("Time & Date");
- QString tz(korgcfg.readEntry("TimeZoneId"));
+ TQString tz(korgcfg.readEntry("TimeZoneId"));
if(!tz.isEmpty()) {
zone = tz;
} else {
@@ -238,8 +238,8 @@ QString CalendarHandler::timezone() {
int len = ::readlink("/etc/localtime", zonefilebuf, PATH_MAX);
if(len > 0 && len < PATH_MAX) {
- zone = QString::fromLocal8Bit(zonefilebuf, len);
- zone = zone.mid(zone.find(QString::fromLatin1("zoneinfo/")) + 9);
+ zone = TQString::fromLocal8Bit(zonefilebuf, len);
+ zone = zone.mid(zone.tqfind(TQString::tqfromLatin1("zoneinfo/")) + 9);
} else {
tzset();
zone = tzname[0];
diff --git a/src/calendarhandler.h b/src/calendarhandler.h
index 5e01b62..d2962d1 100644
--- a/src/calendarhandler.h
+++ b/src/calendarhandler.h
@@ -42,7 +42,7 @@ public:
static void removeLoans(Data::LoanVec loans);
private:
- static QString timezone();
+ static TQString timezone();
#ifdef USE_KCAL
// helper function
diff --git a/src/cite/clipboard.cpp b/src/cite/clipboard.cpp
index 9b98b89..f242a22 100644
--- a/src/cite/clipboard.cpp
+++ b/src/cite/clipboard.cpp
@@ -17,8 +17,8 @@
#include <klocale.h>
-#include <qapplication.h>
-#include <qclipboard.h>
+#include <tqapplication.h>
+#include <tqclipboard.h>
using Tellico::Cite::Clipboard;
@@ -35,17 +35,17 @@ bool Clipboard::cite(Data::EntryVec entries_) {
return false;
}
- QString s = QString::fromLatin1("\\cite{");
+ TQString s = TQString::tqfromLatin1("\\cite{");
for(Data::EntryVecIt it = entries_.begin(); it != entries_.end(); ++it) {
s += BibtexHandler::bibtexKey(it.data());
if(!it.nextEnd()) {
- s += QString::fromLatin1(", ");
+ s += TQString::tqfromLatin1(", ");
}
}
s += '}';
- QClipboard *cb = QApplication::clipboard();
- cb->setText(s, QClipboard::Clipboard);
+ TQClipboard *cb = TQApplication::tqclipboard();
+ cb->setText(s, TQClipboard::Clipboard);
return true;
}
diff --git a/src/cite/lyxpipe.cpp b/src/cite/lyxpipe.cpp
index 6075324..4943a8a 100644
--- a/src/cite/lyxpipe.cpp
+++ b/src/cite/lyxpipe.cpp
@@ -20,7 +20,7 @@
#include <klocale.h>
-#include <qfile.h>
+#include <tqfile.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -43,36 +43,36 @@ bool Lyxpipe::cite(Data::EntryVec entries_) {
return false;
}
- QString lyxpipe = Config::lyxpipe();
- lyxpipe += QString::fromLatin1(".in");
+ TQString lyxpipe = Config::lyxpipe();
+ lyxpipe += TQString::tqfromLatin1(".in");
// myDebug() << "Lyxpipe::cite() - " << lyxpipe << endl;
- QString errorStr = i18n("<qt>Tellico is unable to write to the server pipe at <b>%1</b>.</qt>").arg(lyxpipe);
+ TQString errorStr = i18n("<qt>Tellico is unable to write to the server pipe at <b>%1</b>.</qt>").tqarg(lyxpipe);
- QFile file(lyxpipe);
+ TQFile file(lyxpipe);
if(!file.exists()) {
Kernel::self()->sorry(errorStr);
return false;
}
- int pipeFd = ::open(QFile::encodeName(lyxpipe), O_WRONLY);
+ int pipeFd = ::open(TQFile::encodeName(lyxpipe), O_WRONLY);
if(!file.open(IO_WriteOnly, pipeFd)) {
Kernel::self()->sorry(errorStr);
::close(pipeFd);
return false;
}
- QString output;
- QTextStream ts(&file);
+ TQString output;
+ TQTextStream ts(&file);
for(Data::EntryVecIt it = entries_.begin(); it != entries_.end(); ++it) {
- QString s = BibtexHandler::bibtexKey(it.data());
+ TQString s = BibtexHandler::bibtexKey(it.data());
if(s.isEmpty()) {
continue;
}
output += s;
if(!it.nextEnd() && !output.isEmpty()) {
// pybliographer uses comma-space, and pyblink expects the space there
- output += QString::fromLatin1(", ");
+ output += TQString::tqfromLatin1(", ");
}
}
if(output.isEmpty()) {
diff --git a/src/cite/ooo/interface.cpp b/src/cite/ooo/interface.cpp
index 383ed1e..3e88852 100644
--- a/src/cite/ooo/interface.cpp
+++ b/src/cite/ooo/interface.cpp
@@ -33,7 +33,7 @@
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/sdbc/XRowUpdate.hpp>
-#include <com/sun/star/sdbc/SQLException.hpp>
+#include <com/sun/star/sdbc/STQLException.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/document/XEventBroadcaster.hpp>
@@ -122,7 +122,7 @@ bool OOOHandler::Interface::connect(const std::string& host_, int port_, const s
}
// Query for the XUnoUrlResolver interface
- Reference<bridge::XUnoUrlResolver> rResolver(rInstance, UNO_QUERY);
+ Reference<bridge::XUnoUrlResolver> rResolver(rInstance, UNO_TQUERY);
if(!rResolver.is()) {
DEBUG("Error: Couldn't instantiate com.sun.star.bridge.UnoUrlResolver service");
return false;
@@ -145,7 +145,7 @@ bool OOOHandler::Interface::connect(const std::string& host_, int port_, const s
return false;
}
- m_gsmgr = Reference<lang::XMultiServiceFactory>(rInstance, UNO_QUERY);
+ m_gsmgr = Reference<lang::XMultiServiceFactory>(rInstance, UNO_TQUERY);
if(m_gsmgr.is()) {
DEBUG("Connected successfully to office");
} else {
@@ -180,16 +180,16 @@ bool OOOHandler::Interface::createDocument() {
// get the desktop service using createInstance, returns an XInterface type
Reference<uno::XInterface> xInstance = m_gsmgr->createInstance(OUString::createFromAscii("com.sun.star.frame.Desktop"));
- Reference<frame::XDesktop> desktop(xInstance, UNO_QUERY);
+ Reference<frame::XDesktop> desktop(xInstance, UNO_TQUERY);
Reference<lang::XComponent> writer = desktop->getCurrentComponent();
- Reference<lang::XServiceInfo> info(writer, UNO_QUERY);
+ Reference<lang::XServiceInfo> info(writer, UNO_TQUERY);
if(info.is() && info->getImplementationName() == OUString::createFromAscii("SwXTextDocument")) {
DEBUG("Document already open");
} else {
DEBUG("Opening a new document");
//query for the XComponentLoader interface
- Reference<frame::XComponentLoader> rComponentLoader(desktop, UNO_QUERY);
+ Reference<frame::XComponentLoader> rComponentLoader(desktop, UNO_TQUERY);
if(!rComponentLoader.is()){
DEBUG("XComponentloader failed to instantiate");
return 0;
@@ -203,16 +203,16 @@ bool OOOHandler::Interface::createDocument() {
}
//Manage many events with EventListener
- Reference<document::XEventBroadcaster> eventBroadcast(writer, UNO_QUERY);
+ Reference<document::XEventBroadcaster> eventBroadcast(writer, UNO_TQUERY);
m_listener = new EventListener(this);
Reference<document::XEventListener> xEventListener = static_cast<document::XEventListener*>(m_listener);
eventBroadcast->addEventListener(xEventListener);
- Reference<frame::XController> controller = Reference<frame::XModel>(writer, UNO_QUERY)->getCurrentController();
- m_cursor = Reference<text::XTextViewCursorSupplier>(controller, UNO_QUERY)->getViewCursor();
- m_doc = Reference<text::XTextDocument>(writer, UNO_QUERY);
+ Reference<frame::XController> controller = Reference<frame::XModel>(writer, UNO_TQUERY)->getCurrentController();
+ m_cursor = Reference<text::XTextViewCursorSupplier>(controller, UNO_TQUERY)->getViewCursor();
+ m_doc = Reference<text::XTextDocument>(writer, UNO_TQUERY);
if(m_doc.is()) {
- m_dsmgr = Reference<lang::XMultiServiceFactory>(m_doc, UNO_QUERY);
+ m_dsmgr = Reference<lang::XMultiServiceFactory>(m_doc, UNO_TQUERY);
}
return m_doc.is();
}
@@ -231,12 +231,12 @@ bool OOOHandler::Interface::updateBibliography() {
}
void OOOHandler::Interface::createBibliography() {
- Reference<container::XIndexAccess> indexes(Reference<text::XDocumentIndexesSupplier>(m_doc, UNO_QUERY)->getDocumentIndexes(), UNO_QUERY);
+ Reference<container::XIndexAccess> indexes(Reference<text::XDocumentIndexesSupplier>(m_doc, UNO_TQUERY)->getDocumentIndexes(), UNO_TQUERY);
for(int i = 0; i < indexes->getCount(); ++i) {
- Reference<lang::XServiceInfo> info(indexes->getByIndex(i), UNO_QUERY);
+ Reference<lang::XServiceInfo> info(indexes->getByIndex(i), UNO_TQUERY);
if(info->supportsService(OUSTR("com.sun.star.text.Bibliography"))) {
DEBUG("Found existing bibliography...");
- m_bib = Reference<text::XDocumentIndex>(indexes->getByIndex(i), UNO_QUERY);
+ m_bib = Reference<text::XDocumentIndex>(indexes->getByIndex(i), UNO_TQUERY);
break;
}
}
@@ -244,18 +244,18 @@ void OOOHandler::Interface::createBibliography() {
if(!m_bib.is()) {
DEBUG("Creating new bibliography...");
Reference<text::XText> text = m_doc->getText();
- Reference<text::XTextRange> textRange(text->createTextCursor(), UNO_QUERY);
- Reference<text::XTextCursor> cursor(textRange, UNO_QUERY);
+ Reference<text::XTextRange> textRange(text->createTextCursor(), UNO_TQUERY);
+ Reference<text::XTextCursor> cursor(textRange, UNO_TQUERY);
cursor->gotoEnd(false);
text->insertControlCharacter(textRange, text::ControlCharacter::PARAGRAPH_BREAK, false);
- m_bib = Reference<text::XDocumentIndex>(m_dsmgr->createInstance(OUSTR("com.sun.star.text.Bibliography")), UNO_QUERY);
- Reference<text::XTextContent> textContent(m_bib, UNO_QUERY);
+ m_bib = Reference<text::XDocumentIndex>(m_dsmgr->createInstance(OUSTR("com.sun.star.text.Bibliography")), UNO_TQUERY);
+ Reference<text::XTextContent> textContent(m_bib, UNO_TQUERY);
text->insertTextContent(textRange, textContent, false);
}
}
bool OOOHandler::Interface::insertCitations(Cite::Map& fields) {
- Reference<text::XTextField> entry(m_dsmgr->createInstance(OUString::createFromAscii("com.sun.star.text.TextField.Bibliography")), UNO_QUERY);
+ Reference<text::XTextField> entry(m_dsmgr->createInstance(OUString::createFromAscii("com.sun.star.text.TextField.Bibliography")), UNO_TQUERY);
if(!entry.is()) {
DEBUG("Interface::insertCitation - can't create TextField");
return false;
@@ -266,12 +266,12 @@ bool OOOHandler::Interface::insertCitations(Cite::Map& fields) {
values[i] = propValue(it->first, it->second);
std::cout << "Setting " << OU2O(values[i].Name) << " = " << it->second << std::endl;
}
- Reference<beans::XPropertySet>(entry, UNO_QUERY)->setPropertyValue(OUSTR("Fields"), Any(values));
+ Reference<beans::XPropertySet>(entry, UNO_TQUERY)->setPropertyValue(OUSTR("Fields"), Any(values));
Reference<text::XText> text = m_doc->getText();
- Reference<text::XTextCursor> cursor = text->createTextCursorByRange(Reference<text::XTextRange>(m_cursor, UNO_QUERY));
- Reference<text::XTextRange> textRange(cursor, UNO_QUERY);
- Reference<text::XTextContent> textContent(entry, UNO_QUERY);
+ Reference<text::XTextCursor> cursor = text->createTextCursorByRange(Reference<text::XTextRange>(m_cursor, UNO_TQUERY));
+ Reference<text::XTextRange> textRange(cursor, UNO_TQUERY);
+ Reference<text::XTextContent> textContent(entry, UNO_TQUERY);
text->insertTextContent(textRange, textContent, false);
return true;
}
@@ -336,13 +336,13 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false;
}
- Reference<sdbc::XRowSet> rowSet(interface, UNO_QUERY);
+ Reference<sdbc::XRowSet> rowSet(interface, UNO_TQUERY);
if(!rowSet.is()) {
DEBUG("Could not create rowset interface");
return false;
}
- Reference<beans::XPropertySet> props(rowSet, UNO_QUERY);
+ Reference<beans::XPropertySet> props(rowSet, UNO_TQUERY);
props->setPropertyValue(OUSTR("DataSourceName"), Any(OUSTR("Bibliography")));
props->setPropertyValue(OUSTR("CommandType"), Any(sdb::CommandType::COMMAND));
OUString s = OUSTR("SELECT COUNT(*) FROM \"biblio\" WHERE identifier='") + O2OU(fields["Identifier"]) + OUSTR("'");
@@ -350,9 +350,9 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
try {
rowSet->execute();
- } catch(sdbc::SQLException& e) {
+ } catch(sdbc::STQLException& e) {
DEBUG(OU2O(s));
- DEBUG(OUSTR("SQL error - ") + e.SQLState);
+ DEBUG(OUSTR("SQL error - ") + e.STQLState);
return false;
} catch(Exception& e) {
DEBUG(OU2O(s));
@@ -360,7 +360,7 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false;
}
- Reference<sdbc::XRow> row(rowSet, UNO_QUERY);
+ Reference<sdbc::XRow> row(rowSet, UNO_TQUERY);
int count = 0;
if(rowSet->next()) {
count = row->getString(1).toInt32();
@@ -380,9 +380,9 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
try {
rowSet->execute();
- } catch(sdbc::SQLException& e) {
+ } catch(sdbc::STQLException& e) {
DEBUG(OU2O(s));
- DEBUG(OUSTR("SQL error(2) - ") + e.SQLState);
+ DEBUG(OUSTR("SQL error(2) - ") + e.STQLState);
return false;
} catch(Exception& e) {
DEBUG(OU2O(s));
@@ -390,12 +390,12 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false;
}
- Reference<sdbc::XResultSet> resultSet(rowSet, UNO_QUERY);
- Reference<sdbc::XResultSetMetaDataSupplier> mdSupplier(resultSet, UNO_QUERY);
+ Reference<sdbc::XResultSet> resultSet(rowSet, UNO_TQUERY);
+ Reference<sdbc::XResultSetMetaDataSupplier> mdSupplier(resultSet, UNO_TQUERY);
Reference<sdbc::XResultSetMetaData> metaData = mdSupplier->getMetaData();
- Reference<sdbc::XRowUpdate> rowUpdate(rowSet, UNO_QUERY);
- Reference<sdbc::XResultSetUpdate> update(rowSet, UNO_QUERY);
+ Reference<sdbc::XRowUpdate> rowUpdate(rowSet, UNO_TQUERY);
+ Reference<sdbc::XResultSetUpdate> update(rowSet, UNO_TQUERY);
if(count > 0) {
resultSet->last();
} else {
@@ -412,8 +412,8 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
std::cout << s << " = " << value << std::endl;
try {
rowUpdate->updateString(i, O2OU(value));
- } catch(sdbc::SQLException& e) {
- DEBUG(OUSTR("SQL error(3) - ") + e.SQLState);
+ } catch(sdbc::STQLException& e) {
+ DEBUG(OUSTR("SQL error(3) - ") + e.STQLState);
} catch(Exception& e) {
DEBUG(OUSTR("General error(3) - ") + e.Message);
}
@@ -425,6 +425,6 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
update->insertRow();
}
- Reference<lang::XComponent>(rowSet, UNO_QUERY)->dispose();
+ Reference<lang::XComponent>(rowSet, UNO_TQUERY)->dispose();
return true;
}
diff --git a/src/cite/ooo/ooohandler.cpp b/src/cite/ooo/ooohandler.cpp
index 1741896..d36b3e4 100644
--- a/src/cite/ooo/ooohandler.cpp
+++ b/src/cite/ooo/ooohandler.cpp
@@ -26,13 +26,13 @@ using Tellico::Cite::OOOHandler;
Tellico::Cite::Map OOOHandler::s_fieldsMap;
/*
-QString OOOHandler::OUString2Q(const rtl::OUString& str) {
+TQString OOOHandler::OUString2Q(const rtl::OUString& str) {
const uint len = str.getLength();
- QChar* uni = new QChar[len + 1];
+ TQChar* uni = new TQChar[len + 1];
const sal_Unicode* ouPtr = str.getStr();
const sal_Unicode* ouEnd = ouPtr + len;
- QChar* qPtr = uni;
+ TQChar* qPtr = uni;
while (ouPtr != ouEnd) {
*(qPtr++) = *(ouPtr++);
@@ -40,22 +40,22 @@ QString OOOHandler::OUString2Q(const rtl::OUString& str) {
*qPtr = 0;
- QString ret(uni, len);
+ TQString ret(uni, len);
delete[] uni;
return ret;
}
-rtl::OUString OOOHandler::QString2OU(const QString& str) {
+rtl::OUString OOOHandler::TQString2OU(const TQString& str) {
const uint len = str.length();
sal_Unicode* uni = new sal_Unicode[len + 1];
- const QChar* qPtr = str.unicode();
- const QChar* qEnd = qPtr + len;
+ const TQChar* qPtr = str.tqunicode();
+ const TQChar* qEnd = qPtr + len;
sal_Unicode* uPtr = uni;
while (qPtr != qEnd) {
- *(uPtr++) = (*(qPtr++)).unicode();
+ *(uPtr++) = (*(qPtr++)).tqunicode();
}
*uPtr = 0;
diff --git a/src/cite/ooo/ooohandler.h b/src/cite/ooo/ooohandler.h
index fd7f308..695794d 100644
--- a/src/cite/ooo/ooohandler.h
+++ b/src/cite/ooo/ooohandler.h
@@ -35,8 +35,8 @@ public:
virtual bool cite(Cite::Map& fields);
private:
-// static QString OUString2Q(const rtl::OUString& str);
-// static rtl::OUString QString2OU(const QString& str);
+// static TQString OUString2Q(const rtl::OUString& str);
+// static rtl::OUString TQString2OU(const TQString& str);
static Cite::Map s_fieldsMap;
static void buildFieldsMap();
diff --git a/src/cite/openoffice.cpp b/src/cite/openoffice.cpp
index ced8b13..3955677 100644
--- a/src/cite/openoffice.cpp
+++ b/src/cite/openoffice.cpp
@@ -30,12 +30,12 @@
#include <kiconloader.h>
#include <klocale.h>
-#include <qiconset.h>
-#include <qlayout.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qfile.h>
-#include <qvgroupbox.h>
+#include <tqiconset.h>
+#include <tqlayout.h>
+#include <tqradiobutton.h>
+#include <tqbuttongroup.h>
+#include <tqfile.h>
+#include <tqvgroupbox.h>
using Tellico::Cite::OpenOffice;
@@ -43,7 +43,7 @@ class OpenOffice::Private {
friend class OpenOffice;
Private() : handler(0), port(-1) {
- KLibrary* library = Tellico::openLibrary(QString::fromLatin1("tellico_ooo"));
+ KLibrary* library = Tellico::openLibrary(TQString::tqfromLatin1("tellico_ooo"));
if(library) {
void* func = library->symbol("handler");
if(func) {
@@ -54,9 +54,9 @@ class OpenOffice::Private {
Handler* handler;
// empty pipe string indicates tcp should be used
- QString host;
+ TQString host;
int port;
- QString pipe;
+ TQString pipe;
};
OpenOffice::OpenOffice() : Action(), d(new Private()) {
@@ -79,18 +79,18 @@ bool OpenOffice::connect() {
return false;
}
- StatusBar::self()->setStatus(i18n("Connecting to OpenOffice.org..."));
+ StatusBar::self()->settqStatus(i18n("Connecting to OpenOffice.org..."));
if(d->port == -1) {
KConfigGroup config(kapp->config(), "OpenOffice.org");
- d->host = config.readEntry("Host", QString::fromLatin1("localhost"));
+ d->host = config.readEntry("Host", TQString::tqfromLatin1("localhost"));
d->port = config.readNumEntry("Port", 2083);
d->pipe = config.readPathEntry("Pipe");
// the ooohandler will depend on pipe.isEmpty() to indicate the port should be used
d->handler->setHost(d->host);
d->handler->setPort(d->port);
if(!d->pipe.isEmpty()) {
- d->handler->setPipe(QFile::encodeName(d->pipe));
+ d->handler->setPipe(TQFile::encodeName(d->pipe));
}
}
@@ -116,7 +116,7 @@ bool OpenOffice::connect() {
break;
}
}
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
return success;
}
@@ -136,22 +136,22 @@ bool OpenOffice::cite(Data::EntryVec entries_) {
return false;
}
- const QString bibtex = QString::fromLatin1("bibtex");
+ const TQString bibtex = TQString::tqfromLatin1("bibtex");
Data::FieldVec vec = coll->fields();
for(Data::EntryVecIt entry = entries_.begin(); entry != entries_.end(); ++entry) {
Cite::Map values;
for(Data::FieldVec::Iterator it = vec.begin(); it != vec.end(); ++it) {
- QString bibtexField = it->property(bibtex);
+ TQString bibtexField = it->property(bibtex);
if(!bibtexField.isEmpty()) {
- QString s = entry->field(it->name());
+ TQString s = entry->field(it->name());
if(!s.isEmpty()) {
- values[bibtexField] = s.utf8(); // always utf8
+ values[bibtexField.ascii()] = s.utf8().data(); // always utf8
}
} else if(it->name() == Latin1Literal("isbn")) {
// OOO includes ISBN
- QString s = entry->field(it->name());
+ TQString s = entry->field(it->name());
if(!s.isEmpty()) {
- values[it->name()] = s.utf8();
+ values[it->name().ascii()] = s.utf8().data();
}
}
}
@@ -165,34 +165,34 @@ bool OpenOffice::connectionDialog() {
true, i18n("OpenOffice.org Connection"),
KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Help);
- dlg.setHelp(QString::fromLatin1("openoffice-org"));
+ dlg.setHelp(TQString::tqfromLatin1("openoffice-org"));
- QWidget* widget = new QWidget(&dlg);
- QBoxLayout* topLayout = new QVBoxLayout(widget, KDialog::spacingHint());
+ TQWidget* widget = new TQWidget(&dlg);
+ TQBoxLayout* topLayout = new TQVBoxLayout(widget, KDialog::spacingHint());
dlg.setMainWidget(widget);
// is there a better way to do a multi-line label than to insert newlines in the text?
- QBoxLayout* blay = new QHBoxLayout(topLayout);
- QLabel* l = new QLabel(widget);
- l->setPixmap(DesktopIcon(QString::fromLatin1("ooo_writer"), 64));
+ TQBoxLayout* blay = new TQHBoxLayout(topLayout);
+ TQLabel* l = new TQLabel(widget);
+ l->setPixmap(DesktopIcon(TQString::tqfromLatin1("ooo_writer"), 64));
blay->addWidget(l);
- l = new QLabel(widget);
+ l = new TQLabel(widget);
l->setText(i18n("Tellico was unable to connect to OpenOffice.org. "
"Please verify the connection settings below, and "
"that OpenOffice.org Writer is currently running."));
- l->setTextFormat(Qt::RichText);
+ l->setTextFormat(TQt::RichText);
blay->addWidget(l);
blay->setStretchFactor(l, 10);
- QVGroupBox* gbox = new QVGroupBox(i18n("OpenOffice.org Connection"), widget);
+ TQVGroupBox* gbox = new TQVGroupBox(i18n("OpenOffice.org Connection"), widget);
topLayout->addWidget(gbox);
- QWidget* w2 = new QWidget(gbox);
- QGridLayout* gl = new QGridLayout(w2, 2, 3, 0 /*margin*/, KDialog::spacingHint());
- QRadioButton* radioPipe = new QRadioButton(i18n("Pipe"), w2);
+ TQWidget* w2 = new TQWidget(gbox);
+ TQGridLayout* gl = new TQGridLayout(w2, 2, 3, 0 /*margin*/, KDialog::spacingHint());
+ TQRadioButton* radioPipe = new TQRadioButton(i18n("Pipe"), w2);
gl->addWidget(radioPipe, 0, 0);
- QRadioButton* radioTCP = new QRadioButton(i18n("TCP/IP"), w2);
+ TQRadioButton* radioTCP = new TQRadioButton(i18n("TCP/IP"), w2);
gl->addWidget(radioTCP, 1, 0);
- QButtonGroup* btnGroup = new QButtonGroup();
+ TQButtonGroup* btnGroup = new TQButtonGroup();
btnGroup->setRadioButtonExclusive(true);
btnGroup->insert(radioPipe, 0);
btnGroup->insert(radioTCP, 1);
@@ -200,17 +200,17 @@ bool OpenOffice::connectionDialog() {
KLineEdit* pipeEdit = new KLineEdit(w2);
pipeEdit->setText(d->pipe);
gl->addMultiCellWidget(pipeEdit, 0, 0, 1, 2);
- pipeEdit->connect(radioPipe, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ pipeEdit->connect(radioPipe, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setEnabled(bool)));
KLineEdit* hostEdit = new KLineEdit(w2);
hostEdit->setText(d->host);
gl->addWidget(hostEdit, 1, 1);
- hostEdit->connect(radioTCP, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ hostEdit->connect(radioTCP, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setEnabled(bool)));
KIntSpinBox* portSpin = new KIntSpinBox(w2);
portSpin->setMaxValue(99999);
portSpin->setValue(d->port);
gl->addWidget(portSpin, 1, 2);
- portSpin->connect(radioTCP, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ portSpin->connect(radioTCP, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setEnabled(bool)));
if(d->pipe.isEmpty()) {
radioTCP->setChecked(true);
@@ -225,17 +225,17 @@ bool OpenOffice::connectionDialog() {
}
topLayout->addStretch(10);
- if(dlg.exec() != QDialog::Accepted) {
+ if(dlg.exec() != TQDialog::Accepted) {
return false;
}
int p = d->port;
- QString h = d->host;
- QString s;
+ TQString h = d->host;
+ TQString s;
if(radioTCP->isChecked()) {
h = hostEdit->text();
if(h.isEmpty()) {
- h = QString::fromLatin1("localhost");
+ h = TQString::tqfromLatin1("localhost");
}
p = portSpin->value();
} else {
@@ -250,7 +250,7 @@ bool OpenOffice::connectionDialog() {
}
d->handler->setPort(d->port);
if(!d->pipe.isEmpty()) {
- d->handler->setPipe(QFile::encodeName(d->pipe));
+ d->handler->setPipe(TQFile::encodeName(d->pipe));
}
KConfigGroup config(kapp->config(), "OpenOffice.org");
@@ -261,7 +261,7 @@ bool OpenOffice::connectionDialog() {
}
bool OpenOffice::hasLibrary() {
- QString path = KLibLoader::findLibrary("tellico_ooo");
+ TQString path = KLibLoader::findLibrary("tellico_ooo");
if(!path.isEmpty()) myDebug() << "OpenOffice::hasLibrary() - Found OOo plugin: " << path << endl;
return !path.isEmpty();
}
diff --git a/src/collection.cpp b/src/collection.cpp
index c6f77ca..0e4b06b 100644
--- a/src/collection.cpp
+++ b/src/collection.cpp
@@ -24,16 +24,16 @@
#include <klocale.h>
-#include <qregexp.h>
-#include <qvaluestack.h>
+#include <tqregexp.h>
+#include <tqvaluestack.h>
using Tellico::Data::Collection;
const char* Collection::s_emptyGroupTitle = I18N_NOOP("(Empty)");
-const QString Collection::s_peopleGroupName = QString::fromLatin1("_people");
+const TQString Collection::s_peopleGroupName = TQString::tqfromLatin1("_people");
-Collection::Collection(const QString& title_)
- : QObject(), KShared(), m_nextEntryId(0), m_title(title_), m_entryIdDict(997)
+Collection::Collection(const TQString& title_)
+ : TQObject(), KShared(), m_nextEntryId(0), m_title(title_), m_entryIdDict(997)
, m_trackGroups(false) {
m_entryGroupDicts.setAutoDelete(true);
@@ -43,7 +43,7 @@ Collection::Collection(const QString& title_)
Collection::~Collection() {
}
-QString Collection::typeName() const {
+TQString Collection::typeName() const {
return CollectionFactory::typeName(type());
}
@@ -68,7 +68,7 @@ bool Collection::addField(FieldPtr field_) {
// it's not sufficient to merely check the new field
if(dependentFieldHasRecursion(field_)) {
- field_->setDescription(QString());
+ field_->setDescription(TQString());
}
m_fields.append(field_);
@@ -76,7 +76,7 @@ bool Collection::addField(FieldPtr field_) {
m_peopleFields.append(field_); // list of people attributes
if(m_peopleFields.count() > 1) {
// the second time that a person field is added, add a "pseudo-group" for people
- if(m_entryGroupDicts.find(s_peopleGroupName) == 0) {
+ if(m_entryGroupDicts.tqfind(s_peopleGroupName) == 0) {
EntryGroupDict* d = new EntryGroupDict();
d->setAutoDelete(true);
m_entryGroupDicts.insert(s_peopleGroupName, d);
@@ -92,12 +92,12 @@ bool Collection::addField(FieldPtr field_) {
m_imageFields.append(field_);
}
- if(!field_->category().isEmpty() && m_fieldCategories.findIndex(field_->category()) == -1) {
+ if(!field_->category().isEmpty() && m_fieldCategories.tqfindIndex(field_->category()) == -1) {
m_fieldCategories << field_->category();
}
if(field_->flags() & Field::AllowGrouped) {
- // m_entryGroupsDicts autoDeletes each QDict when the Collection d'tor is called
+ // m_entryGroupsDicts autoDeletes each TQDict when the Collection d'tor is called
EntryGroupDict* dict = new EntryGroupDict();
dict->setAutoDelete(true);
m_entryGroupDicts.insert(field_->name(), dict);
@@ -135,7 +135,7 @@ bool Collection::mergeField(FieldPtr newField_) {
if(newField_->type() == Field::Table2) {
newField_->setType(Data::Field::Table);
- newField_->setProperty(QString::fromLatin1("columns"), QChar('2'));
+ newField_->setProperty(TQString::tqfromLatin1("columns"), TQChar('2'));
}
// the original field type is kept
@@ -146,10 +146,10 @@ bool Collection::mergeField(FieldPtr newField_) {
// if field is a Choice, then make sure all values are there
if(currField->type() == Field::Choice && currField->allowed() != newField_->allowed()) {
- QStringList allowed = currField->allowed();
- const QStringList& newAllowed = newField_->allowed();
- for(QStringList::ConstIterator it = newAllowed.begin(); it != newAllowed.end(); ++it) {
- if(allowed.findIndex(*it) == -1) {
+ TQStringList allowed = currField->allowed();
+ const TQStringList& newAllowed = newField_->allowed();
+ for(TQStringList::ConstIterator it = newAllowed.begin(); it != newAllowed.end(); ++it) {
+ if(allowed.tqfindIndex(*it) == -1) {
allowed.append(*it);
}
}
@@ -162,14 +162,14 @@ bool Collection::mergeField(FieldPtr newField_) {
if(currField->description().isEmpty()) {
currField->setDescription(newField_->description());
if(dependentFieldHasRecursion(currField)) {
- currField->setDescription(QString());
+ currField->setDescription(TQString());
}
}
// if new field has additional extended properties, add those
for(StringMap::ConstIterator it = newField_->propertyList().begin(); it != newField_->propertyList().end(); ++it) {
- const QString propName = it.key();
- const QString currValue = currField->property(propName);
+ const TQString propName = it.key();
+ const TQString currValue = currField->property(propName);
if(currValue.isEmpty()) {
currField->setProperty(propName, it.data());
} else if (it.data() != currValue) {
@@ -181,14 +181,14 @@ bool Collection::mergeField(FieldPtr newField_) {
uint currNum = Tellico::toUInt(currValue, &ok);
uint newNum = Tellico::toUInt(it.data(), &ok);
if(newNum > currNum) { // bigger values
- currField->setProperty(propName, QString::number(newNum));
+ currField->setProperty(propName, TQString::number(newNum));
}
} else if(currField->type() == Field::Rating && propName == Latin1Literal("minimum")) {
bool ok;
uint currNum = Tellico::toUInt(currValue, &ok);
uint newNum = Tellico::toUInt(it.data(), &ok);
if(newNum < currNum) { // smaller values
- currField->setProperty(propName, QString::number(newNum));
+ currField->setProperty(propName, TQString::number(newNum));
}
}
}
@@ -208,7 +208,7 @@ bool Collection::modifyField(FieldPtr newField_) {
// myDebug() << "Collection::modifyField() - " << newField_->name() << endl;
// the field name never changes
- const QString fieldName = newField_->name();
+ const TQString fieldName = newField_->name();
FieldPtr oldField = fieldByName(fieldName);
if(!oldField) {
myDebug() << "Collection::modifyField() - no field named " << fieldName << endl;
@@ -216,13 +216,13 @@ bool Collection::modifyField(FieldPtr newField_) {
}
// update name dict
- m_fieldNameDict.replace(fieldName, newField_);
+ m_fieldNameDict.tqreplace(fieldName, newField_);
// update titles
- const QString oldTitle = oldField->title();
- const QString newTitle = newField_->title();
+ const TQString oldTitle = oldField->title();
+ const TQString newTitle = newField_->title();
if(oldTitle == newTitle) {
- m_fieldTitleDict.replace(newTitle, newField_);
+ m_fieldTitleDict.tqreplace(newTitle, newField_);
} else {
m_fieldTitleDict.remove(oldTitle);
m_fieldTitles.remove(oldTitle);
@@ -231,7 +231,7 @@ bool Collection::modifyField(FieldPtr newField_) {
}
// now replace the field pointer in the list
- FieldVec::Iterator it = m_fields.find(oldField);
+ FieldVec::Iterator it = m_fields.tqfind(oldField);
if(it != m_fields.end()) {
m_fields.insert(it, newField_);
m_fields.remove(oldField);
@@ -245,24 +245,24 @@ bool Collection::modifyField(FieldPtr newField_) {
m_fieldCategories.clear();
for(FieldVec::Iterator it = m_fields.begin(); it != m_fields.end(); ++it) {
// add category if it's not in the list yet
- if(!it->category().isEmpty() && !m_fieldCategories.contains(it->category())) {
+ if(!it->category().isEmpty() && !m_fieldCategories.tqcontains(it->category())) {
m_fieldCategories += it->category();
}
}
}
if(dependentFieldHasRecursion(newField_)) {
- newField_->setDescription(QString());
+ newField_->setDescription(TQString());
}
// keep track of if the entry groups will need to be reset
bool resetGroups = false;
- // if format is different, go ahead and invalidate all formatted entry values
+ // if format is different, go ahead and tqinvalidate all formatted entry values
if(oldField->formatFlag() != newField_->formatFlag()) {
- // invalidate cached format strings of all entry attributes of this name
+ // tqinvalidate cached format strings of all entry attributes of this name
for(EntryVecIt it = m_entries.begin(); it != m_entries.end(); ++it) {
- it->invalidateFormattedFieldValue(fieldName);
+ it->tqinvalidateFormattedFieldValue(fieldName);
}
resetGroups = true;
}
@@ -279,7 +279,7 @@ bool Collection::modifyField(FieldPtr newField_) {
}
if(isPeople) {
// if there's more than one people field and no people dict exists yet, add it
- if(m_peopleFields.count() > 1 && m_entryGroupDicts.find(s_peopleGroupName) == 0) {
+ if(m_peopleFields.count() > 1 && m_entryGroupDicts.tqfind(s_peopleGroupName) == 0) {
EntryGroupDict* d = new EntryGroupDict();
d->setAutoDelete(true);
m_entryGroupDicts.insert(s_peopleGroupName, d);
@@ -303,7 +303,7 @@ bool Collection::modifyField(FieldPtr newField_) {
resetGroups = true;
} else {
// don't do this, it wipes out the old groups!
-// m_entryGroupDicts.replace(fieldName, new EntryGroupDict());
+// m_entryGroupDicts.tqreplace(fieldName, new EntryGroupDict());
}
} else if(isGrouped) {
EntryGroupDict* d = new EntryGroupDict();
@@ -325,7 +325,7 @@ bool Collection::modifyField(FieldPtr newField_) {
if(resetGroups) {
myLog() << "Collection::modifyField() - invalidating groups" << endl;
- invalidateGroups();
+ tqinvalidateGroups();
}
// now to update all entries if the field is a dependent and the description changed
@@ -336,13 +336,13 @@ bool Collection::modifyField(FieldPtr newField_) {
return true;
}
-bool Collection::removeField(const QString& name_, bool force_) {
+bool Collection::removeField(const TQString& name_, bool force_) {
return removeField(fieldByName(name_), force_);
}
// force allows me to force the deleting of the title field if I need to
bool Collection::removeField(FieldPtr field_, bool force_/*=false*/) {
- if(!field_ || !m_fields.contains(field_)) {
+ if(!field_ || !m_fields.tqcontains(field_)) {
if(field_) {
myDebug() << "Collection::removeField - false: " << field_->name() << endl;
}
@@ -374,7 +374,7 @@ bool Collection::removeField(FieldPtr field_, bool force_/*=false*/) {
for(EntryVecIt it = m_entries.begin(); it != m_entries.end(); ++it) {
// setting the fields to an empty string removes the value from the entry's list
- it->setField(field_, QString::null);
+ it->setField(field_, TQString());
}
if(field_->flags() & Field::AllowGrouped) {
@@ -406,7 +406,7 @@ void Collection::reorderFields(const FieldVec& list_) {
// also reset category list, since the order may have changed
m_fieldCategories.clear();
for(FieldVec::Iterator it = m_fields.begin(); it != m_fields.end(); ++it) {
- if(!it->category().isEmpty() && !m_fieldCategories.contains(it->category())) {
+ if(!it->category().isEmpty() && !m_fieldCategories.tqcontains(it->category())) {
m_fieldCategories << it->category();
}
}
@@ -432,7 +432,7 @@ void Collection::addEntries(EntryVec entries_) {
} else if(entry->id() == -1) {
entry->setId(m_nextEntryId);
++m_nextEntryId;
- } else if(m_entryIdDict.find(entry->id())) {
+ } else if(m_entryIdDict.tqfind(entry->id())) {
if(!foster) {
myDebug() << "Collection::addEntries() - the collection already has an entry with id = " << entry->id() << endl;
}
@@ -452,10 +452,10 @@ void Collection::removeEntriesFromDicts(EntryVec entries_) {
// need a copy of the vector since it gets changed
PtrVector<EntryGroup> groups = entry->groups();
for(PtrVector<EntryGroup>::Iterator group = groups.begin(); group != groups.end(); ++group) {
- if(entry->removeFromGroup(group.ptr()) && !modifiedGroups.contains(group.ptr())) {
+ if(entry->removeFromGroup(group.ptr()) && !modifiedGroups.tqcontains(group.ptr())) {
modifiedGroups.push_back(group.ptr());
}
- if(group->isEmpty() && !m_groupsToDelete.contains(group.ptr())) {
+ if(group->isEmpty() && !m_groupsToDelete.tqcontains(group.ptr())) {
m_groupsToDelete.push_back(group.ptr());
}
}
@@ -492,9 +492,9 @@ bool Collection::removeEntries(EntryVec vec_) {
return success;
}
-Tellico::Data::FieldVec Collection::fieldsByCategory(const QString& cat_) {
+Tellico::Data::FieldVec Collection::fieldsByCategory(const TQString& cat_) {
#ifndef NDEBUG
- if(m_fieldCategories.findIndex(cat_) == -1) {
+ if(m_fieldCategories.tqfindIndex(cat_) == -1) {
myDebug() << "Collection::fieldsByCategory() - '" << cat_ << "' is not in category list" << endl;
}
#endif
@@ -512,32 +512,32 @@ Tellico::Data::FieldVec Collection::fieldsByCategory(const QString& cat_) {
return list;
}
-const QString& Collection::fieldNameByTitle(const QString& title_) const {
+const TQString& Collection::fieldNameByTitle(const TQString& title_) const {
if(title_.isEmpty()) {
- return QString::null;
+ return TQString();
}
FieldPtr f = fieldByTitle(title_);
if(!f) { // might happen in MainWindow::saveCollectionOptions
- return QString::null;
+ return TQString();
}
return f->name();
}
-const QString& Collection::fieldTitleByName(const QString& name_) const {
+const TQString& Collection::fieldTitleByName(const TQString& name_) const {
if(name_.isEmpty()) {
- return QString::null;
+ return TQString();
}
FieldPtr f = fieldByName(name_);
if(!f) {
kdWarning() << "Collection::fieldTitleByName() - no field named " << name_ << endl;
- return QString::null;
+ return TQString();
}
return f->title();
}
-QStringList Collection::valuesByFieldName(const QString& name_) const {
+TQStringList Collection::valuesByFieldName(const TQString& name_) const {
if(name_.isEmpty()) {
- return QStringList();
+ return TQStringList();
}
bool multiple = (fieldByName(name_)->flags() & Field::AllowMultiple);
@@ -553,19 +553,19 @@ QStringList Collection::valuesByFieldName(const QString& name_) const {
return values.toList();
}
-Tellico::Data::FieldPtr Collection::fieldByName(const QString& name_) const {
- return m_fieldNameDict.isEmpty() ? 0 : name_.isEmpty() ? 0 : m_fieldNameDict.find(name_);
+Tellico::Data::FieldPtr Collection::fieldByName(const TQString& name_) const {
+ return m_fieldNameDict.isEmpty() ? 0 : name_.isEmpty() ? 0 : m_fieldNameDict.tqfind(name_);
}
-Tellico::Data::FieldPtr Collection::fieldByTitle(const QString& title_) const {
- return m_fieldTitleDict.isEmpty() ? 0 : title_.isEmpty() ? 0 : m_fieldTitleDict.find(title_);
+Tellico::Data::FieldPtr Collection::fieldByTitle(const TQString& title_) const {
+ return m_fieldTitleDict.isEmpty() ? 0 : title_.isEmpty() ? 0 : m_fieldTitleDict.tqfind(title_);
}
-bool Collection::hasField(const QString& name_) const {
+bool Collection::hasField(const TQString& name_) const {
return fieldByName(name_) != 0;
}
-bool Collection::isAllowed(const QString& key_, const QString& value_) const {
+bool Collection::isAllowed(const TQString& key_, const TQString& value_) const {
// empty string is always allowed
if(value_.isEmpty()) {
return true;
@@ -575,19 +575,19 @@ bool Collection::isAllowed(const QString& key_, const QString& value_) const {
FieldPtr field = fieldByName(key_);
// if the type is not multiple choice or if value_ is allowed, return true
- if(field && (field->type() != Field::Choice || field->allowed().findIndex(value_) > -1)) {
+ if(field && (field->type() != Field::Choice || field->allowed().tqfindIndex(value_) > -1)) {
return true;
}
return false;
}
-Tellico::Data::EntryGroupDict* Collection::entryGroupDictByName(const QString& name_) {
+Tellico::Data::EntryGroupDict* Collection::entryGroupDictByName(const TQString& name_) {
// myDebug() << "Collection::entryGroupDictByName() - " << name_ << endl;
if(name_.isEmpty()) {
return 0;
}
- EntryGroupDict* dict = m_entryGroupDicts.isEmpty() ? 0 : m_entryGroupDicts.find(name_);
+ EntryGroupDict* dict = m_entryGroupDicts.isEmpty() ? 0 : m_entryGroupDicts.tqfind(name_);
if(dict && dict->isEmpty()) {
GUI::CursorSaver cs;
const bool b = signalsBlocked();
@@ -599,21 +599,21 @@ Tellico::Data::EntryGroupDict* Collection::entryGroupDictByName(const QString& n
return dict;
}
-void Collection::populateDict(EntryGroupDict* dict_, const QString& fieldName_, EntryVec entries_) {
+void Collection::populateDict(EntryGroupDict* dict_, const TQString& fieldName_, EntryVec entries_) {
// myDebug() << "Collection::populateDict() - " << fieldName_ << endl;
bool isBool = hasField(fieldName_) && fieldByName(fieldName_)->type() == Field::Bool;
PtrVector<EntryGroup> modifiedGroups;
for(EntryVecIt entry = entries_.begin(); entry != entries_.end(); ++entry) {
- QStringList groups = entryGroupNamesByField(entry, fieldName_);
- for(QStringList::ConstIterator groupIt = groups.begin(); groupIt != groups.end(); ++groupIt) {
+ TQStringList groups = entryGroupNamesByField(entry, fieldName_);
+ for(TQStringList::ConstIterator groupIt = groups.begin(); groupIt != groups.end(); ++groupIt) {
// find the group for this group name
// bool fields used the field title
- QString groupTitle = *groupIt;
+ TQString groupTitle = *groupIt;
if(isBool && groupTitle != i18n(s_emptyGroupTitle)) {
groupTitle = fieldTitleByName(fieldName_);
}
- EntryGroup* group = dict_->find(groupTitle);
+ EntryGroup* group = dict_->tqfind(groupTitle);
// if the group doesn't exist, create it
if(!group) {
group = new EntryGroup(groupTitle, fieldName_);
@@ -644,7 +644,7 @@ void Collection::populateCurrentDicts(EntryVec entries_) {
// for each dict, get the value of that field for the entry
// if multiple values are allowed, split the value and then insert the
// entry pointer into the dict for each value
- QDictIterator<EntryGroupDict> dictIt(m_entryGroupDicts);
+ TQDictIterator<EntryGroupDict> dictIt(m_entryGroupDicts);
for( ; dictIt.current(); ++dictIt) {
// only populate if it's not empty, since they are
// populated on demand
@@ -656,7 +656,7 @@ void Collection::populateCurrentDicts(EntryVec entries_) {
if(allEmpty) {
// need to populate the current group dict
- const QString group = Controller::self()->groupBy();
+ const TQString group = Controller::self()->groupBy();
EntryGroupDict* dict = m_entryGroupDicts[group];
if(dict) {
populateDict(dict, group, entries_);
@@ -668,7 +668,7 @@ void Collection::populateCurrentDicts(EntryVec entries_) {
// for a given field. Normally, this would just be splitting the entry's value
// for the field, but if the field name is the people pseudo-group, then it gets
// a bit more complicated
-QStringList Collection::entryGroupNamesByField(EntryPtr entry_, const QString& fieldName_) {
+TQStringList Collection::entryGroupNamesByField(EntryPtr entry_, const TQString& fieldName_) {
if(fieldName_ != s_peopleGroupName) {
return entry_->groupNamesByFieldName(fieldName_);
}
@@ -681,8 +681,8 @@ QStringList Collection::entryGroupNamesByField(EntryPtr entry_, const QString& f
return values.toList();
}
-void Collection::invalidateGroups() {
- QDictIterator<EntryGroupDict> dictIt(m_entryGroupDicts);
+void Collection::tqinvalidateGroups() {
+ TQDictIterator<EntryGroupDict> dictIt(m_entryGroupDicts);
for( ; dictIt.current(); ++dictIt) {
dictIt.current()->clear();
}
@@ -690,7 +690,7 @@ void Collection::invalidateGroups() {
// populateDicts() will make signals that the group view is connected to, block those
blockSignals(true);
for(EntryVecIt it = m_entries.begin(); it != m_entries.end(); ++it) {
- it->invalidateFormattedFieldValue();
+ it->tqinvalidateFormattedFieldValue();
it->clearGroups();
}
blockSignals(false);
@@ -762,12 +762,12 @@ bool Collection::dependentFieldHasRecursion(FieldPtr field_) {
StringSet fieldNamesFound;
fieldNamesFound.add(field_->name());
- QValueStack<FieldPtr> fieldsToCheck;
+ TQValueStack<FieldPtr> fieldsToCheck;
fieldsToCheck.push(field_);
while(!fieldsToCheck.isEmpty()) {
FieldPtr f = fieldsToCheck.pop();
- const QStringList depFields = f->dependsOn();
- for(QStringList::ConstIterator it = depFields.begin(); it != depFields.end(); ++it) {
+ const TQStringList depFields = f->dependsOn();
+ for(TQStringList::ConstIterator it = depFields.begin(); it != depFields.end(); ++it) {
if(fieldNamesFound.has(*it)) {
// we have recursion
return true;
@@ -794,7 +794,7 @@ int Collection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const
// start with twice the title score
// and since the minimum is > 10, then need more than just a perfect title match
- int res = 2*Entry::compareValues(entry1_, entry2_, QString::fromLatin1("title"), this);
+ int res = 2*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("title"), this);
// then add score for each field
FieldVec fields = entry1_->collection()->fields();
for(Data::FieldVecIt it = fields.begin(); it != fields.end(); ++it) {
@@ -825,17 +825,17 @@ bool Collection::mergeEntry(EntryPtr e1, EntryPtr e2, bool overwrite_, bool askU
continue;
} else if(field->type() == Field::Para) {
// for paragraph fields, concatenate the values, if they're not equal
- e1->setField(field, e1->field(field) + QString::fromLatin1("<br/><br/>") + e2->field(field));
+ e1->setField(field, e1->field(field) + TQString::tqfromLatin1("<br/><br/>") + e2->field(field));
ret = true;
} else if(field->type() == Field::Table) {
// if field F is a table-type field (album tracks, files, etc.), merge rows (keep their position)
// if e1's F val in [row i, column j] empty, replace with e2's val at same position
// if different (non-empty) vals at same position, CONFLICT!
- const QString sep = QString::fromLatin1("::");
- QStringList vals1 = e1->fields(field, false);
- QStringList vals2 = e2->fields(field, false);
+ const TQString sep = TQString::tqfromLatin1("::");
+ TQStringList vals1 = e1->fields(field, false);
+ TQStringList vals2 = e2->fields(field, false);
while(vals1.count() < vals2.count()) {
- vals1 += QString();
+ vals1 += TQString();
}
for(uint i = 0; i < vals2.count(); ++i) {
if(vals2[i].isEmpty()) {
@@ -845,11 +845,11 @@ bool Collection::mergeEntry(EntryPtr e1, EntryPtr e2, bool overwrite_, bool askU
vals1[i] = vals2[i];
ret = true;
} else {
- QStringList parts1 = QStringList::split(sep, vals1[i], true);
- QStringList parts2 = QStringList::split(sep, vals2[i], true);
+ TQStringList parts1 = TQStringList::split(sep, vals1[i], true);
+ TQStringList parts2 = TQStringList::split(sep, vals2[i], true);
bool changedPart = false;
while(parts1.count() < parts2.count()) {
- parts1 += QString();
+ parts1 += TQString();
}
for(uint j = 0; j < parts2.count(); ++j) {
if(parts2[j].isEmpty()) {
@@ -876,23 +876,23 @@ bool Collection::mergeEntry(EntryPtr e1, EntryPtr e2, bool overwrite_, bool askU
}
}
if(ret) {
- e1->setField(field, vals1.join(QString::fromLatin1("; ")));
+ e1->setField(field, vals1.join(TQString::tqfromLatin1("; ")));
}
} else if(field->flags() & Data::Field::AllowMultiple) {
// if field F allows multiple values and not a Table (see above case),
// e1's F values = (e1's F values) U (e2's F values) (union)
// replace e1's field with union of e1's and e2's values for this field
- QStringList items1 = e1->fields(field, false);
- QStringList items2 = e2->fields(field, false);
- for(QStringList::ConstIterator it = items2.begin(); it != items2.end(); ++it) {
+ TQStringList items1 = e1->fields(field, false);
+ TQStringList items2 = e2->fields(field, false);
+ for(TQStringList::ConstIterator it = items2.begin(); it != items2.end(); ++it) {
// possible to have one value formatted and the other one not...
- if(!items1.contains(*it) && !items1.contains(Field::format(*it, field->formatFlag()))) {
+ if(!items1.tqcontains(*it) && !items1.tqcontains(Field::format(*it, field->formatFlag()))) {
items1.append(*it);
}
}
// not sure if I think it should be sorted or not
// items1.sort();
- e1->setField(field, items1.join(QString::fromLatin1("; ")));
+ e1->setField(field, items1.join(TQString::tqfromLatin1("; ")));
ret = true;
} else if(askUser_ && e1->field(field) != e2->field(field)) {
int ret = Kernel::self()->askAndMerge(e1, e2, field);
diff --git a/src/collection.h b/src/collection.h
index b7dae1f..db7acca 100644
--- a/src/collection.h
+++ b/src/collection.h
@@ -22,17 +22,17 @@
#include <ksharedptr.h>
-#include <qstringlist.h>
-#include <qptrlist.h>
-#include <qstring.h>
-#include <qdict.h>
-#include <qintdict.h>
-#include <qobject.h>
+#include <tqstringlist.h>
+#include <tqptrlist.h>
+#include <tqstring.h>
+#include <tqdict.h>
+#include <tqintdict.h>
+#include <tqobject.h>
namespace Tellico {
namespace Data {
class EntryGroup;
- typedef QDict<EntryGroup> EntryGroupDict;
+ typedef TQDict<EntryGroup> EntryGroupDict;
/**
* The Collection class is the primary data object, holding a
@@ -47,8 +47,9 @@ namespace Tellico {
*
* @author Robby Stephenson
*/
-class Collection : public QObject, public KShared {
+class Collection : public TQObject, public KShared {
Q_OBJECT
+ TQ_OBJECT
public:
enum Type {
@@ -75,7 +76,7 @@ public:
* @param title The title of the collection itself
* @param entryTitle The title of the entries, which can be translated
*/
- explicit Collection(const QString& title);
+ explicit Collection(const TQString& title);
/**
*/
virtual ~Collection();
@@ -97,20 +98,20 @@ public:
*
* @return The name
*/
- const QString& title() const { return m_title; }
+ const TQString& title() const { return m_title; }
/**
* Sets the title of the collection.
*
* @param title The new collection title
*/
- void setTitle(const QString& title) { m_title = title; }
+ void setTitle(const TQString& title) { m_title = title; }
/**
* Returns the name of the entries in the collection, e.g. "book".
* Not translated.
*
* @return The type name
*/
- QString typeName() const;
+ TQString typeName() const;
/**
* Returns a reference to the list of all the entries in the collection.
*
@@ -142,19 +143,19 @@ public:
*
* @return The list of group names
*/
- const QStringList& fieldCategories() const { return m_fieldCategories; }
+ const TQStringList& fieldCategories() const { return m_fieldCategories; }
/**
* Returns the name of the field used to group the entries by default.
*
* @return The field name
*/
- const QString& defaultGroupField() const { return m_defaultGroupField; }
+ const TQString& defaultGroupField() const { return m_defaultGroupField; }
/**
* Sets the name of the default field used to group the entries.
*
* @param name The name of the field
*/
- void setDefaultGroupField(const QString& name) { m_defaultGroupField = name; }
+ void setDefaultGroupField(const TQString& name) { m_defaultGroupField = name; }
/**
* Returns the number of entries in the collection.
*
@@ -199,7 +200,7 @@ public:
virtual bool mergeField(FieldPtr field);
virtual bool modifyField(FieldPtr field);
virtual bool removeField(FieldPtr field, bool force=false);
- virtual bool removeField(const QString& name, bool force=false);
+ virtual bool removeField(const TQString& name, bool force=false);
void reorderFields(const FieldVec& list);
// the reason this is not static is so I can call it from a collection pointer
@@ -215,33 +216,33 @@ public:
* @param value The desired value
* @return A boolean indicating if the value is an allowed value for that field
*/
- bool isAllowed(const QString& key, const QString& value) const;
+ bool isAllowed(const TQString& key, const TQString& value) const;
/**
* Returns a list of all the field names.
*
* @return The list of names
*/
- const QStringList& fieldNames() const { return m_fieldNames; }
+ const TQStringList& fieldNames() const { return m_fieldNames; }
/**
* Returns a list of all the field titles.
*
* @return The list of titles
*/
- const QStringList& fieldTitles() const { return m_fieldTitles; }
+ const TQStringList& fieldTitles() const { return m_fieldTitles; }
/**
* Returns the title of an field, given its name.
*
* @param name The field name
* @return The field title
*/
- const QString& fieldTitleByName(const QString& name) const;
+ const TQString& fieldTitleByName(const TQString& name) const;
/**
* Returns the name of an field, given its title.
*
* @param title The field title
* @return The field name
*/
- const QString& fieldNameByTitle(const QString& title) const;
+ const TQString& fieldNameByTitle(const TQString& title) const;
/**
* Returns a list of the values of a given field for every entry
* in the collection. The values in the list are not repeated. Attribute
@@ -251,14 +252,14 @@ public:
* @param name The name of the field
* @return The list of values
*/
- QStringList valuesByFieldName(const QString& name) const;
+ TQStringList valuesByFieldName(const TQString& name) const;
/**
* Returns a list of all the fields in a given category.
*
* @param category The name of the category
* @return The field list
*/
- FieldVec fieldsByCategory(const QString& category);
+ FieldVec fieldsByCategory(const TQString& category);
/**
* Returns a pointer to an field given its name. If none is found, a NULL pointer
* is returned.
@@ -266,7 +267,7 @@ public:
* @param name The field name
* @return The field pointer
*/
- FieldPtr fieldByName(const QString& name) const;
+ FieldPtr fieldByName(const TQString& name) const;
/**
* Returns a pointer to an field given its title. If none is found, a NULL pointer
* is returned. This lookup is slower than by name.
@@ -274,18 +275,18 @@ public:
* @param title The field title
* @return The field pointer
*/
- FieldPtr fieldByTitle(const QString& title) const;
+ FieldPtr fieldByTitle(const TQString& title) const;
/**
* Returns @p true if the collection contains a field named @ref name;
*/
- bool hasField(const QString& name) const;
+ bool hasField(const TQString& name) const;
/**
* Returns a list of all the possible entry groups. This value is cached rather
* than generated with each call, so the method should be fairly fast.
*
* @return The list of groups
*/
- const QStringList& entryGroups() const { return m_entryGroups; }
+ const TQStringList& entryGroups() const { return m_entryGroups; }
/**
* Returns a pointer to a dict of all the entries grouped by
* a certain field
@@ -293,11 +294,11 @@ public:
* @param name The name of the field by which the entries are grouped
* @return The list of group names
*/
- EntryGroupDict* entryGroupDictByName(const QString& name);
+ EntryGroupDict* entryGroupDictByName(const TQString& name);
/**
* Invalidates all group names in the collection.
*/
- void invalidateGroups();
+ void tqinvalidateGroups();
/**
* Returns true if the collection contains at least one Image field.
*
@@ -326,7 +327,7 @@ public:
/**
* The string used for the people pseudo-group. This forces consistency.
*/
- static const QString s_peopleGroupName;
+ static const TQString s_peopleGroupName;
// these are the values that should be compared against
// the result from sameEntry()
@@ -338,9 +339,9 @@ signals:
void signalRefreshField(Tellico::Data::FieldPtr field);
private:
- QStringList entryGroupNamesByField(EntryPtr entry, const QString& fieldName);
+ TQStringList entryGroupNamesByField(EntryPtr entry, const TQString& fieldName);
void removeEntriesFromDicts(EntryVec entries);
- void populateDict(EntryGroupDict* dict, const QString& fieldName, EntryVec entries);
+ void populateDict(EntryGroupDict* dict, const TQString& fieldName, EntryVec entries);
void populateCurrentDicts(EntryVec entries);
void cleanGroups();
bool dependentFieldHasRecursion(FieldPtr field);
@@ -362,25 +363,25 @@ private:
long m_id;
long m_nextEntryId;
- QString m_title;
- QString m_typeName;
- QString m_iconName;
- QString m_defaultGroupField;
+ TQString m_title;
+ TQString m_typeName;
+ TQString m_iconName;
+ TQString m_defaultGroupField;
FieldVec m_fields;
FieldVec m_peopleFields; // keep separate list of people fields
FieldVec m_imageFields; // keep track of image fields
- QDict<Field> m_fieldNameDict;
- QDict<Field> m_fieldTitleDict;
- QStringList m_fieldCategories;
- QStringList m_fieldNames;
- QStringList m_fieldTitles;
+ TQDict<Field> m_fieldNameDict;
+ TQDict<Field> m_fieldTitleDict;
+ TQStringList m_fieldCategories;
+ TQStringList m_fieldNames;
+ TQStringList m_fieldTitles;
EntryVec m_entries;
- QIntDict<Entry> m_entryIdDict;
+ TQIntDict<Entry> m_entryIdDict;
- QDict<EntryGroupDict> m_entryGroupDicts;
- QStringList m_entryGroups;
+ TQDict<EntryGroupDict> m_entryGroupDicts;
+ TQStringList m_entryGroups;
PtrVector<EntryGroup> m_groupsToDelete;
FilterVec m_filters;
diff --git a/src/collectionfactory.cpp b/src/collectionfactory.cpp
index 25f9d6f..974d254 100644
--- a/src/collectionfactory.cpp
+++ b/src/collectionfactory.cpp
@@ -79,7 +79,7 @@ Tellico::Data::CollPtr CollectionFactory::collection(int type_, bool addFields_)
}
Data::CollPtr c = new Data::Collection(i18n("My Collection"));
- Data::FieldPtr f = new Data::Field(QString::fromLatin1("title"), i18n("Title"));
+ Data::FieldPtr f = new Data::Field(TQString::tqfromLatin1("title"), i18n("Title"));
f->setCategory(i18n("General"));
f->setFlags(Data::Field::NoDelete);
f->setFormatFlag(Data::Field::FormatTitle);
@@ -88,7 +88,7 @@ Tellico::Data::CollPtr CollectionFactory::collection(int type_, bool addFields_)
}
// static
-Tellico::Data::CollPtr CollectionFactory::collection(const QString& typeName_, bool addFields_) {
+Tellico::Data::CollPtr CollectionFactory::collection(const TQString& typeName_, bool addFields_) {
if(typeName_ == typeName(Data::Collection::Book)) {
return new Data::BookCollection(addFields_);
} else if(typeName_ == typeName(Data::Collection::Album)) {
@@ -137,68 +137,68 @@ Tellico::CollectionNameMap CollectionFactory::nameMap() {
return map;
}
-QString CollectionFactory::typeName(int type_) {
+TQString CollectionFactory::typeName(int type_) {
switch(type_) {
case Data::Collection::Book:
- return QString::fromLatin1("book");
+ return TQString::tqfromLatin1("book");
break;
case Data::Collection::Video:
- return QString::fromLatin1("video");
+ return TQString::tqfromLatin1("video");
break;
case Data::Collection::Album:
- return QString::fromLatin1("album");
+ return TQString::tqfromLatin1("album");
break;
case Data::Collection::Bibtex:
- return QString::fromLatin1("bibtex");
+ return TQString::tqfromLatin1("bibtex");
break;
case Data::Collection::ComicBook:
- return QString::fromLatin1("comic");
+ return TQString::tqfromLatin1("comic");
break;
case Data::Collection::Wine:
- return QString::fromLatin1("wine");
+ return TQString::tqfromLatin1("wine");
break;
case Data::Collection::Coin:
- return QString::fromLatin1("coin");
+ return TQString::tqfromLatin1("coin");
break;
case Data::Collection::Stamp:
- return QString::fromLatin1("stamp");
+ return TQString::tqfromLatin1("stamp");
break;
case Data::Collection::Card:
- return QString::fromLatin1("card");
+ return TQString::tqfromLatin1("card");
break;
case Data::Collection::Game:
- return QString::fromLatin1("game");
+ return TQString::tqfromLatin1("game");
break;
case Data::Collection::File:
- return QString::fromLatin1("file");
+ return TQString::tqfromLatin1("file");
break;
case Data::Collection::BoardGame:
- return QString::fromLatin1("boardgame");
+ return TQString::tqfromLatin1("boardgame");
break;
case Data::Collection::Base:
- return QString::fromLatin1("entry");
+ return TQString::tqfromLatin1("entry");
break;
default:
kdWarning() << "CollectionFactory::collection() - collection type not implemented: " << type_ << endl;
- return QString::fromLatin1("entry");
+ return TQString::tqfromLatin1("entry");
break;
}
}
-bool CollectionFactory::isDefaultField(int type_, const QString& name_) {
+bool CollectionFactory::isDefaultField(int type_, const TQString& name_) {
Data::CollPtr coll = collection(type_, true);
Data::FieldVec fields = coll->fields();
for(Data::FieldVec::Iterator field = fields.begin(); field != fields.end(); ++field) {
diff --git a/src/collectionfactory.h b/src/collectionfactory.h
index 72d42b1..20568a9 100644
--- a/src/collectionfactory.h
+++ b/src/collectionfactory.h
@@ -16,11 +16,11 @@
#include "datavectors.h"
-#include <qmap.h>
+#include <tqmap.h>
namespace Tellico {
-typedef QMap<int, QString> CollectionNameMap;
+typedef TQMap<int, TQString> CollectionNameMap;
/**
* A factory class for dealing with the different types of collections.
@@ -30,10 +30,10 @@ typedef QMap<int, QString> CollectionNameMap;
class CollectionFactory {
public:
static Data::CollPtr collection(int type, bool addFields);
- static Data::CollPtr collection(const QString& typeName, bool addFields);
+ static Data::CollPtr collection(const TQString& typeName, bool addFields);
static CollectionNameMap nameMap();
- static QString typeName(int type);
- static bool isDefaultField(int type, const QString& name);
+ static TQString typeName(int type);
+ static bool isDefaultField(int type, const TQString& name);
};
} // end namespace
diff --git a/src/collectionfieldsdialog.cpp b/src/collectionfieldsdialog.cpp
index cc9aede..1a5e408 100644
--- a/src/collectionfieldsdialog.cpp
+++ b/src/collectionfieldsdialog.cpp
@@ -29,31 +29,31 @@
#include <kpushbutton.h>
#include <kaccelmanager.h>
-#include <qgroupbox.h>
-#include <qlayout.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qlabel.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qregexp.h>
-#include <qwhatsthis.h>
-#include <qtimer.h>
+#include <tqgroupbox.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqvbox.h>
+#include <tqlabel.h>
+#include <tqradiobutton.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqregexp.h>
+#include <tqwhatsthis.h>
+#include <tqtimer.h>
using Tellico::FieldListBox;
using Tellico::CollectionFieldsDialog;
-FieldListBox::FieldListBox(QListBox* listbox_, Data::FieldPtr field_)
+FieldListBox::FieldListBox(TQListBox* listbox_, Data::FieldPtr field_)
: GUI::ListBoxText(listbox_, field_->title()), m_field(field_) {
}
-FieldListBox::FieldListBox(QListBox* listbox_, Data::FieldPtr field_, QListBoxItem* after_)
+FieldListBox::FieldListBox(TQListBox* listbox_, Data::FieldPtr field_, TQListBoxItem* after_)
: GUI::ListBoxText(listbox_, field_->title(), after_), m_field(field_) {
}
-CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, QWidget* parent_, const char* name_/*=0*/)
- : KDialogBase(parent_, name_, false, i18n("Collection Fields"), Help|Default|Ok|Apply|Cancel, Ok, false),
+CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : KDialogBase(tqparent_, name_, false, i18n("Collection Fields"), Help|Default|Ok|Apply|Cancel, Ok, false),
m_coll(coll_),
m_defaultCollection(0),
m_currentField(0),
@@ -61,13 +61,13 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, QWidget* par
m_updatingValues(false),
m_reordered(false),
m_oldIndex(-1) {
- QWidget* page = new QWidget(this);
+ TQWidget* page = new TQWidget(this);
setMainWidget(page);
- QHBoxLayout* topLayout = new QHBoxLayout(page, 0, KDialog::spacingHint());
+ TQHBoxLayout* topLayout = new TQHBoxLayout(page, 0, KDialog::spacingHint());
- QGroupBox* fieldsGroup = new QGroupBox(1, Qt::Horizontal, i18n("Current Fields"), page);
+ TQGroupBox* fieldsGroup = new TQGroupBox(1, Qt::Horizontal, i18n("Current Fields"), page);
topLayout->addWidget(fieldsGroup, 1);
- m_fieldsBox = new QListBox(fieldsGroup);
+ m_fieldsBox = new TQListBox(fieldsGroup);
m_fieldsBox->setMinimumWidth(150);
Data::FieldVec fields = m_coll->fields();
@@ -77,61 +77,61 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, QWidget* par
(void) new FieldListBox(m_fieldsBox, it);
}
}
- connect(m_fieldsBox, SIGNAL(highlighted(int)), SLOT(slotHighlightedChanged(int)));
+ connect(m_fieldsBox, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotHighlightedChanged(int)));
- QHBox* hb1 = new QHBox(fieldsGroup);
+ TQHBox* hb1 = new TQHBox(fieldsGroup);
hb1->setSpacing(KDialog::spacingHint());
m_btnNew = new KPushButton(i18n("New Field", "&New"), hb1);
- m_btnNew->setIconSet(BarIcon(QString::fromLatin1("filenew"), KIcon::SizeSmall));
- QWhatsThis::add(m_btnNew, i18n("Add a new field to the collection"));
+ m_btnNew->setIconSet(BarIcon(TQString::tqfromLatin1("filenew"), KIcon::SizeSmall));
+ TQWhatsThis::add(m_btnNew, i18n("Add a new field to the collection"));
m_btnDelete = new KPushButton(i18n("Delete Field", "&Delete"), hb1);
- m_btnDelete->setIconSet(BarIconSet(QString::fromLatin1("editdelete"), KIcon::SizeSmall));
- QWhatsThis::add(m_btnDelete, i18n("Remove a field from the collection"));
+ m_btnDelete->setIconSet(BarIconSet(TQString::tqfromLatin1("editdelete"), KIcon::SizeSmall));
+ TQWhatsThis::add(m_btnDelete, i18n("Remove a field from the collection"));
- connect(m_btnNew, SIGNAL(clicked()), SLOT(slotNew()) );
- connect(m_btnDelete, SIGNAL(clicked()), SLOT(slotDelete()));
+ connect(m_btnNew, TQT_SIGNAL(clicked()), TQT_SLOT(slotNew()) );
+ connect(m_btnDelete, TQT_SIGNAL(clicked()), TQT_SLOT(slotDelete()));
- QHBox* hb2 = new QHBox(fieldsGroup);
+ TQHBox* hb2 = new TQHBox(fieldsGroup);
hb2->setSpacing(KDialog::spacingHint());
m_btnUp = new KPushButton(hb2);
- m_btnUp->setPixmap(BarIcon(QString::fromLatin1("up"), KIcon::SizeSmall));
- QWhatsThis::add(m_btnUp, i18n("Move this field up in the list. The list order is important "
- "for the layout of the entry editor."));
+ m_btnUp->setPixmap(BarIcon(TQString::tqfromLatin1("up"), KIcon::SizeSmall));
+ TQWhatsThis::add(m_btnUp, i18n("Move this field up in the list. The list order is important "
+ "for the tqlayout of the entry editor."));
m_btnDown = new KPushButton(hb2);
- m_btnDown->setPixmap(BarIcon(QString::fromLatin1("down"), KIcon::SizeSmall));
- QWhatsThis::add(m_btnDown, i18n("Move this field down in the list. The list order is important "
- "for the layout of the entry editor."));
+ m_btnDown->setPixmap(BarIcon(TQString::tqfromLatin1("down"), KIcon::SizeSmall));
+ TQWhatsThis::add(m_btnDown, i18n("Move this field down in the list. The list order is important "
+ "for the tqlayout of the entry editor."));
- connect(m_btnUp, SIGNAL(clicked()), SLOT(slotMoveUp()) );
- connect(m_btnDown, SIGNAL(clicked()), SLOT(slotMoveDown()));
+ connect(m_btnUp, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveUp()) );
+ connect(m_btnDown, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveDown()));
- QVBox* vbox = new QVBox(page);
+ TQVBox* vbox = new TQVBox(page);
vbox->setSpacing(KDialog::spacingHint());
topLayout->addWidget(vbox, 2);
- QGroupBox* propGroup = new QGroupBox(1, Qt::Horizontal, i18n("Field Properties"), vbox);
+ TQGroupBox* propGroup = new TQGroupBox(1, Qt::Horizontal, i18n("Field Properties"), vbox);
- QWidget* grid = new QWidget(propGroup);
- // (parent, nrows, ncols, margin, spacing)
- QGridLayout* layout = new QGridLayout(grid, 4, 4, 0, KDialog::spacingHint());
+ TQWidget* grid = new TQWidget(propGroup);
+ // (tqparent, nrows, ncols, margin, spacing)
+ TQGridLayout* tqlayout = new TQGridLayout(grid, 4, 4, 0, KDialog::spacingHint());
int row = -1;
- QLabel* label = new QLabel(i18n("&Title:"), grid);
- layout->addWidget(label, ++row, 0);
+ TQLabel* label = new TQLabel(i18n("&Title:"), grid);
+ tqlayout->addWidget(label, ++row, 0);
m_titleEdit = new KLineEdit(grid);
- layout->addWidget(m_titleEdit, row, 1);
+ tqlayout->addWidget(m_titleEdit, row, 1);
label->setBuddy(m_titleEdit);
- QString whats = i18n("The title of the field");
- QWhatsThis::add(label, whats);
- QWhatsThis::add(m_titleEdit, whats);
- connect(m_titleEdit, SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ TQString whats = i18n("The title of the field");
+ TQWhatsThis::add(label, whats);
+ TQWhatsThis::add(m_titleEdit, whats);
+ connect(m_titleEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
- label = new QLabel(i18n("T&ype:"), grid);
- layout->addWidget(label, row, 2);
+ label = new TQLabel(i18n("T&ype:"), grid);
+ tqlayout->addWidget(label, row, 2);
m_typeCombo = new KComboBox(grid);
- layout->addWidget(m_typeCombo, row, 3);
+ tqlayout->addWidget(m_typeCombo, row, 3);
label->setBuddy(m_typeCombo);
- whats = QString::fromLatin1("<qt>");
+ whats = TQString::tqfromLatin1("<qt>");
whats += i18n("The type of the field determines what values may be used. ");
whats += i18n("<i>Simple Text</i> is used for most fields. ");
whats += i18n("<i>Paragraph</i> is for large text blocks. ");
@@ -146,27 +146,27 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, QWidget* par
whats += i18n("A <i>Dependent</i> field depends on the values of other "
"fields, and is formatted according to the field description. ");
whats += i18n("A <i>Read Only</i> is for internal values, possibly useful for import and export. ");
- whats += QString::fromLatin1("</qt>");
- QWhatsThis::add(label, whats);
- QWhatsThis::add(m_typeCombo, whats);
+ whats += TQString::tqfromLatin1("</qt>");
+ TQWhatsThis::add(label, whats);
+ TQWhatsThis::add(m_typeCombo, whats);
// the typeTitles match the fieldMap().values() but in a better order
m_typeCombo->insertStringList(Data::Field::typeTitles());
- connect(m_typeCombo, SIGNAL(activated(int)), SLOT(slotModified()));
- connect(m_typeCombo, SIGNAL(activated(const QString&)), SLOT(slotTypeChanged(const QString&)));
+ connect(m_typeCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotModified()));
+ connect(m_typeCombo, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(slotTypeChanged(const TQString&)));
- label = new QLabel(i18n("Cate&gory:"), grid);
- layout->addWidget(label, ++row, 0);
+ label = new TQLabel(i18n("Cate&gory:"), grid);
+ tqlayout->addWidget(label, ++row, 0);
m_catCombo = new KComboBox(true, grid);
- layout->addWidget(m_catCombo, row, 1);
+ tqlayout->addWidget(m_catCombo, row, 1);
label->setBuddy(m_catCombo);
whats = i18n("The field category determines where the field is placed in the editor.");
- QWhatsThis::add(label, whats);
- QWhatsThis::add(m_catCombo, whats);
+ TQWhatsThis::add(label, whats);
+ TQWhatsThis::add(m_catCombo, whats);
// I don't want to include the categories for singleCategory fields
- QStringList cats;
- const QStringList allCats = m_coll->fieldCategories();
- for(QStringList::ConstIterator it = allCats.begin(); it != allCats.end(); ++it) {
+ TQStringList cats;
+ const TQStringList allCats = m_coll->fieldCategories();
+ for(TQStringList::ConstIterator it = allCats.begin(); it != allCats.end(); ++it) {
Data::FieldVec fields = m_coll->fieldsByCategory(*it);
if(!fields.isEmpty() && !fields.begin()->isSingleCategory()) {
cats.append(*it);
@@ -174,105 +174,105 @@ CollectionFieldsDialog::CollectionFieldsDialog(Data::CollPtr coll_, QWidget* par
}
m_catCombo->insertStringList(cats);
m_catCombo->setDuplicatesEnabled(false);
- connect(m_catCombo, SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ connect(m_catCombo, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
- label = new QLabel(i18n("Descr&iption:"), grid);
- layout->addWidget(label, ++row, 0);
+ label = new TQLabel(i18n("Descr&iption:"), grid);
+ tqlayout->addWidget(label, ++row, 0);
m_descEdit = new KLineEdit(grid);
m_descEdit->setMinimumWidth(150);
- layout->addMultiCellWidget(m_descEdit, row, row, 1, 3);
+ tqlayout->addMultiCellWidget(m_descEdit, row, row, 1, 3);
label->setBuddy(m_descEdit);
/* TRANSLATORS: Do not translate %{year} and %{title}. */
whats = i18n("The description is a useful reminder of what information is contained in the "
"field. For <i>Dependent</i> fields, the description is a format string such as "
"\"%{year} %{title}\" where the named fields get substituted in the string.");
- QWhatsThis::add(label, whats);
- QWhatsThis::add(m_descEdit, whats);
- connect(m_descEdit, SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ TQWhatsThis::add(label, whats);
+ TQWhatsThis::add(m_descEdit, whats);
+ connect(m_descEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
- label = new QLabel(i18n("&Default value:"), grid);
- layout->addWidget(label, ++row, 0);
+ label = new TQLabel(i18n("&Default value:"), grid);
+ tqlayout->addWidget(label, ++row, 0);
m_defaultEdit = new KLineEdit(grid);
- layout->addMultiCellWidget(m_defaultEdit, row, row, 1, 3);
+ tqlayout->addMultiCellWidget(m_defaultEdit, row, row, 1, 3);
label->setBuddy(m_defaultEdit);
whats = i18n("<qt>A default value can be set for new entries.</qt>");
- QWhatsThis::add(label, whats);
- QWhatsThis::add(m_defaultEdit, whats);
- connect(m_defaultEdit, SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ TQWhatsThis::add(label, whats);
+ TQWhatsThis::add(m_defaultEdit, whats);
+ connect(m_defaultEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
- label = new QLabel(i18n("A&llowed values:"), grid);
- layout->addWidget(label, ++row, 0);
+ label = new TQLabel(i18n("A&llowed values:"), grid);
+ tqlayout->addWidget(label, ++row, 0);
m_allowEdit = new KLineEdit(grid);
- layout->addMultiCellWidget(m_allowEdit, row, row, 1, 3);
+ tqlayout->addMultiCellWidget(m_allowEdit, row, row, 1, 3);
label->setBuddy(m_allowEdit);
whats = i18n("<qt>For <i>Choice</i>-type fields, these are the only values allowed. They are "
"placed in a combo box. The possible values have to be separated by a semi-colon, "
"for example: \"dog; cat; mouse\"</qt>");
- QWhatsThis::add(label, whats);
- QWhatsThis::add(m_allowEdit, whats);
- connect(m_allowEdit, SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ TQWhatsThis::add(label, whats);
+ TQWhatsThis::add(m_allowEdit, whats);
+ connect(m_allowEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
- label = new QLabel(i18n("Extended &properties:"), grid);
- layout->addWidget(label, ++row, 0);
+ label = new TQLabel(i18n("Extended &properties:"), grid);
+ tqlayout->addWidget(label, ++row, 0);
m_btnExtended = new KPushButton(i18n("&Set..."), grid);
- m_btnExtended->setIconSet(BarIcon(QString::fromLatin1("bookmark"), KIcon::SizeSmall));
- layout->addWidget(m_btnExtended, row, 1);
+ m_btnExtended->setIconSet(BarIcon(TQString::tqfromLatin1("bookmark"), KIcon::SizeSmall));
+ tqlayout->addWidget(m_btnExtended, row, 1);
label->setBuddy(m_btnExtended);
whats = i18n("Extended field properties are used to specify things such as the corresponding bibtex field.");
- QWhatsThis::add(label, whats);
- QWhatsThis::add(m_btnExtended, whats);
- connect(m_btnExtended, SIGNAL(clicked()), SLOT(slotShowExtendedProperties()));
+ TQWhatsThis::add(label, whats);
+ TQWhatsThis::add(m_btnExtended, whats);
+ connect(m_btnExtended, TQT_SIGNAL(clicked()), TQT_SLOT(slotShowExtendedProperties()));
- QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, i18n("Format Options"), vbox);
- m_formatNone = new QRadioButton(i18n("No formatting"), bg);
- QWhatsThis::add(m_formatNone, i18n("This option prevents the field from ever being "
+ TQButtonGroup* bg = new TQButtonGroup(1, Qt::Horizontal, i18n("Format Options"), vbox);
+ m_formatNone = new TQRadioButton(i18n("No formatting"), bg);
+ TQWhatsThis::add(m_formatNone, i18n("This option prevents the field from ever being "
"automatically formatted or capitalized."));
- m_formatPlain = new QRadioButton(i18n("Allow auto-capitalization only"), bg);
- QWhatsThis::add(m_formatPlain, i18n("This option allows the field to be capitalized, but "
+ m_formatPlain = new TQRadioButton(i18n("Allow auto-capitalization only"), bg);
+ TQWhatsThis::add(m_formatPlain, i18n("This option allows the field to be capitalized, but "
"not specially formatted."));
- m_formatTitle = new QRadioButton(i18n("Format as a title"), bg);
- QWhatsThis::add(m_formatTitle, i18n("This option capitalizes and formats the field as a "
+ m_formatTitle = new TQRadioButton(i18n("Format as a title"), bg);
+ TQWhatsThis::add(m_formatTitle, i18n("This option capitalizes and formats the field as a "
"title, but only if those options are globally set."));
- m_formatName = new QRadioButton(i18n("Format as a name"), bg);
- QWhatsThis::add(m_formatName, i18n("This option capitalizes and formats the field as a "
+ m_formatName = new TQRadioButton(i18n("Format as a name"), bg);
+ TQWhatsThis::add(m_formatName, i18n("This option capitalizes and formats the field as a "
"name, but only if those options are globally set."));
- connect(bg, SIGNAL(clicked(int)), SLOT(slotModified()));
+ connect(bg, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotModified()));
- QGroupBox* optionsGroup = new QGroupBox(1, Qt::Horizontal, i18n("Field Options"), vbox);
- m_complete = new QCheckBox(i18n("Enable auto-completion"), optionsGroup);
- QWhatsThis::add(m_complete, i18n("If checked, KDE auto-completion will be enabled in the "
+ TQGroupBox* optionsGroup = new TQGroupBox(1, Qt::Horizontal, i18n("Field Options"), vbox);
+ m_complete = new TQCheckBox(i18n("Enable auto-completion"), optionsGroup);
+ TQWhatsThis::add(m_complete, i18n("If checked, KDE auto-completion will be enabled in the "
"text edit box for this field."));
- m_multiple = new QCheckBox(i18n("Allow multiple values"), optionsGroup);
- QWhatsThis::add(m_multiple, i18n("If checked, Tellico will parse the values in the field "
+ m_multiple = new TQCheckBox(i18n("Allow multiple values"), optionsGroup);
+ TQWhatsThis::add(m_multiple, i18n("If checked, Tellico will parse the values in the field "
"for multiple values, separated by a semi-colon."));
- m_grouped = new QCheckBox(i18n("Allow grouping"), optionsGroup);
- QWhatsThis::add(m_grouped, i18n("If checked, this field may be used to group the entries in "
+ m_grouped = new TQCheckBox(i18n("Allow grouping"), optionsGroup);
+ TQWhatsThis::add(m_grouped, i18n("If checked, this field may be used to group the entries in "
"the group view."));
- connect(m_complete, SIGNAL(clicked()), SLOT(slotModified()));
- connect(m_multiple, SIGNAL(clicked()), SLOT(slotModified()));
- connect(m_grouped, SIGNAL(clicked()), SLOT(slotModified()));
+ connect(m_complete, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified()));
+ connect(m_multiple, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified()));
+ connect(m_grouped, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified()));
// need to stretch at bottom
- vbox->setStretchFactor(new QWidget(vbox), 1);
+ vbox->setStretchFactor(new TQWidget(vbox), 1);
KAcceleratorManager::manage(vbox);
// keep a default collection
m_defaultCollection = CollectionFactory::collection(m_coll->type(), true);
- QWhatsThis::add(actionButton(KDialogBase::Default),
+ TQWhatsThis::add(actionButton(KDialogBase::Default),
i18n("Revert the selected field's properties to the default values."));
enableButtonOK(false);
enableButtonApply(false);
- setHelp(QString::fromLatin1("fields-dialog"));
+ setHelp(TQString::tqfromLatin1("fields-dialog"));
// initially the m_typeCombo is populated with all types, but as soon as something is
// selected in the fields box, the combo box is cleared and filled with the allowable
// new types. The problem is that when more types are added, the size of the combo box
// doesn't change. So when everything is laid out, the combo box needs to have all the
// items there.
- QTimer::singleShot(0, this, SLOT(slotSelectInitial()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotSelectInitial()));
}
CollectionFieldsDialog::~CollectionFieldsDialog() {
@@ -310,26 +310,26 @@ void CollectionFieldsDialog::applyChanges() {
field = it;
// check for Choice fields with removed values to warn user
if(field->type() == Data::Field::Choice || field->type() == Data::Field::Rating) {
- QStringList oldValues = m_coll->fieldByName(field->name())->allowed();
- QStringList newValues = field->allowed();
- for(QStringList::ConstIterator vIt = oldValues.begin(); vIt != oldValues.end(); ++vIt) {
- if(newValues.contains(*vIt)) {
+ TQStringList oldValues = m_coll->fieldByName(field->name())->allowed();
+ TQStringList newValues = field->allowed();
+ for(TQStringList::ConstIterator vIt = oldValues.begin(); vIt != oldValues.end(); ++vIt) {
+ if(newValues.tqcontains(*vIt)) {
continue;
}
int ret = KMessageBox::warningContinueCancel(this,
i18n("<qt>Removing allowed values from the <i>%1</i> field which "
"currently exist in the collection may cause data corruption. "
"Do you want to keep your modified values or cancel and revert "
- "to the current ones?</qt>").arg(field->title()),
- QString::null,
+ "to the current ones?</qt>").tqarg(field->title()),
+ TQString(),
i18n("Keep modified values"));
if(ret != KMessageBox::Continue) {
if(field->type() == Data::Field::Choice) {
field->setAllowed(oldValues);
} else { // rating field
Data::FieldPtr oldField = m_coll->fieldByName(field->name());
- field->setProperty(QString::fromLatin1("minimum"), oldField->property(QString::fromLatin1("minimum")));
- field->setProperty(QString::fromLatin1("maximum"), oldField->property(QString::fromLatin1("maximum")));
+ field->setProperty(TQString::tqfromLatin1("minimum"), oldField->property(TQString::tqfromLatin1("minimum")));
+ field->setProperty(TQString::tqfromLatin1("maximum"), oldField->property(TQString::tqfromLatin1("maximum")));
}
}
break;
@@ -344,7 +344,7 @@ void CollectionFieldsDialog::applyChanges() {
// set all text not to be colored, and get new list
Data::FieldVec fields;
- for(QListBoxItem* item = m_fieldsBox->firstItem(); item; item = item->next()) {
+ for(TQListBoxItem* item = m_fieldsBox->firstItem(); item; item = item->next()) {
static_cast<FieldListBox*>(item)->setColored(false);
if(m_reordered) {
Data::FieldPtr field = static_cast<FieldListBox*>(item)->field();
@@ -384,7 +384,7 @@ void CollectionFieldsDialog::applyChanges() {
// but we don't care about UI indications of changes
bool wasUpdating = m_updatingValues;
m_updatingValues = true;
- QString currType = m_typeCombo->currentText();
+ TQString currType = m_typeCombo->currentText();
m_typeCombo->clear();
m_typeCombo->insertStringList(newTypesAllowed(m_currentField->type()));
m_typeCombo->setCurrentItem(currType);
@@ -404,12 +404,12 @@ void CollectionFieldsDialog::slotNew() {
return;
}
- QString name = QString::fromLatin1("custom") + QString::number(m_newFields.count()+1);
+ TQString name = TQString::tqfromLatin1("custom") + TQString::number(m_newFields.count()+1);
int count = m_newFields.count() + 1;
- QString title = i18n("New Field") + QString::fromLatin1(" %1").arg(count);
- while(m_fieldsBox->findItem(title)) {
+ TQString title = i18n("New Field") + TQString::tqfromLatin1(" %1").tqarg(count);
+ while(m_fieldsBox->tqfindItem(title)) {
++count;
- title = i18n("New Field") + QString::fromLatin1(" %1").arg(count);
+ title = i18n("New Field") + TQString::tqfromLatin1(" %1").tqarg(count);
}
Data::FieldPtr field = new Data::Field(name, title);
@@ -432,7 +432,7 @@ void CollectionFieldsDialog::slotDelete() {
return;
}
- if(m_newFields.contains(m_currentField)) {
+ if(m_newFields.tqcontains(m_currentField)) {
// remove field from vector before deleting item containing field
m_newFields.remove(m_currentField);
m_fieldsBox->removeItem(m_fieldsBox->currentItem());
@@ -453,7 +453,7 @@ void CollectionFieldsDialog::slotDelete() {
}
}
-void CollectionFieldsDialog::slotTypeChanged(const QString& type_) {
+void CollectionFieldsDialog::slotTypeChanged(const TQString& type_) {
Data::Field::Type type = Data::Field::Undef;
const Data::Field::FieldMap fieldMap = Data::Field::typeMap();
for(Data::Field::FieldMap::ConstIterator it = fieldMap.begin(); it != fieldMap.end(); ++it) {
@@ -533,7 +533,7 @@ void CollectionFieldsDialog::slotHighlightedChanged(int index_) {
// type is limited to certain types, unless it's a new field
m_typeCombo->clear();
- if(m_newFields.contains(field)) {
+ if(m_newFields.tqcontains(field)) {
m_typeCombo->insertStringList(newTypesAllowed(Data::Field::Undef));
} else {
m_typeCombo->insertStringList(newTypesAllowed(field->type()));
@@ -544,7 +544,7 @@ void CollectionFieldsDialog::slotHighlightedChanged(int index_) {
slotTypeChanged(fieldMap[field->type()]); // just setting the text doesn't emit the activated signal
if(field->type() == Data::Field::Choice) {
- m_allowEdit->setText(field->allowed().join(QString::fromLatin1("; ")));
+ m_allowEdit->setText(field->allowed().join(TQString::tqfromLatin1("; ")));
} else {
m_allowEdit->clear();
}
@@ -601,19 +601,19 @@ void CollectionFieldsDialog::updateField() {
}
// only update name if it's one of the new ones
- if(m_newFields.contains(field)) {
+ if(m_newFields.tqcontains(field)) {
// name needs to be a valid XML element name
- QString name = XML::elementName(m_titleEdit->text().lower());
+ TQString name = XML::elementName(m_titleEdit->text().lower());
if(name.isEmpty()) { // might end up with empty string
- name = QString::fromLatin1("custom") + QString::number(m_newFields.count()+1);
+ name = TQString::tqfromLatin1("custom") + TQString::number(m_newFields.count()+1);
}
while(m_coll->hasField(name)) { // ensure name uniqueness
- name += QString::fromLatin1("-new");
+ name += TQString::tqfromLatin1("-new");
}
field->setName(name);
}
- const QString title = m_titleEdit->text().simplifyWhiteSpace();
+ const TQString title = m_titleEdit->text().simplifyWhiteSpace();
updateTitle(title);
const Data::Field::FieldMap& fieldMap = Data::Field::typeMap();
@@ -625,25 +625,25 @@ void CollectionFieldsDialog::updateField() {
}
if(field->type() == Data::Field::Choice) {
- const QRegExp rx(QString::fromLatin1("\\s*;\\s*"));
- field->setAllowed(QStringList::split(rx, m_allowEdit->text()));
- field->setProperty(QString::fromLatin1("minimum"), QString::null);
- field->setProperty(QString::fromLatin1("maximum"), QString::null);
+ const TQRegExp rx(TQString::tqfromLatin1("\\s*;\\s*"));
+ field->setAllowed(TQStringList::split(rx, m_allowEdit->text()));
+ field->setProperty(TQString::tqfromLatin1("minimum"), TQString());
+ field->setProperty(TQString::tqfromLatin1("maximum"), TQString());
} else if(field->type() == Data::Field::Rating) {
- QString v = field->property(QString::fromLatin1("minimum"));
+ TQString v = field->property(TQString::tqfromLatin1("minimum"));
if(v.isEmpty()) {
- field->setProperty(QString::fromLatin1("minimum"), QString::number(1));
+ field->setProperty(TQString::tqfromLatin1("minimum"), TQString::number(1));
}
- v = field->property(QString::fromLatin1("maximum"));
+ v = field->property(TQString::tqfromLatin1("maximum"));
if(v.isEmpty()) {
- field->setProperty(QString::fromLatin1("maximum"), QString::number(5));
+ field->setProperty(TQString::tqfromLatin1("maximum"), TQString::number(5));
}
}
if(field->isSingleCategory()) {
field->setCategory(field->title());
} else {
- QString category = m_catCombo->currentText().simplifyWhiteSpace();
+ TQString category = m_catCombo->currentText().simplifyWhiteSpace();
field->setCategory(category);
m_catCombo->setCurrentItem(category, true); // if it doesn't exist, it's added
}
@@ -699,13 +699,13 @@ void CollectionFieldsDialog::slotModified() {
static_cast<FieldListBox*>(m_fieldsBox->selectedItem())->setColored(true);
// check if copy exists already
- if(m_copiedFields.contains(m_currentField)) {
+ if(m_copiedFields.tqcontains(m_currentField)) {
return;
}
// or, check if is a new field, in which case no copy is needed
// check if copy exists already
- if(m_newFields.contains(m_currentField)) {
+ if(m_newFields.tqcontains(m_currentField)) {
return;
}
@@ -714,7 +714,7 @@ void CollectionFieldsDialog::slotModified() {
static_cast<FieldListBox*>(m_fieldsBox->selectedItem())->setField(m_currentField);
}
-void CollectionFieldsDialog::updateTitle(const QString& title_) {
+void CollectionFieldsDialog::updateTitle(const TQString& title_) {
// myDebug() << "CollectionFieldsDialog::updateTitle()" << endl;
if(m_currentField && m_currentField->title() != title_) {
m_fieldsBox->blockSignals(true);
@@ -742,10 +742,10 @@ void CollectionFieldsDialog::slotDefault() {
return;
}
- QString caption = i18n("Revert Field Properties");
- QString text = i18n("<qt><p>Do you really want to revert the properties for the <em>%1</em> "
- "field back to their default values?</p></qt>").arg(m_currentField->title());
- QString dontAsk = QString::fromLatin1("RevertFieldProperties");
+ TQString caption = i18n("Revert Field Properties");
+ TQString text = i18n("<qt><p>Do you really want to revert the properties for the <em>%1</em> "
+ "field back to their default values?</p></qt>").tqarg(m_currentField->title());
+ TQString dontAsk = TQString::tqfromLatin1("RevertFieldProperties");
int ret = KMessageBox::warningContinueCancel(this, text, caption, i18n("Revert"), dontAsk);
if(ret != KMessageBox::Continue) {
return;
@@ -760,7 +760,7 @@ void CollectionFieldsDialog::slotDefault() {
slotTypeChanged(fieldMap[defaultField->type()]); // just setting the text doesn't emit the activated signal
if(defaultField->type() == Data::Field::Choice) {
- m_allowEdit->setText(defaultField->allowed().join(QString::fromLatin1("; ")));
+ m_allowEdit->setText(defaultField->allowed().join(TQString::tqfromLatin1("; ")));
} else {
m_allowEdit->clear();
}
@@ -806,7 +806,7 @@ void CollectionFieldsDialog::slotDefault() {
}
void CollectionFieldsDialog::slotMoveUp() {
- QListBoxItem* item = m_fieldsBox->selectedItem();
+ TQListBoxItem* item = m_fieldsBox->selectedItem();
if(item) {
FieldListBox* prev = static_cast<FieldListBox*>(item->prev()); // could be 0
if(prev) {
@@ -829,7 +829,7 @@ void CollectionFieldsDialog::slotMoveUp() {
void CollectionFieldsDialog::slotMoveDown() {
FieldListBox* item = dynamic_cast<FieldListBox*>(m_fieldsBox->selectedItem());
if(item) {
- QListBoxItem* next = item->next(); // could be 0
+ TQListBoxItem* next = item->next(); // could be 0
if(next) {
FieldListBox* newItem = new FieldListBox(m_fieldsBox, item->field(), next);
newItem->setColored(item->isColored());
@@ -846,9 +846,9 @@ void CollectionFieldsDialog::slotMoveDown() {
enableButtonApply(true);
}
-Tellico::FieldListBox* CollectionFieldsDialog::findItem(const QListBox* box_, Data::FieldPtr field_) {
+Tellico::FieldListBox* CollectionFieldsDialog::findItem(const TQListBox* box_, Data::FieldPtr field_) {
// myDebug() << "CollectionFieldsDialog::findItem()" << endl;
- for(QListBoxItem* item = box_->firstItem(); item; item = item->next()) {
+ for(TQListBoxItem* item = box_->firstItem(); item; item = item->next()) {
FieldListBox* textItem = static_cast<FieldListBox*>(item);
if(textItem->field() == field_) {
return textItem;
@@ -864,17 +864,17 @@ bool CollectionFieldsDialog::slotShowExtendedProperties() {
// the default value is included in properties, but it has a
// separate edit box
- QString dv = m_currentField->defaultValue();
+ TQString dv = m_currentField->defaultValue();
StringMap props = m_currentField->propertyList();
- props.remove(QString::fromLatin1("default"));
+ props.remove(TQString::tqfromLatin1("default"));
StringMapDialog dlg(props, this, "ExtendedPropertiesDialog", true);
dlg.setCaption(i18n("Extended Field Properties"));
dlg.setLabels(i18n("Property"), i18n("Value"));
- if(dlg.exec() == QDialog::Accepted) {
+ if(dlg.exec() == TQDialog::Accepted) {
props = dlg.stringMap();
if(!dv.isEmpty()) {
- props.insert(QString::fromLatin1("default"), dv);
+ props.insert(TQString::tqfromLatin1("default"), dv);
}
m_currentField->setPropertyList(props);
slotModified();
@@ -888,7 +888,7 @@ bool CollectionFieldsDialog::checkValues() {
return true;
}
- const QString title = m_currentField->title();
+ const TQString title = m_currentField->title();
// find total number of boxes with this title in case multiple new ones with same title were added
int titleCount = 0;
for(uint i = 0; i < m_fieldsBox->count(); ++i) {
@@ -904,7 +904,7 @@ bool CollectionFieldsDialog::checkValues() {
return false;
}
- const QString category = m_currentField->category();
+ const TQString category = m_currentField->category();
if(category.isEmpty()) {
KMessageBox::sorry(this, i18n("<qt>The category may not be empty. Please enter a category.</qt>"));
m_catCombo->lineEdit()->selectAll();
@@ -931,26 +931,26 @@ bool CollectionFieldsDialog::checkValues() {
// check for rating values outside bounds
if(m_currentField->type() == Data::Field::Rating) {
bool ok; // ok to ignore this here
- int low = Tellico::toUInt(m_currentField->property(QString::fromLatin1("minimum")), &ok);
- int high = Tellico::toUInt(m_currentField->property(QString::fromLatin1("maximum")), &ok);
+ int low = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("minimum")), &ok);
+ int high = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("maximum")), &ok);
while(low < 1 || low > 9 || high < 1 || high > 10 || low >= high) {
KMessageBox::sorry(this, i18n("The range for a rating field must be between 1 and 10, "
"and the lower bound must be less than the higher bound. "
"Please enter different low and high properties."));
if(slotShowExtendedProperties()) {
- low = Tellico::toUInt(m_currentField->property(QString::fromLatin1("minimum")), &ok);
- high = Tellico::toUInt(m_currentField->property(QString::fromLatin1("maximum")), &ok);
+ low = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("minimum")), &ok);
+ high = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("maximum")), &ok);
} else {
return false;
}
}
} else if(m_currentField->type() == Data::Field::Table) {
bool ok; // ok to ignore this here
- int ncols = Tellico::toUInt(m_currentField->property(QString::fromLatin1("columns")), &ok);
+ int ncols = Tellico::toUInt(m_currentField->property(TQString::tqfromLatin1("columns")), &ok);
// also enforced in GUI::TableFieldWidget
if(ncols > 10) {
KMessageBox::sorry(this, i18n("Tables are limited to a maximum of ten columns."));
- m_currentField->setProperty(QString::fromLatin1("columns"), QString::fromLatin1("10"));
+ m_currentField->setProperty(TQString::tqfromLatin1("columns"), TQString::tqfromLatin1("10"));
}
}
@@ -958,7 +958,7 @@ bool CollectionFieldsDialog::checkValues() {
}
// only certain type changes are allowed
-QStringList CollectionFieldsDialog::newTypesAllowed(int type_ /*=0*/) {
+TQStringList CollectionFieldsDialog::newTypesAllowed(int type_ /*=0*/) {
// Undef means return all
if(type_ == Data::Field::Undef) {
return Data::Field::typeTitles();
@@ -966,7 +966,7 @@ QStringList CollectionFieldsDialog::newTypesAllowed(int type_ /*=0*/) {
const Data::Field::FieldMap& fieldMap = Data::Field::typeMap();
- QStringList newTypes;
+ TQStringList newTypes;
switch(type_) {
case Data::Field::Line: // might not work if converted to a number or URL, but ok
case Data::Field::Number:
diff --git a/src/collectionfieldsdialog.h b/src/collectionfieldsdialog.h
index cad0492..7647bec 100644
--- a/src/collectionfieldsdialog.h
+++ b/src/collectionfieldsdialog.h
@@ -18,16 +18,16 @@ class KComboBox;
class KLineEdit;
class KPushButton;
-class QRadioButton;
-class QCheckBox;
-class QPainter;
+class TQRadioButton;
+class TQCheckBox;
+class TQPainter;
#include "datavectors.h"
#include "gui/listboxtext.h"
#include <kdialogbase.h>
-#include <qmap.h>
+#include <tqmap.h>
namespace Tellico {
namespace Data {
@@ -36,8 +36,8 @@ namespace Tellico {
class FieldListBox : public GUI::ListBoxText {
public:
- FieldListBox(QListBox* listbox, Data::FieldPtr field);
- FieldListBox(QListBox* listbox, Data::FieldPtr field, QListBoxItem* after);
+ FieldListBox(TQListBox* listbox, Data::FieldPtr field);
+ FieldListBox(TQListBox* listbox, Data::FieldPtr field, TQListBoxItem* after);
Data::FieldPtr field() const { return m_field; }
void setField(Data::FieldPtr field) { m_field = field; }
@@ -51,16 +51,17 @@ private:
*/
class CollectionFieldsDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* The constructor sets up the dialog.
*
- * @param coll A pointer to the collection parent of all the attributes
- * @param parent A pointer to the parent widget
+ * @param coll A pointer to the collection tqparent of all the attributes
+ * @param tqparent A pointer to the tqparent widget
* @param name The widget name
*/
- CollectionFieldsDialog(Data::CollPtr coll, QWidget* parent, const char* name=0);
+ CollectionFieldsDialog(Data::CollPtr coll, TQWidget* tqparent, const char* name=0);
~CollectionFieldsDialog();
signals:
@@ -76,7 +77,7 @@ private slots:
void slotDelete();
void slotMoveUp();
void slotMoveDown();
- void slotTypeChanged(const QString& type);
+ void slotTypeChanged(const TQString& type);
void slotHighlightedChanged(int index);
void slotModified();
bool slotShowExtendedProperties();
@@ -85,10 +86,10 @@ private slots:
private:
void applyChanges();
void updateField();
- void updateTitle(const QString& title);
+ void updateTitle(const TQString& title);
bool checkValues();
- FieldListBox* findItem(const QListBox* box, Data::FieldPtr field);
- QStringList newTypesAllowed(int type);
+ FieldListBox* findItem(const TQListBox* box, Data::FieldPtr field);
+ TQStringList newTypesAllowed(int type);
Data::CollPtr m_coll;
Data::CollPtr m_defaultCollection;
@@ -100,7 +101,7 @@ private:
bool m_reordered;
int m_oldIndex;
- QListBox* m_fieldsBox;
+ TQListBox* m_fieldsBox;
KPushButton* m_btnNew;
KPushButton* m_btnDelete;
KPushButton* m_btnUp;
@@ -114,13 +115,13 @@ private:
KLineEdit* m_descEdit;
KPushButton* m_btnExtended;
- QRadioButton* m_formatNone;
- QRadioButton* m_formatPlain;
- QRadioButton* m_formatTitle;
- QRadioButton* m_formatName;
- QCheckBox* m_complete;
- QCheckBox* m_multiple;
- QCheckBox* m_grouped;
+ TQRadioButton* m_formatNone;
+ TQRadioButton* m_formatPlain;
+ TQRadioButton* m_formatTitle;
+ TQRadioButton* m_formatName;
+ TQCheckBox* m_complete;
+ TQCheckBox* m_multiple;
+ TQCheckBox* m_grouped;
};
} // end namespace
diff --git a/src/collections/bibtexcollection.cpp b/src/collections/bibtexcollection.cpp
index f069cc9..4218a3c 100644
--- a/src/collections/bibtexcollection.cpp
+++ b/src/collections/bibtexcollection.cpp
@@ -26,26 +26,26 @@ namespace {
static const char* bibtex_misc = I18N_NOOP("Miscellaneous");
}
-BibtexCollection::BibtexCollection(bool addFields_, const QString& title_ /*=null*/)
+BibtexCollection::BibtexCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("Bibliography") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("author"));
+ setDefaultGroupField(TQString::tqfromLatin1("author"));
// Bibtex has some default macros for the months
- addMacro(QString::fromLatin1("jan"), QString::null);
- addMacro(QString::fromLatin1("feb"), QString::null);
- addMacro(QString::fromLatin1("mar"), QString::null);
- addMacro(QString::fromLatin1("apr"), QString::null);
- addMacro(QString::fromLatin1("may"), QString::null);
- addMacro(QString::fromLatin1("jun"), QString::null);
- addMacro(QString::fromLatin1("jul"), QString::null);
- addMacro(QString::fromLatin1("aug"), QString::null);
- addMacro(QString::fromLatin1("sep"), QString::null);
- addMacro(QString::fromLatin1("oct"), QString::null);
- addMacro(QString::fromLatin1("nov"), QString::null);
- addMacro(QString::fromLatin1("dec"), QString::null);
+ addMacro(TQString::tqfromLatin1("jan"), TQString());
+ addMacro(TQString::tqfromLatin1("feb"), TQString());
+ addMacro(TQString::tqfromLatin1("mar"), TQString());
+ addMacro(TQString::tqfromLatin1("apr"), TQString());
+ addMacro(TQString::tqfromLatin1("may"), TQString());
+ addMacro(TQString::tqfromLatin1("jun"), TQString());
+ addMacro(TQString::tqfromLatin1("jul"), TQString());
+ addMacro(TQString::tqfromLatin1("aug"), TQString());
+ addMacro(TQString::tqfromLatin1("sep"), TQString());
+ addMacro(TQString::tqfromLatin1("oct"), TQString());
+ addMacro(TQString::tqfromLatin1("nov"), TQString());
+ addMacro(TQString::tqfromLatin1("dec"), TQString());
}
Tellico::Data::FieldVec BibtexCollection::defaultFields() {
@@ -53,189 +53,189 @@ Tellico::Data::FieldVec BibtexCollection::defaultFields() {
FieldPtr field;
/******************* General ****************************/
- field = new Field(QString::fromLatin1("title"), i18n("Title"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("title"));
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Title"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("title"));
field->setCategory(i18n("General"));
field->setFlags(Field::NoDelete);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- QStringList types;
- types << QString::fromLatin1("article") << QString::fromLatin1("book")
- << QString::fromLatin1("booklet") << QString::fromLatin1("inbook")
- << QString::fromLatin1("incollection") << QString::fromLatin1("inproceedings")
- << QString::fromLatin1("manual") << QString::fromLatin1("mastersthesis")
- << QString::fromLatin1("misc") << QString::fromLatin1("phdthesis")
- << QString::fromLatin1("proceedings") << QString::fromLatin1("techreport")
- << QString::fromLatin1("unpublished") << QString::fromLatin1("periodical")
- << QString::fromLatin1("conference");
- field = new Field(QString::fromLatin1("entry-type"), i18n("Entry Type"), types);
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("entry-type"));
+ TQStringList types;
+ types << TQString::tqfromLatin1("article") << TQString::tqfromLatin1("book")
+ << TQString::tqfromLatin1("booklet") << TQString::tqfromLatin1("inbook")
+ << TQString::tqfromLatin1("incollection") << TQString::tqfromLatin1("inproceedings")
+ << TQString::tqfromLatin1("manual") << TQString::tqfromLatin1("mastersthesis")
+ << TQString::tqfromLatin1("misc") << TQString::tqfromLatin1("phdthesis")
+ << TQString::tqfromLatin1("proceedings") << TQString::tqfromLatin1("techreport")
+ << TQString::tqfromLatin1("unpublished") << TQString::tqfromLatin1("periodical")
+ << TQString::tqfromLatin1("conference");
+ field = new Field(TQString::tqfromLatin1("entry-type"), i18n("Entry Type"), types);
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("entry-type"));
field->setCategory(i18n(bibtex_general));
field->setFlags(Field::AllowGrouped | Field::NoDelete);
field->setDescription(i18n("These entry types are specific to bibtex. See the bibtex documentation."));
list.append(field);
- field = new Field(QString::fromLatin1("author"), i18n("Author"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("author"));
+ field = new Field(TQString::tqfromLatin1("author"), i18n("Author"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("author"));
field->setCategory(i18n(bibtex_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("bibtex-key"), i18n("Bibtex Key"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("key"));
+ field = new Field(TQString::tqfromLatin1("bibtex-key"), i18n("Bibtex Key"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("key"));
field->setCategory(i18n("General"));
field->setFlags(Field::NoDelete);
list.append(field);
- field = new Field(QString::fromLatin1("booktitle"), i18n("Book Title"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("booktitle"));
+ field = new Field(TQString::tqfromLatin1("booktitle"), i18n("Book Title"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("booktitle"));
field->setCategory(i18n(bibtex_general));
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("editor"), i18n("Editor"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("editor"));
+ field = new Field(TQString::tqfromLatin1("editor"), i18n("Editor"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("editor"));
field->setCategory(i18n(bibtex_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("organization"), i18n("Organization"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("organization"));
+ field = new Field(TQString::tqfromLatin1("organization"), i18n("Organization"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("organization"));
field->setCategory(i18n(bibtex_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
-// field = new Field(QString::fromLatin1("institution"), i18n("Institution"));
-// field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("institution"));
+// field = new Field(TQString::tqfromLatin1("institution"), i18n("Institution"));
+// field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("institution"));
// field->setCategory(i18n(bibtex_general));
// field->setFlags(Field::AllowDelete);
// field->setFormatFlag(Field::FormatTitle);
// list.append(field);
/******************* Publishing ****************************/
- field = new Field(QString::fromLatin1("publisher"), i18n("Publisher"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("publisher"));
+ field = new Field(TQString::tqfromLatin1("publisher"), i18n("Publisher"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("publisher"));
field->setCategory(i18n(bibtex_publishing));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("address"), i18n("Address"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("address"));
+ field = new Field(TQString::tqfromLatin1("address"), i18n("Address"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("address"));
field->setCategory(i18n(bibtex_publishing));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("edition"), i18n("Edition"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("edition"));
+ field = new Field(TQString::tqfromLatin1("edition"), i18n("Edition"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("edition"));
field->setCategory(i18n(bibtex_publishing));
field->setFlags(Field::AllowCompletion);
list.append(field);
// don't make it a nuumber, it could have latex processing commands in it
- field = new Field(QString::fromLatin1("pages"), i18n("Pages"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("pages"));
+ field = new Field(TQString::tqfromLatin1("pages"), i18n("Pages"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("pages"));
field->setCategory(i18n(bibtex_publishing));
list.append(field);
- field = new Field(QString::fromLatin1("year"), i18n("Year"), Field::Number);
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("year"));
+ field = new Field(TQString::tqfromLatin1("year"), i18n("Year"), Field::Number);
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("year"));
field->setCategory(i18n(bibtex_publishing));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("isbn"), i18n("ISBN#"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("isbn"));
+ field = new Field(TQString::tqfromLatin1("isbn"), i18n("ISBN#"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("isbn"));
field->setCategory(i18n(bibtex_publishing));
field->setDescription(i18n("International Standard Book Number"));
list.append(field);
- field = new Field(QString::fromLatin1("journal"), i18n("Journal"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("journal"));
+ field = new Field(TQString::tqfromLatin1("journal"), i18n("Journal"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("journal"));
field->setCategory(i18n(bibtex_publishing));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("doi"), i18n("DOI"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("doi"));
+ field = new Field(TQString::tqfromLatin1("doi"), i18n("DOI"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("doi"));
field->setCategory(i18n(bibtex_publishing));
field->setDescription(i18n("Digital Object Identifier"));
list.append(field);
// could make this a string list, but since bibtex import could have funky values
// keep it an editbox
- field = new Field(QString::fromLatin1("month"), i18n("Month"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("month"));
+ field = new Field(TQString::tqfromLatin1("month"), i18n("Month"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("month"));
field->setCategory(i18n(bibtex_publishing));
field->setFlags(Field::AllowCompletion);
list.append(field);
- field = new Field(QString::fromLatin1("number"), i18n("Number"), Field::Number);
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("number"));
+ field = new Field(TQString::tqfromLatin1("number"), i18n("Number"), Field::Number);
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("number"));
field->setCategory(i18n(bibtex_publishing));
list.append(field);
- field = new Field(QString::fromLatin1("howpublished"), i18n("How Published"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("howpublished"));
+ field = new Field(TQString::tqfromLatin1("howpublished"), i18n("How Published"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("howpublished"));
field->setCategory(i18n(bibtex_publishing));
list.append(field);
-// field = new Field(QString::fromLatin1("school"), i18n("School"));
-// field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("school"));
+// field = new Field(TQString::tqfromLatin1("school"), i18n("School"));
+// field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("school"));
// field->setCategory(i18n(bibtex_publishing));
// field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
// list.append(field);
/******************* Classification ****************************/
- field = new Field(QString::fromLatin1("chapter"), i18n("Chapter"), Field::Number);
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("chapter"));
+ field = new Field(TQString::tqfromLatin1("chapter"), i18n("Chapter"), Field::Number);
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("chapter"));
field->setCategory(i18n(bibtex_misc));
list.append(field);
- field = new Field(QString::fromLatin1("series"), i18n("Series"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("series"));
+ field = new Field(TQString::tqfromLatin1("series"), i18n("Series"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("series"));
field->setCategory(i18n(bibtex_misc));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("volume"), i18n("Volume"), Field::Number);
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("volume"));
+ field = new Field(TQString::tqfromLatin1("volume"), i18n("Volume"), Field::Number);
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("volume"));
field->setCategory(i18n(bibtex_misc));
list.append(field);
- field = new Field(QString::fromLatin1("crossref"), i18n("Cross-Reference"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("crossref"));
+ field = new Field(TQString::tqfromLatin1("crossref"), i18n("Cross-Reference"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("crossref"));
field->setCategory(i18n(bibtex_misc));
list.append(field);
-// field = new Field(QString::fromLatin1("annote"), i18n("Annotation"));
-// field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("annote"));
+// field = new Field(TQString::tqfromLatin1("annote"), i18n("Annotation"));
+// field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("annote"));
// field->setCategory(i18n(bibtex_misc));
// list.append(field);
- field = new Field(QString::fromLatin1("keyword"), i18n("Keywords"));
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("keywords"));
+ field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords"));
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("keywords"));
field->setCategory(i18n(bibtex_misc));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("url"), i18n("URL"), Field::URL);
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("url"));
+ field = new Field(TQString::tqfromLatin1("url"), i18n("URL"), Field::URL);
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("url"));
field->setCategory(i18n(bibtex_misc));
list.append(field);
- field = new Field(QString::fromLatin1("abstract"), i18n("Abstract"), Data::Field::Para);
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("abstract"));
+ field = new Field(TQString::tqfromLatin1("abstract"), i18n("Abstract"), Data::Field::Para);
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("abstract"));
list.append(field);
- field = new Field(QString::fromLatin1("note"), i18n("Notes"), Field::Para);
- field->setProperty(QString::fromLatin1("bibtex"), QString::fromLatin1("note"));
+ field = new Field(TQString::tqfromLatin1("note"), i18n("Notes"), Field::Para);
+ field->setProperty(TQString::tqfromLatin1("bibtex"), TQString::tqfromLatin1("note"));
list.append(field);
return list;
@@ -248,7 +248,7 @@ bool BibtexCollection::addField(FieldPtr field_) {
// myDebug() << "BibtexCollection::addField()" << endl;
bool success = Collection::addField(field_);
if(success) {
- QString bibtex = field_->property(QString::fromLatin1("bibtex"));
+ TQString bibtex = field_->property(TQString::tqfromLatin1("bibtex"));
if(!bibtex.isEmpty()) {
m_bibtexFieldDict.insert(bibtex, field_);
}
@@ -263,13 +263,13 @@ bool BibtexCollection::modifyField(FieldPtr newField_) {
// myDebug() << "BibtexCollection::modifyField()" << endl;
bool success = Collection::modifyField(newField_);
FieldPtr oldField = fieldByName(newField_->name());
- QString oldBibtex = oldField->property(QString::fromLatin1("bibtex"));
- QString newBibtex = newField_->property(QString::fromLatin1("bibtex"));
+ TQString oldBibtex = oldField->property(TQString::tqfromLatin1("bibtex"));
+ TQString newBibtex = newField_->property(TQString::tqfromLatin1("bibtex"));
if(!oldBibtex.isEmpty()) {
success &= m_bibtexFieldDict.remove(oldBibtex);
}
if(!newBibtex.isEmpty()) {
- oldField->setProperty(QString::fromLatin1("bibtex"), newBibtex);
+ oldField->setProperty(TQString::tqfromLatin1("bibtex"), newBibtex);
m_bibtexFieldDict.insert(newBibtex, oldField);
}
return success;
@@ -281,42 +281,42 @@ bool BibtexCollection::deleteField(FieldPtr field_, bool force_) {
}
// myDebug() << "BibtexCollection::deleteField()" << endl;
bool success = true;
- QString bibtex = field_->property(QString::fromLatin1("bibtex"));
+ TQString bibtex = field_->property(TQString::tqfromLatin1("bibtex"));
if(!bibtex.isEmpty()) {
success &= m_bibtexFieldDict.remove(bibtex);
}
return success && Collection::removeField(field_, force_);
}
-Tellico::Data::FieldPtr BibtexCollection::fieldByBibtexName(const QString& bibtex_) const {
- return m_bibtexFieldDict.isEmpty() ? 0 : m_bibtexFieldDict.find(bibtex_);
+Tellico::Data::FieldPtr BibtexCollection::fieldByBibtexName(const TQString& bibtex_) const {
+ return m_bibtexFieldDict.isEmpty() ? 0 : m_bibtexFieldDict.tqfind(bibtex_);
}
// same as BookCollection::sameEntry()
int BibtexCollection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const {
// equal isbn's or lccn's are easy, give it a weight of 100
- if(Entry::compareValues(entry1_, entry2_, QString::fromLatin1("isbn"), this) > 0 ||
- Entry::compareValues(entry1_, entry2_, QString::fromLatin1("lccn"), this) > 0 ||
- Entry::compareValues(entry1_, entry2_, QString::fromLatin1("doi"), this) > 0 ||
- Entry::compareValues(entry1_, entry2_, QString::fromLatin1("pmid"), this) > 0 ||
- Entry::compareValues(entry1_, entry2_, QString::fromLatin1("arxiv"), this) > 0) {
+ if(Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("isbn"), this) > 0 ||
+ Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("lccn"), this) > 0 ||
+ Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("doi"), this) > 0 ||
+ Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("pmid"), this) > 0 ||
+ Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("arxiv"), this) > 0) {
return 100; // good match
}
- int res = 3*Entry::compareValues(entry1_, entry2_, QString::fromLatin1("title"), this);
+ int res = 3*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("title"), this);
// if(res == 0) {
// myDebug() << "BookCollection::sameEntry() - different titles for " << entry1_->title() << " vs. "
// << entry2_->title() << endl;
// }
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("author"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("cr_year"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("pub_year"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("binding"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("author"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("cr_year"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("pub_year"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("binding"), this);
return res;
}
// static
Tellico::Data::CollPtr BibtexCollection::convertBookCollection(CollPtr coll_) {
- const QString bibtex = QString::fromLatin1("bibtex");
+ const TQString bibtex = TQString::tqfromLatin1("bibtex");
KSharedPtr<BibtexCollection> coll = new BibtexCollection(false, coll_->title());
FieldVec fields = coll_->fields();
for(FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) {
@@ -329,7 +329,7 @@ Tellico::Data::CollPtr BibtexCollection::convertBookCollection(CollPtr coll_) {
}
// be sure to set bibtex property before adding it though
- QString name = field->name();
+ TQString name = field->name();
// this first group has bibtex field names the same as their own field name
if(name == Latin1Literal("title")
|| name == Latin1Literal("author")
@@ -344,17 +344,17 @@ Tellico::Data::CollPtr BibtexCollection::convertBookCollection(CollPtr coll_) {
|| name == Latin1Literal("series")) {
field->setProperty(bibtex, name);
} else if(name == Latin1Literal("series_num")) {
- field->setProperty(bibtex, QString::fromLatin1("number"));
+ field->setProperty(bibtex, TQString::tqfromLatin1("number"));
} else if(name == Latin1Literal("pur_price")) {
- field->setProperty(bibtex, QString::fromLatin1("price"));
+ field->setProperty(bibtex, TQString::tqfromLatin1("price"));
} else if(name == Latin1Literal("cr_year")) {
- field->setProperty(bibtex, QString::fromLatin1("year"));
+ field->setProperty(bibtex, TQString::tqfromLatin1("year"));
} else if(name == Latin1Literal("bibtex-id")) {
- field->setProperty(bibtex, QString::fromLatin1("key"));
+ field->setProperty(bibtex, TQString::tqfromLatin1("key"));
} else if(name == Latin1Literal("keyword")) {
- field->setProperty(bibtex, QString::fromLatin1("keywords"));
+ field->setProperty(bibtex, TQString::tqfromLatin1("keywords"));
} else if(name == Latin1Literal("comments")) {
- field->setProperty(bibtex, QString::fromLatin1("note"));
+ field->setProperty(bibtex, TQString::tqfromLatin1("note"));
}
coll->addField(field);
}
@@ -365,15 +365,15 @@ Tellico::Data::CollPtr BibtexCollection::convertBookCollection(CollPtr coll_) {
if(!coll->hasField(it->name()) && (it->flags() & Field::NoDelete)) {
// but don't add a Bibtex Key if there's already a bibtex-id
if(it->property(bibtex) != Latin1Literal("key")
- || !coll->hasField(QString::fromLatin1("bibtex-id"))) {
+ || !coll->hasField(TQString::tqfromLatin1("bibtex-id"))) {
coll->addField(it);
}
}
}
// set the entry-type to book
- FieldPtr field = coll->fieldByBibtexName(QString::fromLatin1("entry-type"));
- QString entryTypeName;
+ FieldPtr field = coll->fieldByBibtexName(TQString::tqfromLatin1("entry-type"));
+ TQString entryTypeName;
if(field) {
entryTypeName = field->name();
} else {
@@ -385,7 +385,7 @@ Tellico::Data::CollPtr BibtexCollection::convertBookCollection(CollPtr coll_) {
Data::EntryPtr entry = new Entry(*entryIt);
entry->setCollection(coll.data());
if(!entryTypeName.isEmpty()) {
- entry->setField(entryTypeName, QString::fromLatin1("book"));
+ entry->setField(entryTypeName, TQString::tqfromLatin1("book"));
}
newEntries.append(entry);
}
diff --git a/src/collections/bibtexcollection.h b/src/collections/bibtexcollection.h
index 628cc37..2752063 100644
--- a/src/collections/bibtexcollection.h
+++ b/src/collections/bibtexcollection.h
@@ -29,6 +29,7 @@ namespace Tellico {
*/
class BibtexCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -37,7 +38,7 @@ public:
* @param addFields A boolean indicating whether the default attributes should be added
* @param title The title of the collection
*/
- BibtexCollection(bool addFields, const QString& title = QString::null);
+ BibtexCollection(bool addFields, const TQString& title = TQString());
/**
*/
virtual ~BibtexCollection() {}
@@ -47,12 +48,12 @@ public:
virtual bool modifyField(FieldPtr field);
virtual bool deleteField(FieldPtr field, bool force=false);
- FieldPtr fieldByBibtexName(const QString& name) const;
- const QString& preamble() const { return m_preamble; }
- void setPreamble(const QString& preamble) { m_preamble = preamble; }
+ FieldPtr fieldByBibtexName(const TQString& name) const;
+ const TQString& preamble() const { return m_preamble; }
+ void setPreamble(const TQString& preamble) { m_preamble = preamble; }
const StringMap& macroList() const { return m_macros; }
void setMacroList(StringMap map) { m_macros = map; }
- void addMacro(const QString& key, const QString& value) { m_macros.insert(key, value); }
+ void addMacro(const TQString& key, const TQString& value) { m_macros.insert(key, value); }
virtual int sameEntry(Data::EntryPtr entry1, Data::EntryPtr entry2) const;
@@ -60,8 +61,8 @@ public:
static CollPtr convertBookCollection(CollPtr coll);
private:
- QDict<Field> m_bibtexFieldDict;
- QString m_preamble;
+ TQDict<Field> m_bibtexFieldDict;
+ TQString m_preamble;
StringMap m_macros;
};
diff --git a/src/collections/boardgamecollection.cpp b/src/collections/boardgamecollection.cpp
index 4899e0e..ac7fe69 100644
--- a/src/collections/boardgamecollection.cpp
+++ b/src/collections/boardgamecollection.cpp
@@ -22,87 +22,87 @@ namespace {
using Tellico::Data::BoardGameCollection;
-BoardGameCollection::BoardGameCollection(bool addFields_, const QString& title_ /*=null*/)
+BoardGameCollection::BoardGameCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Board Games") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("genre"));
+ setDefaultGroupField(TQString::tqfromLatin1("genre"));
}
Tellico::Data::FieldVec BoardGameCollection::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Title"));
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Title"));
field->setCategory(i18n(boardgame_general));
field->setFlags(Field::NoDelete);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("genre"), i18n("Genre"));
+ field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre"));
field->setCategory(i18n(boardgame_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("mechanism"), i18n("Mechanism"));
+ field = new Field(TQString::tqfromLatin1("mechanism"), i18n("Mechanism"));
field->setCategory(i18n(boardgame_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("year"), i18n("Release Year"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("year"), i18n("Release Year"), Field::Number);
field->setCategory(i18n(boardgame_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("publisher"), i18n("Publisher"));
+ field = new Field(TQString::tqfromLatin1("publisher"), i18n("Publisher"));
field->setCategory(i18n(boardgame_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("designer"), i18n("Designer"));
+ field = new Field(TQString::tqfromLatin1("designer"), i18n("Designer"));
field->setCategory(i18n(boardgame_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("num-player"), i18n("Number of Players"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("num-player"), i18n("Number of Players"), Field::Number);
field->setCategory(i18n(boardgame_general));
field->setFlags(Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("description"), i18n("Description"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("description"), i18n("Description"), Field::Para);
list.append(field);
- field = new Field(QString::fromLatin1("rating"), i18n("Rating"), Field::Rating);
+ field = new Field(TQString::tqfromLatin1("rating"), i18n("Rating"), Field::Rating);
field->setCategory(i18n(boardgame_personal));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("pur_date"), i18n("Purchase Date"));
+ field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date"));
field->setCategory(i18n(boardgame_personal));
field->setFormatFlag(Field::FormatDate);
list.append(field);
- field = new Field(QString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool);
field->setCategory(i18n(boardgame_personal));
list.append(field);
- field = new Field(QString::fromLatin1("pur_price"), i18n("Purchase Price"));
+ field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price"));
field->setCategory(i18n(boardgame_personal));
list.append(field);
- field = new Field(QString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool);
field->setCategory(i18n(boardgame_personal));
list.append(field);
- field = new Field(QString::fromLatin1("cover"), i18n("Cover"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("cover"), i18n("Cover"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("comments"), i18n("Comments"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para);
field->setCategory(i18n(boardgame_personal));
list.append(field);
diff --git a/src/collections/boardgamecollection.h b/src/collections/boardgamecollection.h
index 642fc31..1b2ed35 100644
--- a/src/collections/boardgamecollection.h
+++ b/src/collections/boardgamecollection.h
@@ -24,6 +24,7 @@ namespace Tellico {
*/
class BoardGameCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -32,7 +33,7 @@ public:
* @param addFields Whether to add the default attributes
* @param title The title of the collection
*/
- BoardGameCollection(bool addFields, const QString& title = QString::null);
+ BoardGameCollection(bool addFields, const TQString& title = TQString());
virtual Type type() const { return BoardGame; }
diff --git a/src/collections/bookcollection.cpp b/src/collections/bookcollection.cpp
index 0137156..21c5d90 100644
--- a/src/collections/bookcollection.cpp
+++ b/src/collections/bookcollection.cpp
@@ -24,157 +24,157 @@ namespace {
using Tellico::Data::BookCollection;
-BookCollection::BookCollection(bool addFields_, const QString& title_ /*=null*/)
+BookCollection::BookCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Books") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("author"));
+ setDefaultGroupField(TQString::tqfromLatin1("author"));
}
Tellico::Data::FieldVec BookCollection::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Title"));
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Title"));
field->setCategory(i18n("General"));
field->setFlags(Field::NoDelete);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("subtitle"), i18n("Subtitle"));
+ field = new Field(TQString::tqfromLatin1("subtitle"), i18n("Subtitle"));
field->setCategory(i18n(book_general));
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("author"), i18n("Author"));
+ field = new Field(TQString::tqfromLatin1("author"), i18n("Author"));
field->setCategory(i18n(book_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("editor"), i18n("Editor"));
+ field = new Field(TQString::tqfromLatin1("editor"), i18n("Editor"));
field->setCategory(i18n(book_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- QStringList binding;
+ TQStringList binding;
binding << i18n("Hardback") << i18n("Paperback") << i18n("Trade Paperback")
<< i18n("E-Book") << i18n("Magazine") << i18n("Journal");
- field = new Field(QString::fromLatin1("binding"), i18n("Binding"), binding);
+ field = new Field(TQString::tqfromLatin1("binding"), i18n("Binding"), binding);
field->setCategory(i18n(book_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("pur_date"), i18n("Purchase Date"));
+ field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date"));
field->setCategory(i18n(book_general));
field->setFormatFlag(Field::FormatDate);
list.append(field);
- field = new Field(QString::fromLatin1("pur_price"), i18n("Purchase Price"));
+ field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price"));
field->setCategory(i18n(book_general));
list.append(field);
- field = new Field(QString::fromLatin1("publisher"), i18n("Publisher"));
+ field = new Field(TQString::tqfromLatin1("publisher"), i18n("Publisher"));
field->setCategory(i18n(book_publishing));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("edition"), i18n("Edition"));
+ field = new Field(TQString::tqfromLatin1("edition"), i18n("Edition"));
field->setCategory(i18n(book_publishing));
field->setFlags(Field::AllowCompletion);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("cr_year"), i18n("Copyright Year"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("cr_year"), i18n("Copyright Year"), Field::Number);
field->setCategory(i18n(book_publishing));
field->setFlags(Field::AllowGrouped | Field::AllowMultiple);
list.append(field);
- field = new Field(QString::fromLatin1("pub_year"), i18n("Publication Year"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("pub_year"), i18n("Publication Year"), Field::Number);
field->setCategory(i18n(book_publishing));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("isbn"), i18n("ISBN#"));
+ field = new Field(TQString::tqfromLatin1("isbn"), i18n("ISBN#"));
field->setCategory(i18n(book_publishing));
field->setDescription(i18n("International Standard Book Number"));
list.append(field);
- field = new Field(QString::fromLatin1("lccn"), i18n("LCCN#"));
+ field = new Field(TQString::tqfromLatin1("lccn"), i18n("LCCN#"));
field->setCategory(i18n(book_publishing));
field->setDescription(i18n("Library of Congress Control Number"));
list.append(field);
- field = new Field(QString::fromLatin1("pages"), i18n("Pages"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("pages"), i18n("Pages"), Field::Number);
field->setCategory(i18n(book_publishing));
list.append(field);
- field = new Field(QString::fromLatin1("translator"), i18n("Translator"));
+ field = new Field(TQString::tqfromLatin1("translator"), i18n("Translator"));
field->setCategory(i18n(book_publishing));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("language"), i18n("Language"));
+ field = new Field(TQString::tqfromLatin1("language"), i18n("Language"));
field->setCategory(i18n(book_publishing));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple);
list.append(field);
- field = new Field(QString::fromLatin1("genre"), i18n("Genre"));
+ field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre"));
field->setCategory(i18n(book_classification));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
// in document versions < 3, this was "keywords" and not "keyword"
// but the title didn't change, only the name
- field = new Field(QString::fromLatin1("keyword"), i18n("Keywords"));
+ field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords"));
field->setCategory(i18n(book_classification));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("series"), i18n("Series"));
+ field = new Field(TQString::tqfromLatin1("series"), i18n("Series"));
field->setCategory(i18n(book_classification));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("series_num"), i18n("Series Number"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("series_num"), i18n("Series Number"), Field::Number);
field->setCategory(i18n(book_classification));
list.append(field);
- QStringList cond;
+ TQStringList cond;
cond << i18n("New") << i18n("Used");
- field = new Field(QString::fromLatin1("condition"), i18n("Condition"), cond);
+ field = new Field(TQString::tqfromLatin1("condition"), i18n("Condition"), cond);
field->setCategory(i18n(book_classification));
list.append(field);
- field = new Field(QString::fromLatin1("signed"), i18n("Signed"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("signed"), i18n("Signed"), Field::Bool);
field->setCategory(i18n(book_personal));
list.append(field);
- field = new Field(QString::fromLatin1("read"), i18n("Read"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("read"), i18n("Read"), Field::Bool);
field->setCategory(i18n(book_personal));
list.append(field);
- field = new Field(QString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool);
field->setCategory(i18n(book_personal));
list.append(field);
- field = new Field(QString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool);
field->setCategory(i18n(book_personal));
list.append(field);
- field = new Field(QString::fromLatin1("rating"), i18n("Rating"), Field::Rating);
+ field = new Field(TQString::tqfromLatin1("rating"), i18n("Rating"), Field::Rating);
field->setCategory(i18n(book_personal));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("cover"), i18n("Front Cover"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("comments"), i18n("Comments"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para);
field->setCategory(i18n(book_personal));
list.append(field);
@@ -183,19 +183,19 @@ Tellico::Data::FieldVec BookCollection::defaultFields() {
int BookCollection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const {
// equal isbn's or lccn's are easy, give it a weight of 100
- if(Entry::compareValues(entry1_, entry2_, QString::fromLatin1("isbn"), this) > 0 ||
- Entry::compareValues(entry1_, entry2_, QString::fromLatin1("lccn"), this) > 0) {
+ if(Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("isbn"), this) > 0 ||
+ Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("lccn"), this) > 0) {
return 100; // good match
}
- int res = 3*Entry::compareValues(entry1_, entry2_, QString::fromLatin1("title"), this);
+ int res = 3*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("title"), this);
// if(res == 0) {
// myDebug() << "BookCollection::sameEntry() - different titles for " << entry1_->title() << " vs. "
// << entry2_->title() << endl;
// }
- res += 2*Entry::compareValues(entry1_, entry2_, QString::fromLatin1("author"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("cr_year"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("pub_year"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("binding"), this);
+ res += 2*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("author"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("cr_year"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("pub_year"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("binding"), this);
return res;
}
diff --git a/src/collections/bookcollection.h b/src/collections/bookcollection.h
index 0236dd6..0ccc58b 100644
--- a/src/collections/bookcollection.h
+++ b/src/collections/bookcollection.h
@@ -53,6 +53,7 @@ namespace Tellico {
*/
class BookCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -61,7 +62,7 @@ public:
* @param addFields Whether to add the default attributes
* @param title The title of the collection
*/
- BookCollection(bool addFields, const QString& title = QString::null);
+ BookCollection(bool addFields, const TQString& title = TQString());
virtual Type type() const { return Book; }
virtual int sameEntry(Data::EntryPtr entry1, Data::EntryPtr entry2) const;
diff --git a/src/collections/cardcollection.cpp b/src/collections/cardcollection.cpp
index c29ad7f..815f5f9 100644
--- a/src/collections/cardcollection.cpp
+++ b/src/collections/cardcollection.cpp
@@ -22,97 +22,97 @@ namespace {
using Tellico::Data::CardCollection;
-CardCollection::CardCollection(bool addFields_, const QString& title_ /*=null*/)
+CardCollection::CardCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Cards") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("series"));
+ setDefaultGroupField(TQString::tqfromLatin1("series"));
}
Tellico::Data::FieldVec CardCollection::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Title"), Field::Dependent);
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Title"), Field::Dependent);
field->setCategory(i18n(card_general));
- field->setDescription(QString::fromLatin1("%{year} %{brand} %{player}"));
+ field->setDescription(TQString::tqfromLatin1("%{year} %{brand} %{player}"));
field->setFlags(Field::NoDelete);
list.append(field);
- field = new Field(QString::fromLatin1("player"), i18n("Player"));
+ field = new Field(TQString::tqfromLatin1("player"), i18n("Player"));
field->setCategory(i18n(card_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("team"), i18n("Team"));
+ field = new Field(TQString::tqfromLatin1("team"), i18n("Team"));
field->setCategory(i18n(card_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("brand"), i18n("Brand"));
+ field = new Field(TQString::tqfromLatin1("brand"), i18n("Brand"));
field->setCategory(i18n(card_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
// might not be totally numeric!
- field = new Field(QString::fromLatin1("number"), i18n("Card Number"));
+ field = new Field(TQString::tqfromLatin1("number"), i18n("Card Number"));
field->setCategory(i18n(card_general));
list.append(field);
- field = new Field(QString::fromLatin1("year"), i18n("Year"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("year"), i18n("Year"), Field::Number);
field->setCategory(i18n(card_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("series"), i18n("Series"));
+ field = new Field(TQString::tqfromLatin1("series"), i18n("Series"));
field->setCategory(i18n(card_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("type"), i18n("Card Type"));
+ field = new Field(TQString::tqfromLatin1("type"), i18n("Card Type"));
field->setCategory(i18n(card_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("pur_date"), i18n("Purchase Date"));
+ field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date"));
field->setCategory(i18n(card_personal));
field->setFormatFlag(Field::FormatDate);
list.append(field);
- field = new Field(QString::fromLatin1("pur_price"), i18n("Purchase Price"));
+ field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price"));
field->setCategory(i18n(card_personal));
list.append(field);
- field = new Field(QString::fromLatin1("location"), i18n("Location"));
+ field = new Field(TQString::tqfromLatin1("location"), i18n("Location"));
field->setCategory(i18n(card_personal));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool);
field->setCategory(i18n(card_personal));
list.append(field);
- field = new Field(QString::fromLatin1("keyword"), i18n("Keywords"));
+ field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords"));
field->setCategory(i18n(card_personal));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("quantity"), i18n("Quantity"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("quantity"), i18n("Quantity"), Field::Number);
field->setCategory(i18n(card_personal));
list.append(field);
- field = new Field(QString::fromLatin1("front"), i18n("Front Image"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("front"), i18n("Front Image"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("back"), i18n("Back Image"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("back"), i18n("Back Image"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("comments"), i18n("Comments"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para);
list.append(field);
return list;
diff --git a/src/collections/cardcollection.h b/src/collections/cardcollection.h
index 61fd2b0..cd9b3ee 100644
--- a/src/collections/cardcollection.h
+++ b/src/collections/cardcollection.h
@@ -29,6 +29,7 @@ namespace Tellico {
*/
class CardCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -37,7 +38,7 @@ public:
* @param addFields A boolean indicating whether the default attributes should be added
* @param title The title of the collection
*/
- CardCollection(bool addFields, const QString& title = QString::null);
+ CardCollection(bool addFields, const TQString& title = TQString());
virtual Type type() const { return Card; }
diff --git a/src/collections/coincollection.cpp b/src/collections/coincollection.cpp
index 1cd2ec0..d3a7e01 100644
--- a/src/collections/coincollection.cpp
+++ b/src/collections/coincollection.cpp
@@ -22,59 +22,59 @@ namespace {
using Tellico::Data::CoinCollection;
-CoinCollection::CoinCollection(bool addFields_, const QString& title_ /*=null*/)
+CoinCollection::CoinCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Coins") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("denomination"));
+ setDefaultGroupField(TQString::tqfromLatin1("denomination"));
}
Tellico::Data::FieldVec CoinCollection::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Title"), Field::Dependent);
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Title"), Field::Dependent);
field->setCategory(i18n(coin_general));
// not i18n()
- field->setDescription(QString::fromLatin1("%{year}%{mintmark} %{type} %{denomination}"));
+ field->setDescription(TQString::tqfromLatin1("%{year}%{mintmark} %{type} %{denomination}"));
field->setFlags(Field::NoDelete);
list.append(field);
- field = new Field(QString::fromLatin1("type"), i18n("Type"));
+ field = new Field(TQString::tqfromLatin1("type"), i18n("Type"));
field->setCategory(i18n(coin_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
/* TRANSLATORS: denomination refers to the monetary value. */
- field = new Field(QString::fromLatin1("denomination"), i18n("Denomination"));
+ field = new Field(TQString::tqfromLatin1("denomination"), i18n("Denomination"));
field->setCategory(i18n(coin_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("year"), i18n("Year"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("year"), i18n("Year"), Field::Number);
field->setCategory(i18n(coin_general));
field->setFlags(Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("mintmark"), i18n("Mint Mark"));
+ field = new Field(TQString::tqfromLatin1("mintmark"), i18n("Mint Mark"));
field->setCategory(i18n(coin_general));
field->setFlags(Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("country"), i18n("Country"));
+ field = new Field(TQString::tqfromLatin1("country"), i18n("Country"));
field->setCategory(i18n(coin_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("set"), i18n("Coin Set"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("set"), i18n("Coin Set"), Field::Bool);
field->setCategory(i18n(coin_general));
list.append(field);
- QStringList grade = QStringList::split(QRegExp(QString::fromLatin1("\\s*,\\s*")),
+ TQStringList grade = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")),
i18n("Coin grade levels - "
"Proof-65,Proof-60,Mint State-65,Mint State-60,"
"Almost Uncirculated-55,Almost Uncirculated-50,"
@@ -85,47 +85,47 @@ Tellico::Data::FieldVec CoinCollection::defaultFields() {
"Extremely Fine-40,Very Fine-30,Very Fine-20,Fine-12,"
"Very Good-8,Good-4,Fair"),
false);
- field = new Field(QString::fromLatin1("grade"), i18n("Grade"), grade);
+ field = new Field(TQString::tqfromLatin1("grade"), i18n("Grade"), grade);
field->setCategory(i18n(coin_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- QStringList service = QStringList::split(QRegExp(QString::fromLatin1("\\s*,\\s*")),
+ TQStringList service = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")),
i18n("Coin grading services - "
"PCGS,NGC,ANACS,ICG,ASA,PCI",
"PCGS,NGC,ANACS,ICG,ASA,PCI"),
false);
- field = new Field(QString::fromLatin1("service"), i18n("Grading Service"), service);
+ field = new Field(TQString::tqfromLatin1("service"), i18n("Grading Service"), service);
field->setCategory(i18n(coin_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("pur_date"), i18n("Purchase Date"));
+ field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date"));
field->setCategory(i18n(coin_personal));
field->setFormatFlag(Field::FormatDate);
list.append(field);
- field = new Field(QString::fromLatin1("pur_price"), i18n("Purchase Price"));
+ field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price"));
field->setCategory(i18n(coin_personal));
list.append(field);
- field = new Field(QString::fromLatin1("location"), i18n("Location"));
+ field = new Field(TQString::tqfromLatin1("location"), i18n("Location"));
field->setCategory(i18n(coin_personal));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool);
field->setCategory(i18n(coin_personal));
list.append(field);
- field = new Field(QString::fromLatin1("obverse"), i18n("Obverse"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("obverse"), i18n("Obverse"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("reverse"), i18n("Reverse"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("reverse"), i18n("Reverse"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("comments"), i18n("Comments"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para);
field->setCategory(i18n(coin_personal));
list.append(field);
diff --git a/src/collections/coincollection.h b/src/collections/coincollection.h
index d22937d..cd6beb9 100644
--- a/src/collections/coincollection.h
+++ b/src/collections/coincollection.h
@@ -29,6 +29,7 @@ namespace Tellico {
*/
class CoinCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -37,7 +38,7 @@ public:
* @param addFields Whether to add the default attributes
* @param title The title of the collection
*/
- CoinCollection(bool addFields, const QString& title = QString::null);
+ CoinCollection(bool addFields, const TQString& title = TQString());
virtual Type type() const { return Coin; }
diff --git a/src/collections/comicbookcollection.cpp b/src/collections/comicbookcollection.cpp
index 30e1ef0..36e31a4 100644
--- a/src/collections/comicbookcollection.cpp
+++ b/src/collections/comicbookcollection.cpp
@@ -24,130 +24,130 @@ namespace {
using Tellico::Data::ComicBookCollection;
-ComicBookCollection::ComicBookCollection(bool addFields_, const QString& title_ /*=null*/)
+ComicBookCollection::ComicBookCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Comic Books") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("series"));
+ setDefaultGroupField(TQString::tqfromLatin1("series"));
}
Tellico::Data::FieldVec ComicBookCollection::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Title"));
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Title"));
field->setCategory(i18n(comic_general));
field->setFlags(Field::NoDelete);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("subtitle"), i18n("Subtitle"));
+ field = new Field(TQString::tqfromLatin1("subtitle"), i18n("Subtitle"));
field->setCategory(i18n(comic_general));
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("writer"), i18n("Writer"));
+ field = new Field(TQString::tqfromLatin1("writer"), i18n("Writer"));
field->setCategory(i18n(comic_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("artist"), i18n("Comic Book Illustrator", "Artist"));
+ field = new Field(TQString::tqfromLatin1("artist"), i18n("Comic Book Illustrator", "Artist"));
field->setCategory(i18n(comic_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("series"), i18n("Series"));
+ field = new Field(TQString::tqfromLatin1("series"), i18n("Series"));
field->setCategory(i18n(comic_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("issue"), i18n("Issue"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("issue"), i18n("Issue"), Field::Number);
field->setCategory(i18n(comic_general));
field->setFlags(Field::AllowMultiple);
list.append(field);
- field = new Field(QString::fromLatin1("publisher"), i18n("Publisher"));
+ field = new Field(TQString::tqfromLatin1("publisher"), i18n("Publisher"));
field->setCategory(i18n(comic_publishing));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("edition"), i18n("Edition"));
+ field = new Field(TQString::tqfromLatin1("edition"), i18n("Edition"));
field->setCategory(i18n(comic_publishing));
field->setFlags(Field::AllowCompletion);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("pub_year"), i18n("Publication Year"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("pub_year"), i18n("Publication Year"), Field::Number);
field->setCategory(i18n(comic_publishing));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("pages"), i18n("Pages"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("pages"), i18n("Pages"), Field::Number);
field->setCategory(i18n(comic_publishing));
list.append(field);
- field = new Field(QString::fromLatin1("country"), i18n("Country"));
+ field = new Field(TQString::tqfromLatin1("country"), i18n("Country"));
field->setCategory(i18n(comic_publishing));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("language"), i18n("Language"));
+ field = new Field(TQString::tqfromLatin1("language"), i18n("Language"));
field->setCategory(i18n(comic_publishing));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("genre"), i18n("Genre"));
+ field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre"));
field->setCategory(i18n(comic_classification));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("keyword"), i18n("Keywords"));
+ field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords"));
field->setCategory(i18n(comic_classification));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
- QStringList cond = QStringList::split(QRegExp(QString::fromLatin1("\\s*,\\s*")),
+ TQStringList cond = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")),
i18n("Comic book grade levels - "
"Mint,Near Mint,Very Fine,Fine,Very Good,Good,Fair,Poor",
"Mint,Near Mint,Very Fine,Fine,Very Good,Good,Fair,Poor"),
false);
- field = new Field(QString::fromLatin1("condition"), i18n("Condition"), cond);
+ field = new Field(TQString::tqfromLatin1("condition"), i18n("Condition"), cond);
field->setCategory(i18n(comic_classification));
list.append(field);
- field = new Field(QString::fromLatin1("pur_date"), i18n("Purchase Date"));
+ field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date"));
field->setCategory(i18n(comic_personal));
field->setFormatFlag(Field::FormatDate);
list.append(field);
- field = new Field(QString::fromLatin1("pur_price"), i18n("Purchase Price"));
+ field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price"));
field->setCategory(i18n(comic_personal));
list.append(field);
- field = new Field(QString::fromLatin1("signed"), i18n("Signed"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("signed"), i18n("Signed"), Field::Bool);
field->setCategory(i18n(comic_personal));
list.append(field);
- field = new Field(QString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool);
field->setCategory(i18n(comic_personal));
list.append(field);
- field = new Field(QString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool);
field->setCategory(i18n(comic_personal));
list.append(field);
- field = new Field(QString::fromLatin1("cover"), i18n("Front Cover"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("comments"), i18n("Comments"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para);
field->setCategory(i18n(comic_personal));
list.append(field);
diff --git a/src/collections/comicbookcollection.h b/src/collections/comicbookcollection.h
index 36302c2..707b19d 100644
--- a/src/collections/comicbookcollection.h
+++ b/src/collections/comicbookcollection.h
@@ -29,6 +29,7 @@ namespace Tellico {
*/
class ComicBookCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -36,7 +37,7 @@ public:
*
* @param title The title of the collection
*/
- ComicBookCollection(bool addFields, const QString& title = QString::null);
+ ComicBookCollection(bool addFields, const TQString& title = TQString());
virtual Type type() const { return ComicBook; }
diff --git a/src/collections/filecatalog.cpp b/src/collections/filecatalog.cpp
index 8d375be..cf67e2d 100644
--- a/src/collections/filecatalog.cpp
+++ b/src/collections/filecatalog.cpp
@@ -21,82 +21,82 @@ namespace {
using Tellico::Data::FileCatalog;
-FileCatalog::FileCatalog(bool addFields_, const QString& title_ /*=null*/)
+FileCatalog::FileCatalog(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Files") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("volume"));
+ setDefaultGroupField(TQString::tqfromLatin1("volume"));
}
Tellico::Data::FieldVec FileCatalog::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Name"));
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Name"));
field->setCategory(i18n(file_general));
field->setFlags(Field::NoDelete);
list.append(field);
- field = new Field(QString::fromLatin1("url"), i18n("URL"), Field::URL);
+ field = new Field(TQString::tqfromLatin1("url"), i18n("URL"), Field::URL);
field->setCategory(i18n(file_general));
list.append(field);
- field = new Field(QString::fromLatin1("description"), i18n("Description"));
+ field = new Field(TQString::tqfromLatin1("description"), i18n("Description"));
field->setCategory(i18n(file_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("volume"), i18n("Volume"));
+ field = new Field(TQString::tqfromLatin1("volume"), i18n("Volume"));
field->setCategory(i18n(file_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("folder"), i18n("Folder"));
+ field = new Field(TQString::tqfromLatin1("folder"), i18n("Folder"));
field->setCategory(i18n(file_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("mimetype"), i18n("Mimetype"));
+ field = new Field(TQString::tqfromLatin1("mimetype"), i18n("Mimetype"));
field->setCategory(i18n(file_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("size"), i18n("Size"));
+ field = new Field(TQString::tqfromLatin1("size"), i18n("Size"));
field->setCategory(i18n(file_general));
list.append(field);
- field = new Field(QString::fromLatin1("permissions"), i18n("Permissions"));
+ field = new Field(TQString::tqfromLatin1("permissions"), i18n("Permissions"));
field->setCategory(i18n(file_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("owner"), i18n("Owner"));
+ field = new Field(TQString::tqfromLatin1("owner"), i18n("Owner"));
field->setCategory(i18n(file_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("group"), i18n("Group"));
+ field = new Field(TQString::tqfromLatin1("group"), i18n("Group"));
field->setCategory(i18n(file_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
// these dates are string fields, not dates, since the time is included
- field = new Field(QString::fromLatin1("created"), i18n("Created"));
+ field = new Field(TQString::tqfromLatin1("created"), i18n("Created"));
field->setCategory(i18n(file_general));
list.append(field);
- field = new Field(QString::fromLatin1("modified"), i18n("Modified"));
+ field = new Field(TQString::tqfromLatin1("modified"), i18n("Modified"));
field->setCategory(i18n(file_general));
list.append(field);
- field = new Field(QString::fromLatin1("metainfo"), i18n("Meta Info"), Field::Table);
- field->setProperty(QString::fromLatin1("columns"), QChar('2'));
- field->setProperty(QString::fromLatin1("column1"), i18n("Property"));
- field->setProperty(QString::fromLatin1("column2"), i18n("Value"));
+ field = new Field(TQString::tqfromLatin1("metainfo"), i18n("Meta Info"), Field::Table);
+ field->setProperty(TQString::tqfromLatin1("columns"), TQChar('2'));
+ field->setProperty(TQString::tqfromLatin1("column1"), i18n("Property"));
+ field->setProperty(TQString::tqfromLatin1("column2"), i18n("Value"));
list.append(field);
- field = new Field(QString::fromLatin1("icon"), i18n("Icon"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("icon"), i18n("Icon"), Field::Image);
list.append(field);
return list;
diff --git a/src/collections/filecatalog.h b/src/collections/filecatalog.h
index aa7a82c..73951e7 100644
--- a/src/collections/filecatalog.h
+++ b/src/collections/filecatalog.h
@@ -24,9 +24,10 @@ namespace Tellico {
*/
class FileCatalog : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
- FileCatalog(bool addFields, const QString& title = QString::null);
+ FileCatalog(bool addFields, const TQString& title = TQString());
virtual Type type() const { return File; }
diff --git a/src/collections/gamecollection.cpp b/src/collections/gamecollection.cpp
index b93176f..d218247 100644
--- a/src/collections/gamecollection.cpp
+++ b/src/collections/gamecollection.cpp
@@ -22,101 +22,101 @@ namespace {
using Tellico::Data::GameCollection;
-GameCollection::GameCollection(bool addFields_, const QString& title_ /*=null*/)
+GameCollection::GameCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Games") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("platform"));
+ setDefaultGroupField(TQString::tqfromLatin1("platform"));
}
Tellico::Data::FieldVec GameCollection::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Title"));
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Title"));
field->setCategory(i18n(game_general));
field->setFlags(Field::NoDelete);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- QStringList platform;
+ TQStringList platform;
platform << i18n("Xbox 360") << i18n("Xbox")
<< i18n("PlayStation3") << i18n("PlayStation2") << i18n("PlayStation") << i18n("PlayStation Portable", "PSP")
<< i18n("Nintendo Wii") << i18n("Nintendo DS") << i18n("GameCube") << i18n("Dreamcast")
<< i18n("Game Boy Advance") << i18n("Game Boy Color") << i18n("Game Boy")
<< i18n("Windows Platform", "Windows") << i18n("Mac OS") << i18n("Linux");
- field = new Field(QString::fromLatin1("platform"), i18n("Platform"), platform);
+ field = new Field(TQString::tqfromLatin1("platform"), i18n("Platform"), platform);
field->setCategory(i18n(game_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("genre"), i18n("Genre"));
+ field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre"));
field->setCategory(i18n(game_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("year"), i18n("Release Year"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("year"), i18n("Release Year"), Field::Number);
field->setCategory(i18n(game_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("publisher"), i18n("Games - Publisher", "Publisher"));
+ field = new Field(TQString::tqfromLatin1("publisher"), i18n("Games - Publisher", "Publisher"));
field->setCategory(i18n(game_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("developer"), i18n("Developer"));
+ field = new Field(TQString::tqfromLatin1("developer"), i18n("Developer"));
field->setCategory(i18n(game_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- QStringList cert = QStringList::split(QRegExp(QString::fromLatin1("\\s*,\\s*")),
+ TQStringList cert = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")),
i18n("Video game ratings - "
"Unrated, Adults Only, Mature, Teen, Everyone, Early Childhood, Pending",
"Unrated, Adults Only, Mature, Teen, Everyone, Early Childhood, Pending"),
false);
- field = new Field(QString::fromLatin1("certification"), i18n("ESRB Rating"), cert);
+ field = new Field(TQString::tqfromLatin1("certification"), i18n("ESRB Rating"), cert);
field->setCategory(i18n(game_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("description"), i18n("Description"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("description"), i18n("Description"), Field::Para);
list.append(field);
- field = new Field(QString::fromLatin1("rating"), i18n("Personal Rating"), Field::Rating);
+ field = new Field(TQString::tqfromLatin1("rating"), i18n("Personal Rating"), Field::Rating);
field->setCategory(i18n(game_personal));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("completed"), i18n("Completed"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("completed"), i18n("Completed"), Field::Bool);
field->setCategory(i18n(game_personal));
list.append(field);
- field = new Field(QString::fromLatin1("pur_date"), i18n("Purchase Date"));
+ field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date"));
field->setCategory(i18n(game_personal));
field->setFormatFlag(Field::FormatDate);
list.append(field);
- field = new Field(QString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool);
field->setCategory(i18n(game_personal));
list.append(field);
- field = new Field(QString::fromLatin1("pur_price"), i18n("Purchase Price"));
+ field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price"));
field->setCategory(i18n(game_personal));
list.append(field);
- field = new Field(QString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool);
field->setCategory(i18n(game_personal));
list.append(field);
- field = new Field(QString::fromLatin1("cover"), i18n("Cover"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("cover"), i18n("Cover"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("comments"), i18n("Comments"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para);
field->setCategory(i18n(game_personal));
list.append(field);
diff --git a/src/collections/gamecollection.h b/src/collections/gamecollection.h
index 7d6ce92..0b08373 100644
--- a/src/collections/gamecollection.h
+++ b/src/collections/gamecollection.h
@@ -24,6 +24,7 @@ namespace Tellico {
*/
class GameCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -32,7 +33,7 @@ public:
* @param addFields Whether to add the default attributes
* @param title The title of the collection
*/
- GameCollection(bool addFields, const QString& title = QString::null);
+ GameCollection(bool addFields, const TQString& title = TQString());
virtual Type type() const { return Game; }
diff --git a/src/collections/musiccollection.cpp b/src/collections/musiccollection.cpp
index d3c0445..fde5a04 100644
--- a/src/collections/musiccollection.cpp
+++ b/src/collections/musiccollection.cpp
@@ -22,93 +22,93 @@ namespace {
using Tellico::Data::MusicCollection;
-MusicCollection::MusicCollection(bool addFields_, const QString& title_ /*=null*/)
+MusicCollection::MusicCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Music") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("artist"));
+ setDefaultGroupField(TQString::tqfromLatin1("artist"));
}
Tellico::Data::FieldVec MusicCollection::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Album"));
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Album"));
field->setCategory(i18n(music_general));
field->setFlags(Field::NoDelete | Field::AllowCompletion);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- QStringList media;
+ TQStringList media;
media << i18n("Compact Disc") << i18n("DVD") << i18n("Cassette") << i18n("Vinyl");
- field = new Field(QString::fromLatin1("medium"), i18n("Medium"), media);
+ field = new Field(TQString::tqfromLatin1("medium"), i18n("Medium"), media);
field->setCategory(i18n(music_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("artist"), i18n("Artist"));
+ field = new Field(TQString::tqfromLatin1("artist"), i18n("Artist"));
field->setCategory(i18n(music_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple);
field->setFormatFlag(Field::FormatTitle); // don't use FormatName
list.append(field);
- field = new Field(QString::fromLatin1("label"), i18n("Label"));
+ field = new Field(TQString::tqfromLatin1("label"), i18n("Label"));
field->setCategory(i18n(music_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped | Field::AllowMultiple);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("year"), i18n("Year"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("year"), i18n("Year"), Field::Number);
field->setCategory(i18n(music_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("genre"), i18n("Genre"));
+ field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre"));
field->setCategory(i18n(music_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("track"), i18n("Tracks"), Field::Table);
+ field = new Field(TQString::tqfromLatin1("track"), i18n("Tracks"), Field::Table);
field->setFormatFlag(Field::FormatTitle);
- field->setProperty(QString::fromLatin1("columns"), QChar('3'));
- field->setProperty(QString::fromLatin1("column1"), i18n("Title"));
- field->setProperty(QString::fromLatin1("column2"), i18n("Artist"));
- field->setProperty(QString::fromLatin1("column3"), i18n("Length"));
+ field->setProperty(TQString::tqfromLatin1("columns"), TQChar('3'));
+ field->setProperty(TQString::tqfromLatin1("column1"), i18n("Title"));
+ field->setProperty(TQString::tqfromLatin1("column2"), i18n("Artist"));
+ field->setProperty(TQString::tqfromLatin1("column3"), i18n("Length"));
list.append(field);
- field = new Field(QString::fromLatin1("rating"), i18n("Rating"), Field::Rating);
+ field = new Field(TQString::tqfromLatin1("rating"), i18n("Rating"), Field::Rating);
field->setCategory(i18n(music_personal));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("pur_date"), i18n("Purchase Date"));
+ field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date"));
field->setCategory(i18n(music_personal));
field->setFormatFlag(Field::FormatDate);
list.append(field);
- field = new Field(QString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool);
field->setCategory(i18n(music_personal));
list.append(field);
- field = new Field(QString::fromLatin1("pur_price"), i18n("Purchase Price"));
+ field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price"));
field->setCategory(i18n(music_personal));
list.append(field);
- field = new Field(QString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool);
field->setCategory(i18n(music_personal));
list.append(field);
- field = new Field(QString::fromLatin1("keyword"), i18n("Keywords"));
+ field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords"));
field->setCategory(i18n(music_personal));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("cover"), i18n("Cover"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("cover"), i18n("Cover"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("comments"), i18n("Comments"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para);
field->setCategory(i18n(music_personal));
list.append(field);
@@ -117,15 +117,15 @@ Tellico::Data::FieldVec MusicCollection::defaultFields() {
int MusicCollection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const {
// not enough for title to be equal, must also have another field
- int res = 2*Entry::compareValues(entry1_, entry2_, QString::fromLatin1("title"), this);
+ int res = 2*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("title"), this);
// if(res == 0) {
// myDebug() << "MusicCollection::sameEntry() - different titles for " << entry1_->title() << " vs. "
// << entry2_->title() << endl;
// }
- res += 2*Entry::compareValues(entry1_, entry2_, QString::fromLatin1("artist"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("year"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("label"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("medium"), this);
+ res += 2*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("artist"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("year"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("label"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("medium"), this);
return res;
}
diff --git a/src/collections/musiccollection.h b/src/collections/musiccollection.h
index ddada5b..32cfa4c 100644
--- a/src/collections/musiccollection.h
+++ b/src/collections/musiccollection.h
@@ -34,6 +34,7 @@ namespace Tellico {
*/
class MusicCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -42,7 +43,7 @@ public:
* @param addFields Whether to add the default attributes
* @param title The title of the collection
*/
- MusicCollection(bool addFields, const QString& title = QString::null);
+ MusicCollection(bool addFields, const TQString& title = TQString());
virtual Type type() const { return Album; }
virtual int sameEntry(Data::EntryPtr, Data::EntryPtr) const;
diff --git a/src/collections/stampcollection.cpp b/src/collections/stampcollection.cpp
index c26da9a..f5b8e0c 100644
--- a/src/collections/stampcollection.cpp
+++ b/src/collections/stampcollection.cpp
@@ -23,108 +23,108 @@ namespace {
using Tellico::Data::StampCollection;
-StampCollection::StampCollection(bool addFields_, const QString& title_ /*=null*/)
+StampCollection::StampCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Stamps") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("denomination"));
+ setDefaultGroupField(TQString::tqfromLatin1("denomination"));
}
Tellico::Data::FieldVec StampCollection::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Title"), Field::Dependent);
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Title"), Field::Dependent);
field->setCategory(i18n(stamp_general));
- field->setDescription(QString::fromLatin1("%{year} %{description} %{denomination}"));
+ field->setDescription(TQString::tqfromLatin1("%{year} %{description} %{denomination}"));
field->setFlags(Field::NoDelete);
list.append(field);
- field = new Field(QString::fromLatin1("description"), i18n("Description"));
+ field = new Field(TQString::tqfromLatin1("description"), i18n("Description"));
field->setCategory(i18n(stamp_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- field = new Field(QString::fromLatin1("denomination"), i18n("Denomination"));
+ field = new Field(TQString::tqfromLatin1("denomination"), i18n("Denomination"));
field->setCategory(i18n(stamp_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("country"), i18n("Country"));
+ field = new Field(TQString::tqfromLatin1("country"), i18n("Country"));
field->setCategory(i18n(stamp_general));
field->setFormatFlag(Field::FormatPlain);
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("year"), i18n("Issue Year"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("year"), i18n("Issue Year"), Field::Number);
field->setCategory(i18n(stamp_general));
field->setFlags(Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("color"), i18n("Color"));
+ field = new Field(TQString::tqfromLatin1("color"), i18n("Color"));
field->setCategory(i18n(stamp_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("scott"), i18n("Scott#"));
+ field = new Field(TQString::tqfromLatin1("scott"), i18n("Scott#"));
field->setCategory(i18n(stamp_general));
list.append(field);
- QStringList grade = QStringList::split(QRegExp(QString::fromLatin1("\\s*,\\s*")),
+ TQStringList grade = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")),
i18n("Stamp grade levels - "
"Superb,Extremely Fine,Very Fine,Fine,Average,Poor",
"Superb,Extremely Fine,Very Fine,Fine,Average,Poor"),
false);
- field = new Field(QString::fromLatin1("grade"), i18n("Grade"), grade);
+ field = new Field(TQString::tqfromLatin1("grade"), i18n("Grade"), grade);
field->setCategory(i18n(stamp_condition));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("cancelled"), i18n("Cancelled"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("cancelled"), i18n("Cancelled"), Field::Bool);
field->setCategory(i18n(stamp_condition));
list.append(field);
/* TRANSLATORS: See http://en.wikipedia.org/wiki/Stamp_hinge */
- field = new Field(QString::fromLatin1("hinged"), i18n("Hinged"));
+ field = new Field(TQString::tqfromLatin1("hinged"), i18n("Hinged"));
field->setCategory(i18n(stamp_condition));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("centering"), i18n("Centering"));
+ field = new Field(TQString::tqfromLatin1("centering"), i18n("Centering"));
field->setCategory(i18n(stamp_condition));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("gummed"), i18n("Gummed"));
+ field = new Field(TQString::tqfromLatin1("gummed"), i18n("Gummed"));
field->setCategory(i18n(stamp_condition));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("pur_date"), i18n("Purchase Date"));
+ field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date"));
field->setCategory(i18n(stamp_personal));
field->setFormatFlag(Field::FormatDate);
list.append(field);
- field = new Field(QString::fromLatin1("pur_price"), i18n("Purchase Price"));
+ field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price"));
field->setCategory(i18n(stamp_personal));
list.append(field);
- field = new Field(QString::fromLatin1("location"), i18n("Location"));
+ field = new Field(TQString::tqfromLatin1("location"), i18n("Location"));
field->setCategory(i18n(stamp_personal));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool);
field->setCategory(i18n(stamp_personal));
list.append(field);
- field = new Field(QString::fromLatin1("image"), i18n("Image"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("image"), i18n("Image"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("comments"), i18n("Comments"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para);
list.append(field);
return list;
diff --git a/src/collections/stampcollection.h b/src/collections/stampcollection.h
index 8b81623..5a5def9 100644
--- a/src/collections/stampcollection.h
+++ b/src/collections/stampcollection.h
@@ -46,6 +46,7 @@ namespace Tellico {
*/
class StampCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -54,7 +55,7 @@ public:
* @param addFields A boolean indicating whether the default attributes should be added
* @param title The title of the collection
*/
- StampCollection(bool addFields, const QString& title = QString::null);
+ StampCollection(bool addFields, const TQString& title = TQString());
virtual Type type() const { return Stamp; }
diff --git a/src/collections/videocollection.cpp b/src/collections/videocollection.cpp
index ad83b5f..d8ac081 100644
--- a/src/collections/videocollection.cpp
+++ b/src/collections/videocollection.cpp
@@ -24,53 +24,53 @@ namespace {
using Tellico::Data::VideoCollection;
-VideoCollection::VideoCollection(bool addFields_, const QString& title_ /*=null*/)
+VideoCollection::VideoCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Videos") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("genre"));
+ setDefaultGroupField(TQString::tqfromLatin1("genre"));
}
Tellico::Data::FieldVec VideoCollection::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Title"));
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Title"));
field->setCategory(i18n("General"));
field->setFlags(Field::NoDelete);
field->setFormatFlag(Field::FormatTitle);
list.append(field);
- QStringList media;
+ TQStringList media;
media << i18n("DVD") << i18n("VHS") << i18n("VCD") << i18n("DivX") << i18n("Blu-ray") << i18n("HD DVD");
- field = new Field(QString::fromLatin1("medium"), i18n("Medium"), media);
+ field = new Field(TQString::tqfromLatin1("medium"), i18n("Medium"), media);
field->setCategory(i18n(video_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("year"), i18n("Production Year"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("year"), i18n("Production Year"), Field::Number);
field->setCategory(i18n(video_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- QStringList cert = QStringList::split(QRegExp(QString::fromLatin1("\\s*,\\s*")),
+ TQStringList cert = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")),
i18n("Movie ratings - "
"G (USA),PG (USA),PG-13 (USA),R (USA), U (USA)",
"G (USA),PG (USA),PG-13 (USA),R (USA), U (USA)"),
false);
- field = new Field(QString::fromLatin1("certification"), i18n("Certification"), cert);
+ field = new Field(TQString::tqfromLatin1("certification"), i18n("Certification"), cert);
field->setCategory(i18n(video_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("genre"), i18n("Genre"));
+ field = new Field(TQString::tqfromLatin1("genre"), i18n("Genre"));
field->setCategory(i18n(video_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- QStringList region;
+ TQStringList region;
region << i18n("Region 1")
<< i18n("Region 2")
<< i18n("Region 3")
@@ -79,140 +79,140 @@ Tellico::Data::FieldVec VideoCollection::defaultFields() {
<< i18n("Region 6")
<< i18n("Region 7")
<< i18n("Region 8");
- field = new Field(QString::fromLatin1("region"), i18n("Region"), region);
+ field = new Field(TQString::tqfromLatin1("region"), i18n("Region"), region);
field->setCategory(i18n(video_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("nationality"), i18n("Nationality"));
+ field = new Field(TQString::tqfromLatin1("nationality"), i18n("Nationality"));
field->setCategory(i18n(video_general));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- QStringList format;
+ TQStringList format;
format << i18n("NTSC") << i18n("PAL") << i18n("SECAM");
- field = new Field(QString::fromLatin1("format"), i18n("Format"), format);
+ field = new Field(TQString::tqfromLatin1("format"), i18n("Format"), format);
field->setCategory(i18n(video_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("cast"), i18n("Cast"), Field::Table);
- field->setProperty(QString::fromLatin1("columns"), QChar('2'));
- field->setProperty(QString::fromLatin1("column1"), i18n("Actor/Actress"));
- field->setProperty(QString::fromLatin1("column2"), i18n("Role"));
+ field = new Field(TQString::tqfromLatin1("cast"), i18n("Cast"), Field::Table);
+ field->setProperty(TQString::tqfromLatin1("columns"), TQChar('2'));
+ field->setProperty(TQString::tqfromLatin1("column1"), i18n("Actor/Actress"));
+ field->setProperty(TQString::tqfromLatin1("column2"), i18n("Role"));
field->setFormatFlag(Field::FormatName);
field->setFlags(Field::AllowGrouped);
field->setDescription(i18n("A table for the cast members, along with the roles they play"));
list.append(field);
- field = new Field(QString::fromLatin1("director"), i18n("Director"));
+ field = new Field(TQString::tqfromLatin1("director"), i18n("Director"));
field->setCategory(i18n(video_people));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("producer"), i18n("Producer"));
+ field = new Field(TQString::tqfromLatin1("producer"), i18n("Producer"));
field->setCategory(i18n(video_people));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("writer"), i18n("Writer"));
+ field = new Field(TQString::tqfromLatin1("writer"), i18n("Writer"));
field->setCategory(i18n(video_people));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("composer"), i18n("Composer"));
+ field = new Field(TQString::tqfromLatin1("composer"), i18n("Composer"));
field->setCategory(i18n(video_people));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatName);
list.append(field);
- field = new Field(QString::fromLatin1("studio"), i18n("Studio"));
+ field = new Field(TQString::tqfromLatin1("studio"), i18n("Studio"));
field->setCategory(i18n(video_people));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("language"), i18n("Language Tracks"));
+ field = new Field(TQString::tqfromLatin1("language"), i18n("Language Tracks"));
field->setCategory(i18n(video_features));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("subtitle"), i18n("Subtitle Languages"));
+ field = new Field(TQString::tqfromLatin1("subtitle"), i18n("Subtitle Languages"));
field->setCategory(i18n(video_features));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("audio-track"), i18n("Audio Tracks"));
+ field = new Field(TQString::tqfromLatin1("audio-track"), i18n("Audio Tracks"));
field->setCategory(i18n(video_features));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("running-time"), i18n("Running Time"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("running-time"), i18n("Running Time"), Field::Number);
field->setCategory(i18n(video_features));
field->setDescription(i18n("The running time of the video (in minutes)"));
list.append(field);
- field = new Field(QString::fromLatin1("aspect-ratio"), i18n("Aspect Ratio"));
+ field = new Field(TQString::tqfromLatin1("aspect-ratio"), i18n("Aspect Ratio"));
field->setCategory(i18n(video_features));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("widescreen"), i18n("Widescreen"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("widescreen"), i18n("Widescreen"), Field::Bool);
field->setCategory(i18n(video_features));
list.append(field);
- QStringList color;
+ TQStringList color;
color << i18n("Color") << i18n("Black & White");
- field = new Field(QString::fromLatin1("color"), i18n("Color Mode"), color);
+ field = new Field(TQString::tqfromLatin1("color"), i18n("Color Mode"), color);
field->setCategory(i18n(video_features));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("directors-cut"), i18n("Director's Cut"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("directors-cut"), i18n("Director's Cut"), Field::Bool);
field->setCategory(i18n(video_features));
list.append(field);
- field = new Field(QString::fromLatin1("plot"), i18n("Plot Summary"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("plot"), i18n("Plot Summary"), Field::Para);
list.append(field);
- field = new Field(QString::fromLatin1("rating"), i18n("Personal Rating"), Field::Rating);
+ field = new Field(TQString::tqfromLatin1("rating"), i18n("Personal Rating"), Field::Rating);
field->setCategory(i18n(video_personal));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("pur_date"), i18n("Purchase Date"));
+ field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date"));
field->setCategory(i18n(video_personal));
field->setFormatFlag(Field::FormatDate);
list.append(field);
- field = new Field(QString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool);
field->setCategory(i18n(video_personal));
list.append(field);
- field = new Field(QString::fromLatin1("pur_price"), i18n("Purchase Price"));
+ field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price"));
field->setCategory(i18n(video_personal));
list.append(field);
- field = new Field(QString::fromLatin1("loaned"), i18n("Loaned"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("loaned"), i18n("Loaned"), Field::Bool);
field->setCategory(i18n(video_personal));
list.append(field);
- field = new Field(QString::fromLatin1("keyword"), i18n("Keywords"));
+ field = new Field(TQString::tqfromLatin1("keyword"), i18n("Keywords"));
field->setCategory(i18n(video_personal));
field->setFlags(Field::AllowCompletion | Field::AllowMultiple | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("cover"), i18n("Cover"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("cover"), i18n("Cover"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("comments"), i18n("Comments"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para);
list.append(field);
return list;
@@ -221,15 +221,15 @@ Tellico::Data::FieldVec VideoCollection::defaultFields() {
int VideoCollection::sameEntry(Data::EntryPtr entry1_, Data::EntryPtr entry2_) const {
// not enough for title to be equal, must also have another field
// ever possible for a studio to do two movies with identical titles?
- int res = 3*Entry::compareValues(entry1_, entry2_, QString::fromLatin1("title"), this);
+ int res = 3*Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("title"), this);
// if(res == 0) {
// myDebug() << "VideoCollection::sameEntry() - different titles for " << entry1_->title() << " vs. "
// << entry2_->title() << endl;
// }
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("year"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("director"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("studio"), this);
- res += Entry::compareValues(entry1_, entry2_, QString::fromLatin1("medium"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("year"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("director"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("studio"), this);
+ res += Entry::compareValues(entry1_, entry2_, TQString::tqfromLatin1("medium"), this);
return res;
}
diff --git a/src/collections/videocollection.h b/src/collections/videocollection.h
index 58f729c..a47814f 100644
--- a/src/collections/videocollection.h
+++ b/src/collections/videocollection.h
@@ -33,6 +33,7 @@ namespace Tellico {
*/
class VideoCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -41,7 +42,7 @@ public:
* @param addFields Whether to add the default attributes
* @param title The title of the collection
*/
- VideoCollection(bool addFields, const QString& title = QString::null);
+ VideoCollection(bool addFields, const TQString& title = TQString());
virtual Type type() const { return Video; }
virtual int sameEntry(Data::EntryPtr, Data::EntryPtr) const;
diff --git a/src/collections/winecollection.cpp b/src/collections/winecollection.cpp
index 31bc5d0..bab7617 100644
--- a/src/collections/winecollection.cpp
+++ b/src/collections/winecollection.cpp
@@ -22,96 +22,96 @@ namespace {
using Tellico::Data::WineCollection;
-WineCollection::WineCollection(bool addFields_, const QString& title_ /*=null*/)
+WineCollection::WineCollection(bool addFields_, const TQString& title_ /*=null*/)
: Collection(title_.isEmpty() ? i18n("My Wines") : title_) {
if(addFields_) {
addFields(defaultFields());
}
- setDefaultGroupField(QString::fromLatin1("type"));
+ setDefaultGroupField(TQString::tqfromLatin1("type"));
}
Tellico::Data::FieldVec WineCollection::defaultFields() {
FieldVec list;
FieldPtr field;
- field = new Field(QString::fromLatin1("title"), i18n("Title"), Field::Dependent);
+ field = new Field(TQString::tqfromLatin1("title"), i18n("Title"), Field::Dependent);
field->setCategory(i18n(wine_general));
- field->setDescription(QString::fromLatin1("%{vintage} %{producer} %{varietal}"));
+ field->setDescription(TQString::tqfromLatin1("%{vintage} %{producer} %{varietal}"));
field->setFlags(Field::NoDelete);
list.append(field);
- field = new Field(QString::fromLatin1("producer"), i18n("Producer"));
+ field = new Field(TQString::tqfromLatin1("producer"), i18n("Producer"));
field->setCategory(i18n(wine_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("appellation"), i18n("Appellation"));
+ field = new Field(TQString::tqfromLatin1("appellation"), i18n("Appellation"));
field->setCategory(i18n(wine_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("varietal"), i18n("Varietal"));
+ field = new Field(TQString::tqfromLatin1("varietal"), i18n("Varietal"));
field->setCategory(i18n(wine_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("vintage"), i18n("Vintage"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("vintage"), i18n("Vintage"), Field::Number);
field->setCategory(i18n(wine_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- QStringList type;
+ TQStringList type;
type << i18n("Red Wine") << i18n("White Wine") << i18n("Sparkling Wine");
- field = new Field(QString::fromLatin1("type"), i18n("Type"), type);
+ field = new Field(TQString::tqfromLatin1("type"), i18n("Type"), type);
field->setCategory(i18n(wine_general));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("country"), i18n("Country"));
+ field = new Field(TQString::tqfromLatin1("country"), i18n("Country"));
field->setCategory(i18n(wine_general));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
field->setFormatFlag(Field::FormatPlain);
list.append(field);
- field = new Field(QString::fromLatin1("pur_date"), i18n("Purchase Date"));
+ field = new Field(TQString::tqfromLatin1("pur_date"), i18n("Purchase Date"));
field->setCategory(i18n(wine_personal));
field->setFormatFlag(Field::FormatDate);
list.append(field);
- field = new Field(QString::fromLatin1("pur_price"), i18n("Purchase Price"));
+ field = new Field(TQString::tqfromLatin1("pur_price"), i18n("Purchase Price"));
field->setCategory(i18n(wine_personal));
list.append(field);
- field = new Field(QString::fromLatin1("location"), i18n("Location"));
+ field = new Field(TQString::tqfromLatin1("location"), i18n("Location"));
field->setCategory(i18n(wine_personal));
field->setFlags(Field::AllowCompletion | Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("quantity"), i18n("Quantity"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("quantity"), i18n("Quantity"), Field::Number);
field->setCategory(i18n(wine_personal));
list.append(field);
- field = new Field(QString::fromLatin1("drink-by"), i18n("Drink By"), Field::Number);
+ field = new Field(TQString::tqfromLatin1("drink-by"), i18n("Drink By"), Field::Number);
field->setCategory(i18n(wine_personal));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("rating"), i18n("Rating"), Field::Rating);
+ field = new Field(TQString::tqfromLatin1("rating"), i18n("Rating"), Field::Rating);
field->setCategory(i18n(wine_personal));
field->setFlags(Field::AllowGrouped);
list.append(field);
- field = new Field(QString::fromLatin1("gift"), i18n("Gift"), Field::Bool);
+ field = new Field(TQString::tqfromLatin1("gift"), i18n("Gift"), Field::Bool);
field->setCategory(i18n(wine_personal));
list.append(field);
- field = new Field(QString::fromLatin1("label"), i18n("Label Image"), Field::Image);
+ field = new Field(TQString::tqfromLatin1("label"), i18n("Label Image"), Field::Image);
list.append(field);
- field = new Field(QString::fromLatin1("comments"), i18n("Comments"), Field::Para);
+ field = new Field(TQString::tqfromLatin1("comments"), i18n("Comments"), Field::Para);
list.append(field);
return list;
diff --git a/src/collections/winecollection.h b/src/collections/winecollection.h
index 236a9cd..6481930 100644
--- a/src/collections/winecollection.h
+++ b/src/collections/winecollection.h
@@ -34,6 +34,7 @@ namespace Tellico {
*/
class WineCollection : public Collection {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -42,7 +43,7 @@ public:
* @param addFields A boolean indicating whether the default attributes should be added
* @param title The title of the collection
*/
- WineCollection(bool addFields, const QString& title = QString::null);
+ WineCollection(bool addFields, const TQString& title = TQString());
virtual Type type() const { return Wine; }
diff --git a/src/commands/addentries.cpp b/src/commands/addentries.cpp
index 6cd7636..9460ebd 100644
--- a/src/commands/addentries.cpp
+++ b/src/commands/addentries.cpp
@@ -37,7 +37,7 @@ void AddEntries::execute() {
// now check for default values
Data::FieldVec fields = m_coll->fields();
for(Data::FieldVec::Iterator field = fields.begin(); field != fields.end(); ++field) {
- const QString defaultValue = field->defaultValue();
+ const TQString defaultValue = field->defaultValue();
if(!defaultValue.isEmpty()) {
for(Data::EntryVec::Iterator entry = m_entries.begin(); entry != m_entries.end(); ++entry) {
if(entry->field(field).isEmpty()) {
@@ -58,7 +58,7 @@ void AddEntries::unexecute() {
Controller::self()->removedEntries(m_entries);
}
-QString AddEntries::name() const {
+TQString AddEntries::name() const {
return m_entries.count() > 1 ? i18n("Add Entries")
- : i18n("Add (Entry Title)", "Add %1").arg(m_entries.begin()->title());
+ : i18n("Add (Entry Title)", "Add %1").tqarg(m_entries.begin()->title());
}
diff --git a/src/commands/addentries.h b/src/commands/addentries.h
index 54d8e29..12f6441 100644
--- a/src/commands/addentries.h
+++ b/src/commands/addentries.h
@@ -31,7 +31,7 @@ public:
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
Data::CollPtr m_coll;
diff --git a/src/commands/addloans.cpp b/src/commands/addloans.cpp
index dab67d7..8b9bc27 100644
--- a/src/commands/addloans.cpp
+++ b/src/commands/addloans.cpp
@@ -41,7 +41,7 @@ void AddLoans::execute() {
bool wasEmpty = m_borrower->isEmpty();
// if there's no loaned field, we'll add one
- bool loanExisted = m_loans.begin()->entry()->collection()->hasField(QString::fromLatin1("loaned"));
+ bool loanExisted = m_loans.begin()->entry()->collection()->hasField(TQString::tqfromLatin1("loaned"));
m_addedLoanField = false; // assume we didn't add the field yet
// add the loans to the borrower
@@ -54,7 +54,7 @@ void AddLoans::execute() {
}
if(!loanExisted) {
Data::CollPtr c = m_loans.begin()->entry()->collection();
- Data::FieldPtr f = c->fieldByName(QString::fromLatin1("loaned"));
+ Data::FieldPtr f = c->fieldByName(TQString::tqfromLatin1("loaned"));
if(f) {
// notify everything that a new field was added
Controller::self()->addedField(c, f);
@@ -89,7 +89,7 @@ void AddLoans::unexecute() {
}
if(m_addedLoanField) {
Data::CollPtr c = m_loans.begin()->entry()->collection();
- Data::FieldPtr f = c->fieldByName(QString::fromLatin1("loaned"));
+ Data::FieldPtr f = c->fieldByName(TQString::tqfromLatin1("loaned"));
if(f) {
c->removeField(f);
Controller::self()->removedField(c, f);
@@ -104,7 +104,7 @@ void AddLoans::unexecute() {
Controller::self()->modifiedBorrower(m_borrower);
}
-QString AddLoans::name() const {
+TQString AddLoans::name() const {
return m_loans.count() > 1 ? i18n("Check-out Items")
- : i18n("Check-out (Entry Title)", "Check-out %1").arg(m_loans.begin()->entry()->title());
+ : i18n("Check-out (Entry Title)", "Check-out %1").tqarg(m_loans.begin()->entry()->title());
}
diff --git a/src/commands/addloans.h b/src/commands/addloans.h
index b80cbc3..b0db3ae 100644
--- a/src/commands/addloans.h
+++ b/src/commands/addloans.h
@@ -32,7 +32,7 @@ public:
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
Data::BorrowerPtr m_borrower;
diff --git a/src/commands/collectioncommand.cpp b/src/commands/collectioncommand.cpp
index 8955ea0..3d4e354 100644
--- a/src/commands/collectioncommand.cpp
+++ b/src/commands/collectioncommand.cpp
@@ -104,7 +104,7 @@ void CollectionCommand::unexecute() {
}
}
-QString CollectionCommand::name() const {
+TQString CollectionCommand::name() const {
switch(m_mode) {
case Append:
return i18n("Append Collection");
@@ -114,7 +114,7 @@ QString CollectionCommand::name() const {
return i18n("Replace Collection");
}
// hush warnings
- return QString::null;
+ return TQString();
}
void CollectionCommand::copyFields() {
diff --git a/src/commands/collectioncommand.h b/src/commands/collectioncommand.h
index ad0b2f4..38b4cbf 100644
--- a/src/commands/collectioncommand.h
+++ b/src/commands/collectioncommand.h
@@ -38,7 +38,7 @@ public:
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
void copyFields();
diff --git a/src/commands/fieldcommand.cpp b/src/commands/fieldcommand.cpp
index 6902e15..5ba080b 100644
--- a/src/commands/fieldcommand.cpp
+++ b/src/commands/fieldcommand.cpp
@@ -98,15 +98,15 @@ void FieldCommand::unexecute() {
}
}
-QString FieldCommand::name() const {
+TQString FieldCommand::name() const {
switch(m_mode) {
case FieldAdd:
- return i18n("Add %1 Field").arg(m_activeField->title());
+ return i18n("Add %1 Field").tqarg(m_activeField->title());
case FieldModify:
- return i18n("Modify %1 Field").arg(m_activeField->title());
+ return i18n("Modify %1 Field").tqarg(m_activeField->title());
case FieldRemove:
- return i18n("Delete %1 Field").arg(m_activeField->title());
+ return i18n("Delete %1 Field").tqarg(m_activeField->title());
}
// hush warnings
- return QString::null;
+ return TQString();
}
diff --git a/src/commands/fieldcommand.h b/src/commands/fieldcommand.h
index 0e5706f..c01c4a0 100644
--- a/src/commands/fieldcommand.h
+++ b/src/commands/fieldcommand.h
@@ -37,7 +37,7 @@ public:
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
Mode m_mode;
diff --git a/src/commands/filtercommand.cpp b/src/commands/filtercommand.cpp
index ba205e5..c95db13 100644
--- a/src/commands/filtercommand.cpp
+++ b/src/commands/filtercommand.cpp
@@ -92,7 +92,7 @@ void FilterCommand::unexecute() {
}
}
-QString FilterCommand::name() const {
+TQString FilterCommand::name() const {
switch(m_mode) {
case FilterAdd:
return i18n("Add Filter");
@@ -102,5 +102,5 @@ QString FilterCommand::name() const {
return i18n("Delete Filter");
}
// hush warnings
- return QString::null;
+ return TQString();
}
diff --git a/src/commands/filtercommand.h b/src/commands/filtercommand.h
index 93aa629..ff7daab 100644
--- a/src/commands/filtercommand.h
+++ b/src/commands/filtercommand.h
@@ -37,7 +37,7 @@ public:
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
Mode m_mode;
diff --git a/src/commands/group.cpp b/src/commands/group.cpp
index fd9cd76..eca542e 100644
--- a/src/commands/group.cpp
+++ b/src/commands/group.cpp
@@ -15,7 +15,7 @@
using Tellico::Command::Group;
-QString Group::name() const {
+TQString Group::name() const {
if(m_commands.count() == 1) {
return m_commands.getFirst()->name();
}
diff --git a/src/commands/group.h b/src/commands/group.h
index dc87bf9..6b48d5f 100644
--- a/src/commands/group.h
+++ b/src/commands/group.h
@@ -25,9 +25,9 @@ namespace Tellico {
class Group : public KMacroCommand {
public:
- Group(const QString& name) : KMacroCommand(name) {}
+ Group(const TQString& name) : KMacroCommand(name) {}
- virtual QString name() const;
+ virtual TQString name() const;
bool isEmpty() const { return m_commands.count() == 0; }
};
diff --git a/src/commands/modifyentries.cpp b/src/commands/modifyentries.cpp
index 895348e..9d8712a 100644
--- a/src/commands/modifyentries.cpp
+++ b/src/commands/modifyentries.cpp
@@ -44,7 +44,7 @@ void ModifyEntries::execute() {
}
// loans expose a field named "loaned", and the user might modify that without
// checking in the loan, so verify that. Heavy-handed, yes...
- const QString loaned = QString::fromLatin1("loaned");
+ const TQString loaned = TQString::tqfromLatin1("loaned");
bool hasLoanField = m_coll->hasField(loaned);
for(Data::EntryVecIt entry = m_entries.begin(); hasLoanField && entry != m_entries.end(); ++entry) {
if(entry->field(loaned).isEmpty()) {
@@ -68,9 +68,9 @@ void ModifyEntries::unexecute() {
//TODO: need to tell edit dialog that it's not modified
}
-QString ModifyEntries::name() const {
+TQString ModifyEntries::name() const {
return m_entries.count() > 1 ? i18n("Modify Entries")
- : i18n("Modify (Entry Title)", "Modify %1").arg(m_entries.begin()->title());
+ : i18n("Modify (Entry Title)", "Modify %1").tqarg(m_entries.begin()->title());
}
void ModifyEntries::swapValues() {
diff --git a/src/commands/modifyentries.h b/src/commands/modifyentries.h
index 4dfbda1..cf0699c 100644
--- a/src/commands/modifyentries.h
+++ b/src/commands/modifyentries.h
@@ -31,7 +31,7 @@ public:
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
void swapValues();
diff --git a/src/commands/modifyloans.cpp b/src/commands/modifyloans.cpp
index f8976e4..ebddfbc 100644
--- a/src/commands/modifyloans.cpp
+++ b/src/commands/modifyloans.cpp
@@ -71,6 +71,6 @@ void ModifyLoans::unexecute() {
}
}
-QString ModifyLoans::name() const {
+TQString ModifyLoans::name() const {
return i18n("Modify Loan");
}
diff --git a/src/commands/modifyloans.h b/src/commands/modifyloans.h
index 6f531ce..8f9534a 100644
--- a/src/commands/modifyloans.h
+++ b/src/commands/modifyloans.h
@@ -31,7 +31,7 @@ public:
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
Data::LoanPtr m_oldLoan;
diff --git a/src/commands/removeentries.cpp b/src/commands/removeentries.cpp
index 8d77fb6..bf2676b 100644
--- a/src/commands/removeentries.cpp
+++ b/src/commands/removeentries.cpp
@@ -44,7 +44,7 @@ void RemoveEntries::unexecute() {
Controller::self()->addedEntries(m_entries);
}
-QString RemoveEntries::name() const {
+TQString RemoveEntries::name() const {
return m_entries.count() > 1 ? i18n("Delete Entries")
- : i18n("Delete (Entry Title)", "Delete %1").arg(m_entries.begin()->title());
+ : i18n("Delete (Entry Title)", "Delete %1").tqarg(m_entries.begin()->title());
}
diff --git a/src/commands/removeentries.h b/src/commands/removeentries.h
index 71c5ed4..6c77d9d 100644
--- a/src/commands/removeentries.h
+++ b/src/commands/removeentries.h
@@ -31,7 +31,7 @@ public:
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
Data::CollPtr m_coll;
diff --git a/src/commands/removeloans.cpp b/src/commands/removeloans.cpp
index 5ceadc9..7ee321b 100644
--- a/src/commands/removeloans.cpp
+++ b/src/commands/removeloans.cpp
@@ -75,7 +75,7 @@ void RemoveLoans::unexecute() {
}
}
-QString RemoveLoans::name() const {
+TQString RemoveLoans::name() const {
return m_loans.count() > 1 ? i18n("Check-in Entries")
- : i18n("Check-in (Entry Title)", "Check-in %1").arg(m_loans.begin()->entry()->title());
+ : i18n("Check-in (Entry Title)", "Check-in %1").tqarg(m_loans.begin()->entry()->title());
}
diff --git a/src/commands/removeloans.h b/src/commands/removeloans.h
index 5b578b7..e1c32ca 100644
--- a/src/commands/removeloans.h
+++ b/src/commands/removeloans.h
@@ -31,7 +31,7 @@ public:
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
Data::LoanVec m_loans;
diff --git a/src/commands/renamecollection.cpp b/src/commands/renamecollection.cpp
index b2fcc39..9aaf022 100644
--- a/src/commands/renamecollection.cpp
+++ b/src/commands/renamecollection.cpp
@@ -19,7 +19,7 @@
using Tellico::Command::RenameCollection;
-RenameCollection::RenameCollection(Data::CollPtr coll_, const QString& newTitle_)
+RenameCollection::RenameCollection(Data::CollPtr coll_, const TQString& newTitle_)
: KCommand()
, m_coll(coll_)
, m_newTitle(newTitle_)
@@ -41,6 +41,6 @@ void RenameCollection::unexecute() {
Data::Document::self()->renameCollection(m_oldTitle);
}
-QString RenameCollection::name() const {
+TQString RenameCollection::name() const {
return i18n("Rename Collection");
}
diff --git a/src/commands/renamecollection.h b/src/commands/renamecollection.h
index bdbb64c..501c290 100644
--- a/src/commands/renamecollection.h
+++ b/src/commands/renamecollection.h
@@ -26,16 +26,16 @@ namespace Tellico {
*/
class RenameCollection : public KCommand {
public:
- RenameCollection(Data::CollPtr coll, const QString& newTitle);
+ RenameCollection(Data::CollPtr coll, const TQString& newTitle);
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
Data::CollPtr m_coll;
- QString m_oldTitle;
- QString m_newTitle;
+ TQString m_oldTitle;
+ TQString m_newTitle;
};
} // end namespace
diff --git a/src/commands/reorderfields.cpp b/src/commands/reorderfields.cpp
index 0c9f7fe..cefb946 100644
--- a/src/commands/reorderfields.cpp
+++ b/src/commands/reorderfields.cpp
@@ -50,6 +50,6 @@ void ReorderFields::unexecute() {
Controller::self()->reorderedFields(m_coll);
}
-QString ReorderFields::name() const {
+TQString ReorderFields::name() const {
return i18n("Reorder Fields");
}
diff --git a/src/commands/reorderfields.h b/src/commands/reorderfields.h
index 6a59050..6fb553f 100644
--- a/src/commands/reorderfields.h
+++ b/src/commands/reorderfields.h
@@ -31,7 +31,7 @@ public:
virtual void execute();
virtual void unexecute();
- virtual QString name() const;
+ virtual TQString name() const;
private:
Data::CollPtr m_coll;
diff --git a/src/commands/updateentries.cpp b/src/commands/updateentries.cpp
index cb2f850..6b53102 100644
--- a/src/commands/updateentries.cpp
+++ b/src/commands/updateentries.cpp
@@ -37,7 +37,7 @@ public:
virtual void execute() {} // does nothing
virtual void unexecute() {} // does nothing
- virtual QString name() const { return QString(); }
+ virtual TQString name() const { return TQString(); }
Data::EntryPtr oldEntry() const { return m_oldEntry; }
private:
@@ -47,7 +47,7 @@ private:
}
UpdateEntries::UpdateEntries(Data::CollPtr coll_, Data::EntryPtr oldEntry_, Data::EntryPtr newEntry_, bool overWrite_)
- : Group(i18n("Modify (Entry Title)", "Modify %1").arg(newEntry_->title()))
+ : Group(i18n("Modify (Entry Title)", "Modify %1").tqarg(newEntry_->title()))
, m_coll(coll_)
, m_oldEntry(oldEntry_)
, m_newEntry(newEntry_)
@@ -61,7 +61,7 @@ void UpdateEntries::execute() {
// do this here instead of the constructor because several UpdateEntries may be in one command
// and I don't want to add new fields multiple times
- QPair<Data::FieldVec, Data::FieldVec> p = Kernel::self()->mergeFields(m_coll,
+ TQPair<Data::FieldVec, Data::FieldVec> p = Kernel::self()->mergeFields(m_coll,
m_newEntry->collection()->fields(),
m_newEntry);
Data::FieldVec modifiedFields = p.first;
diff --git a/src/configdialog.cpp b/src/configdialog.cpp
index e05766d..62b9945 100644
--- a/src/configdialog.cpp
+++ b/src/configdialog.cpp
@@ -45,23 +45,23 @@
#include <kfontcombo.h>
#include <kcolorcombo.h>
-#include <qsize.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qptrlist.h>
-#include <qpixmap.h>
-#include <qgrid.h>
-#include <qwhatsthis.h>
-#include <qregexp.h>
-#include <qhgroupbox.h>
-#include <qvgroupbox.h>
-#include <qpushbutton.h>
-#include <qvbox.h>
-#include <qhbox.h>
-#include <qfileinfo.h>
-#include <qradiobutton.h>
-#include <qvbuttongroup.h>
+#include <tqsize.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqptrlist.h>
+#include <tqpixmap.h>
+#include <tqgrid.h>
+#include <tqwhatsthis.h>
+#include <tqregexp.h>
+#include <tqhgroupbox.h>
+#include <tqvgroupbox.h>
+#include <tqpushbutton.h>
+#include <tqvbox.h>
+#include <tqhbox.h>
+#include <tqfileinfo.h>
+#include <tqradiobutton.h>
+#include <tqvbuttongroup.h>
namespace {
static const int CONFIG_MIN_WIDTH = 640;
@@ -71,21 +71,21 @@ namespace {
using Tellico::SourceListViewItem;
using Tellico::ConfigDialog;
-SourceListViewItem::SourceListViewItem(KListView* parent_, const GeneralFetcherInfo& info_,
- const QString& groupName_)
- : KListViewItem(parent_, info_.name), m_info(info_),
+SourceListViewItem::SourceListViewItem(KListView* tqparent_, const GeneralFetcherInfo& info_,
+ const TQString& groupName_)
+ : KListViewItem(tqparent_, info_.name), m_info(info_),
m_configGroup(groupName_), m_newSource(groupName_.isNull()), m_fetcher(0) {
- QPixmap pix = Fetch::Manager::fetcherIcon(info_.type);
+ TQPixmap pix = Fetch::Manager::fetcherIcon(info_.type);
if(!pix.isNull()) {
setPixmap(0, pix);
}
}
-SourceListViewItem::SourceListViewItem(KListView* parent_, QListViewItem* after_,
- const GeneralFetcherInfo& info_, const QString& groupName_)
- : KListViewItem(parent_, after_, info_.name), m_info(info_),
+SourceListViewItem::SourceListViewItem(KListView* tqparent_, TQListViewItem* after_,
+ const GeneralFetcherInfo& info_, const TQString& groupName_)
+ : KListViewItem(tqparent_, after_, info_.name), m_info(info_),
m_configGroup(groupName_), m_newSource(groupName_.isNull()), m_fetcher(0) {
- QPixmap pix = Fetch::Manager::fetcherIcon(info_.type);
+ TQPixmap pix = Fetch::Manager::fetcherIcon(info_.type);
if(!pix.isNull()) {
setPixmap(0, pix);
}
@@ -93,15 +93,15 @@ SourceListViewItem::SourceListViewItem(KListView* parent_, QListViewItem* after_
void SourceListViewItem::setFetcher(Fetch::Fetcher::Ptr fetcher) {
m_fetcher = fetcher;
- QPixmap pix = Fetch::Manager::fetcherIcon(fetcher.data());
+ TQPixmap pix = Fetch::Manager::fetcherIcon(fetcher.data());
if(!pix.isNull()) {
setPixmap(0, pix);
}
}
-ConfigDialog::ConfigDialog(QWidget* parent_, const char* name_/*=0*/)
+ConfigDialog::ConfigDialog(TQWidget* tqparent_, const char* name_/*=0*/)
: KDialogBase(IconList, i18n("Configure Tellico"), Help|Ok|Apply|Cancel|Default,
- Ok, parent_, name_, true, false)
+ Ok, tqparent_, name_, true, false)
, m_modifying(false)
, m_okClicked(false) {
setupGeneralPage();
@@ -110,11 +110,11 @@ ConfigDialog::ConfigDialog(QWidget* parent_, const char* name_/*=0*/)
setupFetchPage();
updateGeometry();
- QSize s = sizeHint();
- resize(QMAX(s.width(), CONFIG_MIN_WIDTH), QMAX(s.height(), CONFIG_MIN_HEIGHT));
+ TQSize s = tqsizeHint();
+ resize(TQMAX(s.width(), CONFIG_MIN_WIDTH), TQMAX(s.height(), CONFIG_MIN_HEIGHT));
// purely for asthetics make all widgets line up
- QPtrList<QWidget> widgets;
+ TQPtrList<TQWidget> widgets;
widgets.append(m_fontCombo);
widgets.append(m_fontSizeInput);
widgets.append(m_baseColorCombo);
@@ -122,43 +122,43 @@ ConfigDialog::ConfigDialog(QWidget* parent_, const char* name_/*=0*/)
widgets.append(m_highBaseColorCombo);
widgets.append(m_highTextColorCombo);
int w = 0;
- for(QPtrListIterator<QWidget> it(widgets); it.current(); ++it) {
+ for(TQPtrListIterator<TQWidget> it(widgets); it.current(); ++it) {
it.current()->polish();
- w = QMAX(w, it.current()->sizeHint().width());
+ w = TQMAX(w, it.current()->tqsizeHint().width());
}
- for(QPtrListIterator<QWidget> it(widgets); it.current(); ++it) {
+ for(TQPtrListIterator<TQWidget> it(widgets); it.current(); ++it) {
it.current()->setMinimumWidth(w);
}
enableButtonOK(false);
enableButtonApply(false);
- setHelp(QString::fromLatin1("general-options"));
- connect(this, SIGNAL(aboutToShowPage(QWidget*)), SLOT(slotUpdateHelpLink(QWidget*)));
+ setHelp(TQString::tqfromLatin1("general-options"));
+ connect(this, TQT_SIGNAL(aboutToShowPage(TQWidget*)), TQT_SLOT(slotUpdateHelpLink(TQWidget*)));
}
ConfigDialog::~ConfigDialog() {
- for(QPtrListIterator<Fetch::ConfigWidget> it(m_newStuffConfigWidgets); it.current(); ++it) {
+ for(TQPtrListIterator<Fetch::ConfigWidget> it(m_newStuffConfigWidgets); it.current(); ++it) {
it.current()->removed();
}
}
-void ConfigDialog::slotUpdateHelpLink(QWidget* w_) {
+void ConfigDialog::slotUpdateHelpLink(TQWidget* w_) {
switch(pageIndex(w_)) {
case 0:
- setHelp(QString::fromLatin1("general-options"));
+ setHelp(TQString::tqfromLatin1("general-options"));
break;
case 1:
- setHelp(QString::fromLatin1("printing-options"));
+ setHelp(TQString::tqfromLatin1("printing-options"));
break;
case 2:
- setHelp(QString::fromLatin1("template-options"));
+ setHelp(TQString::tqfromLatin1("template-options"));
break;
case 3:
- setHelp(QString::fromLatin1("internet-sources-options"));
+ setHelp(TQString::tqfromLatin1("internet-sources-options"));
break;
default:
@@ -194,85 +194,85 @@ void ConfigDialog::slotDefault() {
}
void ConfigDialog::setupGeneralPage() {
- QPixmap pix = DesktopIcon(QString::fromLatin1("tellico"), KIcon::SizeMedium);
- QFrame* frame = addPage(i18n("General"), i18n("General Options"), pix);
- QVBoxLayout* l = new QVBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
+ TQPixmap pix = DesktopIcon(TQString::tqfromLatin1("tellico"), KIcon::SizeMedium);
+ TQFrame* frame = addPage(i18n("General"), i18n("General Options"), pix);
+ TQVBoxLayout* l = new TQVBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
- m_cbOpenLastFile = new QCheckBox(i18n("&Reopen file at startup"), frame);
- QWhatsThis::add(m_cbOpenLastFile, i18n("If checked, the file that was last open "
+ m_cbOpenLastFile = new TQCheckBox(i18n("&Reopen file at startup"), frame);
+ TQWhatsThis::add(m_cbOpenLastFile, i18n("If checked, the file that was last open "
"will be re-opened at program start-up."));
l->addWidget(m_cbOpenLastFile);
- connect(m_cbOpenLastFile, SIGNAL(clicked()), SLOT(slotModified()));
+ connect(m_cbOpenLastFile, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified()));
- m_cbShowTipDay = new QCheckBox(i18n("&Show \"Tip of the Day\" at startup"), frame);
- QWhatsThis::add(m_cbShowTipDay, i18n("If checked, the \"Tip of the Day\" will be "
+ m_cbShowTipDay = new TQCheckBox(i18n("&Show \"Tip of the Day\" at startup"), frame);
+ TQWhatsThis::add(m_cbShowTipDay, i18n("If checked, the \"Tip of the Day\" will be "
"shown at program start-up."));
l->addWidget(m_cbShowTipDay);
- connect(m_cbShowTipDay, SIGNAL(clicked()), SLOT(slotModified()));
+ connect(m_cbShowTipDay, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified()));
- QButtonGroup* imageGroup = new QVButtonGroup(i18n("Image Storage Options"), frame);
- m_rbImageInFile = new QRadioButton(i18n("Store images in data file"), imageGroup);
- m_rbImageInAppDir = new QRadioButton(i18n("Store images in common application directory"), imageGroup);
- m_rbImageInLocalDir = new QRadioButton(i18n("Store images in directory relative to data file"), imageGroup);
- QWhatsThis::add(imageGroup, i18n("Images may be saved in the data file itself, which can "
+ TQButtonGroup* imageGroup = new TQVButtonGroup(i18n("Image Storage Options"), frame);
+ m_rbImageInFile = new TQRadioButton(i18n("Store images in data file"), imageGroup);
+ m_rbImageInAppDir = new TQRadioButton(i18n("Store images in common application directory"), imageGroup);
+ m_rbImageInLocalDir = new TQRadioButton(i18n("Store images in directory relative to data file"), imageGroup);
+ TQWhatsThis::add(imageGroup, i18n("Images may be saved in the data file itself, which can "
"cause Tellico to run slowly, stored in the Tellico "
"application directory, or stored in a directory in the "
"same location as the data file."));
l->addWidget(imageGroup);
- connect(imageGroup, SIGNAL(clicked(int)), SLOT(slotModified()));
+ connect(imageGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotModified()));
- QVGroupBox* formatGroup = new QVGroupBox(i18n("Formatting Options"), frame);
+ TQVGroupBox* formatGroup = new TQVGroupBox(i18n("Formatting Options"), frame);
l->addWidget(formatGroup);
- m_cbCapitalize = new QCheckBox(i18n("Auto capitalize &titles and names"), formatGroup);
- QWhatsThis::add(m_cbCapitalize, i18n("If checked, titles and names will "
+ m_cbCapitalize = new TQCheckBox(i18n("Auto capitalize &titles and names"), formatGroup);
+ TQWhatsThis::add(m_cbCapitalize, i18n("If checked, titles and names will "
"be automatically capitalized."));
- connect(m_cbCapitalize, SIGNAL(clicked()), SLOT(slotModified()));
+ connect(m_cbCapitalize, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified()));
- m_cbFormat = new QCheckBox(i18n("Auto &format titles and names"), formatGroup);
- QWhatsThis::add(m_cbFormat, i18n("If checked, titles and names will "
+ m_cbFormat = new TQCheckBox(i18n("Auto &format titles and names"), formatGroup);
+ TQWhatsThis::add(m_cbFormat, i18n("If checked, titles and names will "
"be automatically formatted."));
- connect(m_cbFormat, SIGNAL(clicked()), SLOT(slotModified()));
+ connect(m_cbFormat, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified()));
- QGrid* g1 = new QGrid(2, formatGroup);
+ TQGrid* g1 = new TQGrid(2, formatGroup);
g1->setSpacing(5);
- QLabel* lab = new QLabel(i18n("No capitali&zation:"), g1);
+ TQLabel* lab = new TQLabel(i18n("No capitali&zation:"), g1);
m_leCapitals = new KLineEdit(g1);
lab->setBuddy(m_leCapitals);
- QString whats = i18n("<qt>A list of words which should not be capitalized. Multiple values "
+ TQString whats = i18n("<qt>A list of words which should not be capitalized. Multiple values "
"should be separated by a semi-colon.</qt>");
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_leCapitals, whats);
- connect(m_leCapitals, SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_leCapitals, whats);
+ connect(m_leCapitals, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
- lab = new QLabel(i18n("Artic&les:"), g1);
+ lab = new TQLabel(i18n("Artic&les:"), g1);
m_leArticles = new KLineEdit(g1);
lab->setBuddy(m_leArticles);
whats = i18n("<qt>A list of words which should be considered as articles "
"if they are the first word in a title. Multiple values "
"should be separated by a semi-colon.</qt>");
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_leArticles, whats);
- connect(m_leArticles, SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_leArticles, whats);
+ connect(m_leArticles, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
- lab = new QLabel(i18n("Personal suffi&xes:"), g1);
+ lab = new TQLabel(i18n("Personal suffi&xes:"), g1);
m_leSuffixes = new KLineEdit(g1);
lab->setBuddy(m_leSuffixes);
whats = i18n("<qt>A list of suffixes which might be used in personal names. Multiple values "
"should be separated by a semi-colon.</qt>");
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_leSuffixes, whats);
- connect(m_leSuffixes, SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_leSuffixes, whats);
+ connect(m_leSuffixes, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
- lab = new QLabel(i18n("Surname &prefixes:"), g1);
+ lab = new TQLabel(i18n("Surname &prefixes:"), g1);
m_lePrefixes = new KLineEdit(g1);
lab->setBuddy(m_lePrefixes);
whats = i18n("<qt>A list of prefixes which might be used in surnames. Multiple values "
"should be separated by a semi-colon.</qt>");
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_lePrefixes, whats);
- connect(m_lePrefixes, SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_lePrefixes, whats);
+ connect(m_lePrefixes, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
// stretch to fill lower area
l->addStretch(1);
@@ -280,108 +280,108 @@ void ConfigDialog::setupGeneralPage() {
void ConfigDialog::setupPrintingPage() {
// SuSE changed the icon name on me
- QPixmap pix;
+ TQPixmap pix;
KIconLoader* loader = KGlobal::iconLoader();
if(loader) {
- pix = loader->loadIcon(QString::fromLatin1("printer1"), KIcon::Desktop, KIcon::SizeMedium,
+ pix = loader->loadIcon(TQString::tqfromLatin1("printer1"), KIcon::Desktop, KIcon::SizeMedium,
KIcon::DefaultState, 0, true /*canReturnNull */);
if(pix.isNull()) {
- pix = loader->loadIcon(QString::fromLatin1("printer2"), KIcon::Desktop, KIcon::SizeMedium,
+ pix = loader->loadIcon(TQString::tqfromLatin1("printer2"), KIcon::Desktop, KIcon::SizeMedium,
KIcon::DefaultState, 0, true /*canReturnNull */);
}
if(pix.isNull()) {
- pix = loader->loadIcon(QString::fromLatin1("print_printer"), KIcon::Desktop, KIcon::SizeMedium);
+ pix = loader->loadIcon(TQString::tqfromLatin1("print_printer"), KIcon::Desktop, KIcon::SizeMedium);
}
}
- QFrame* frame = addPage(i18n("Printing"), i18n("Printing Options"), pix);
- QVBoxLayout* l = new QVBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
+ TQFrame* frame = addPage(i18n("Printing"), i18n("Printing Options"), pix);
+ TQVBoxLayout* l = new TQVBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
- QVGroupBox* formatOptions = new QVGroupBox(i18n("Formatting Options"), frame);
+ TQVGroupBox* formatOptions = new TQVGroupBox(i18n("Formatting Options"), frame);
l->addWidget(formatOptions);
- m_cbPrintFormatted = new QCheckBox(i18n("&Format titles and names"), formatOptions);
- QWhatsThis::add(m_cbPrintFormatted, i18n("If checked, titles and names will be automatically formatted."));
- connect(m_cbPrintFormatted, SIGNAL(clicked()), SLOT(slotModified()));
+ m_cbPrintFormatted = new TQCheckBox(i18n("&Format titles and names"), formatOptions);
+ TQWhatsThis::add(m_cbPrintFormatted, i18n("If checked, titles and names will be automatically formatted."));
+ connect(m_cbPrintFormatted, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified()));
- m_cbPrintHeaders = new QCheckBox(i18n("&Print field headers"), formatOptions);
- QWhatsThis::add(m_cbPrintHeaders, i18n("If checked, the field names will be printed as table headers."));
- connect(m_cbPrintHeaders, SIGNAL(clicked()), SLOT(slotModified()));
+ m_cbPrintHeaders = new TQCheckBox(i18n("&Print field headers"), formatOptions);
+ TQWhatsThis::add(m_cbPrintHeaders, i18n("If checked, the field names will be printed as table headers."));
+ connect(m_cbPrintHeaders, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified()));
- QHGroupBox* groupOptions = new QHGroupBox(i18n("Grouping Options"), frame);
+ TQHGroupBox* groupOptions = new TQHGroupBox(i18n("Grouping Options"), frame);
l->addWidget(groupOptions);
- m_cbPrintGrouped = new QCheckBox(i18n("&Group the entries"), groupOptions);
- QWhatsThis::add(m_cbPrintGrouped, i18n("If checked, the entries will be grouped by the selected field."));
- connect(m_cbPrintGrouped, SIGNAL(clicked()), SLOT(slotModified()));
+ m_cbPrintGrouped = new TQCheckBox(i18n("&Group the entries"), groupOptions);
+ TQWhatsThis::add(m_cbPrintGrouped, i18n("If checked, the entries will be grouped by the selected field."));
+ connect(m_cbPrintGrouped, TQT_SIGNAL(clicked()), TQT_SLOT(slotModified()));
- QVGroupBox* imageOptions = new QVGroupBox(i18n("Image Options"), frame);
+ TQVGroupBox* imageOptions = new TQVGroupBox(i18n("Image Options"), frame);
l->addWidget(imageOptions);
- QGrid* grid = new QGrid(3, imageOptions);
+ TQGrid* grid = new TQGrid(3, imageOptions);
grid->setSpacing(5);
- QLabel* lab = new QLabel(i18n("Maximum image &width:"), grid);
+ TQLabel* lab = new TQLabel(i18n("Maximum image &width:"), grid);
m_imageWidthBox = new KIntSpinBox(0, 999, 1, 50, 10, grid);
- m_imageWidthBox->setSuffix(QString::fromLatin1(" px"));
+ m_imageWidthBox->setSuffix(TQString::tqfromLatin1(" px"));
lab->setBuddy(m_imageWidthBox);
- (void) new QWidget(grid);
- QString whats = i18n("The maximum width of the images in the printout. The aspect ration is preserved.");
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_imageWidthBox, whats);
- connect(m_imageWidthBox, SIGNAL(valueChanged(int)), SLOT(slotModified()));
- // QSpinBox doesn't emit valueChanged if you edit the value with
+ (void) new TQWidget(grid);
+ TQString whats = i18n("The maximum width of the images in the printout. The aspect ration is preserved.");
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_imageWidthBox, whats);
+ connect(m_imageWidthBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotModified()));
+ // TQSpinBox doesn't emit valueChanged if you edit the value with
// the lineEdit until you change the keyboard focus
- connect(m_imageWidthBox->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ connect(m_imageWidthBox->child("qt_spinbox_edit"), TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
- lab = new QLabel(i18n("&Maximum image height:"), grid);
+ lab = new TQLabel(i18n("&Maximum image height:"), grid);
m_imageHeightBox = new KIntSpinBox(0, 999, 1, 50, 10, grid);
- m_imageHeightBox->setSuffix(QString::fromLatin1(" px"));
+ m_imageHeightBox->setSuffix(TQString::tqfromLatin1(" px"));
lab->setBuddy(m_imageHeightBox);
- (void) new QWidget(grid);
+ (void) new TQWidget(grid);
whats = i18n("The maximum height of the images in the printout. The aspect ration is preserved.");
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_imageHeightBox, whats);
- connect(m_imageHeightBox, SIGNAL(valueChanged(int)), SLOT(slotModified()));
- // QSpinBox doesn't emit valueChanged if you edit the value with
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_imageHeightBox, whats);
+ connect(m_imageHeightBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotModified()));
+ // TQSpinBox doesn't emit valueChanged if you edit the value with
// the lineEdit until you change the keyboard focus
- connect(m_imageHeightBox->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), SLOT(slotModified()));
+ connect(m_imageHeightBox->child("qt_spinbox_edit"), TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotModified()));
// stretch to fill lower area
l->addStretch(1);
}
void ConfigDialog::setupTemplatePage() {
- QPixmap pix = DesktopIcon(QString::fromLatin1("looknfeel"), KIcon::SizeMedium);
- QFrame* frame = addPage(i18n("Templates"), i18n("Template Options"), pix);
- QVBoxLayout* l = new QVBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
+ TQPixmap pix = DesktopIcon(TQString::tqfromLatin1("looknfeel"), KIcon::SizeMedium);
+ TQFrame* frame = addPage(i18n("Templates"), i18n("Template Options"), pix);
+ TQVBoxLayout* l = new TQVBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
- QGridLayout* gridLayout = new QGridLayout(l);
+ TQGridLayout* gridLayout = new TQGridLayout(l);
gridLayout->setSpacing(KDialogBase::spacingHint());
int row = -1;
// so I can reuse an i18n string, a plain label can't have an '&'
- QLabel* lab = new QLabel(i18n("Collection &type:").remove('&'), frame);
+ TQLabel* lab = new TQLabel(i18n("Collection &type:").remove('&'), frame);
gridLayout->addWidget(lab, ++row, 0);
const int collType = Kernel::self()->collectionType();
- lab = new QLabel(CollectionFactory::nameMap()[collType], frame);
+ lab = new TQLabel(CollectionFactory::nameMap()[collType], frame);
gridLayout->addMultiCellWidget(lab, row, row, 1, 2);
- lab = new QLabel(i18n("Template:"), frame);
+ lab = new TQLabel(i18n("Template:"), frame);
m_templateCombo = new GUI::ComboBox(frame);
- connect(m_templateCombo, SIGNAL(activated(int)), SLOT(slotModified()));
+ connect(m_templateCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotModified()));
lab->setBuddy(m_templateCombo);
- QString whats = i18n("Select the template to use for the current type of collections. "
+ TQString whats = i18n("Select the template to use for the current type of collections. "
"Not all templates will use the font and color settings.");
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_templateCombo, whats);
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_templateCombo, whats);
gridLayout->addWidget(lab, ++row, 0);
gridLayout->addWidget(m_templateCombo, row, 1);
KPushButton* btn = new KPushButton(i18n("&Preview..."), frame);
- QWhatsThis::add(btn, i18n("Show a preview of the template"));
- btn->setIconSet(SmallIconSet(QString::fromLatin1("viewmag")));
+ TQWhatsThis::add(btn, i18n("Show a preview of the template"));
+ btn->setIconSet(SmallIconSet(TQString::tqfromLatin1("viewmag")));
gridLayout->addWidget(btn, row, 2);
- connect(btn, SIGNAL(clicked()), SLOT(slotShowTemplatePreview()));
+ connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(slotShowTemplatePreview()));
// so the button is squeezed small
gridLayout->setColStretch(0, 10);
@@ -389,106 +389,106 @@ void ConfigDialog::setupTemplatePage() {
loadTemplateList();
-// QLabel* l1 = new QLabel(i18n("The options below will be passed to the template, but not "
+// TQLabel* l1 = new TQLabel(i18n("The options below will be passed to the template, but not "
// "all templates will use them. Some fonts and colors may be "
// "specified directly in the template."), frame);
-// l1->setTextFormat(Qt::RichText);
+// l1->setTextFormat(TQt::RichText);
// l->addWidget(l1);
- QGroupBox* fontGroup = new QGroupBox(0, Qt::Vertical, i18n("Font Options"), frame);
+ TQGroupBox* fontGroup = new TQGroupBox(0, Qt::Vertical, i18n("Font Options"), frame);
l->addWidget(fontGroup);
row = -1;
- QGridLayout* fontLayout = new QGridLayout(fontGroup->layout());
+ TQGridLayout* fontLayout = new TQGridLayout(fontGroup->tqlayout());
fontLayout->setSpacing(KDialogBase::spacingHint());
- lab = new QLabel(i18n("Font:"), fontGroup);
+ lab = new TQLabel(i18n("Font:"), fontGroup);
fontLayout->addWidget(lab, ++row, 0);
m_fontCombo = new KFontCombo(fontGroup);
fontLayout->addWidget(m_fontCombo, row, 1);
- connect(m_fontCombo, SIGNAL(activated(int)), SLOT(slotModified()));
+ connect(m_fontCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotModified()));
lab->setBuddy(m_fontCombo);
whats = i18n("This font is passed to the template used in the Entry View.");
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_fontCombo, whats);
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_fontCombo, whats);
- fontLayout->addWidget(new QLabel(i18n("Size:"), fontGroup), ++row, 0);
+ fontLayout->addWidget(new TQLabel(i18n("Size:"), fontGroup), ++row, 0);
m_fontSizeInput = new KIntNumInput(fontGroup);
m_fontSizeInput->setRange(5, 30); // 30 is same max as konq config
- m_fontSizeInput->setSuffix(QString::fromLatin1("pt"));
+ m_fontSizeInput->setSuffix(TQString::tqfromLatin1("pt"));
fontLayout->addWidget(m_fontSizeInput, row, 1);
- connect(m_fontSizeInput, SIGNAL(valueChanged(int)), SLOT(slotModified()));
+ connect(m_fontSizeInput, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotModified()));
lab->setBuddy(m_fontSizeInput);
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_fontSizeInput, whats);
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_fontSizeInput, whats);
- QGroupBox* colGroup = new QGroupBox(0, Qt::Vertical, i18n("Color Options"), frame);
+ TQGroupBox* colGroup = new TQGroupBox(0, Qt::Vertical, i18n("Color Options"), frame);
l->addWidget(colGroup);
row = -1;
- QGridLayout* colLayout = new QGridLayout(colGroup->layout());
+ TQGridLayout* colLayout = new TQGridLayout(colGroup->tqlayout());
colLayout->setSpacing(KDialogBase::spacingHint());
- lab = new QLabel(i18n("Background color:"), colGroup);
+ lab = new TQLabel(i18n("Background color:"), colGroup);
colLayout->addWidget(lab, ++row, 0);
m_baseColorCombo = new KColorCombo(colGroup);
colLayout->addWidget(m_baseColorCombo, row, 1);
- connect(m_baseColorCombo, SIGNAL(activated(int)), SLOT(slotModified()));
+ connect(m_baseColorCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotModified()));
lab->setBuddy(m_baseColorCombo);
whats = i18n("This color is passed to the template used in the Entry View.");
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_baseColorCombo, whats);
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_baseColorCombo, whats);
- lab = new QLabel(i18n("Text color:"), colGroup);
+ lab = new TQLabel(i18n("Text color:"), colGroup);
colLayout->addWidget(lab, ++row, 0);
m_textColorCombo = new KColorCombo(colGroup);
colLayout->addWidget(m_textColorCombo, row, 1);
- connect(m_textColorCombo, SIGNAL(activated(int)), SLOT(slotModified()));
+ connect(m_textColorCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotModified()));
lab->setBuddy(m_textColorCombo);
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_textColorCombo, whats);
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_textColorCombo, whats);
- lab = new QLabel(i18n("Highlight color:"), colGroup);
+ lab = new TQLabel(i18n("Highlight color:"), colGroup);
colLayout->addWidget(lab, ++row, 0);
m_highBaseColorCombo = new KColorCombo(colGroup);
colLayout->addWidget(m_highBaseColorCombo, row, 1);
- connect(m_highBaseColorCombo, SIGNAL(activated(int)), SLOT(slotModified()));
+ connect(m_highBaseColorCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotModified()));
lab->setBuddy(m_highBaseColorCombo);
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_highBaseColorCombo, whats);
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_highBaseColorCombo, whats);
- lab = new QLabel(i18n("Highlighted text color:"), colGroup);
+ lab = new TQLabel(i18n("Highlighted text color:"), colGroup);
colLayout->addWidget(lab, ++row, 0);
m_highTextColorCombo = new KColorCombo(colGroup);
colLayout->addWidget(m_highTextColorCombo, row, 1);
- connect(m_highTextColorCombo, SIGNAL(activated(int)), SLOT(slotModified()));
+ connect(m_highTextColorCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotModified()));
lab->setBuddy(m_highTextColorCombo);
- QWhatsThis::add(lab, whats);
- QWhatsThis::add(m_highTextColorCombo, whats);
+ TQWhatsThis::add(lab, whats);
+ TQWhatsThis::add(m_highTextColorCombo, whats);
- QVGroupBox* groupBox = new QVGroupBox(i18n("Manage Templates"), frame);
+ TQVGroupBox* groupBox = new TQVGroupBox(i18n("Manage Templates"), frame);
l->addWidget(groupBox);
- QHBox* box1 = new QHBox(groupBox);
+ TQHBox* box1 = new TQHBox(groupBox);
box1->setSpacing(KDialog::spacingHint());
KPushButton* b1 = new KPushButton(i18n("Install..."), box1);
- b1->setIconSet(SmallIconSet(QString::fromLatin1("add")));
- connect(b1, SIGNAL(clicked()), SLOT(slotInstallTemplate()));
+ b1->setIconSet(SmallIconSet(TQString::tqfromLatin1("add")));
+ connect(b1, TQT_SIGNAL(clicked()), TQT_SLOT(slotInstallTemplate()));
whats = i18n("Click to install a new template directly.");
- QWhatsThis::add(b1, whats);
+ TQWhatsThis::add(b1, whats);
KPushButton* b2 = new KPushButton(i18n("Download..."), box1);
- b2->setIconSet(SmallIconSet(QString::fromLatin1("knewstuff")));
- connect(b2, SIGNAL(clicked()), SLOT(slotDownloadTemplate()));
+ b2->setIconSet(SmallIconSet(TQString::tqfromLatin1("knewstuff")));
+ connect(b2, TQT_SIGNAL(clicked()), TQT_SLOT(slotDownloadTemplate()));
whats = i18n("Click to download additional templates via the Internet.");
- QWhatsThis::add(b2, whats);
+ TQWhatsThis::add(b2, whats);
KPushButton* b3 = new KPushButton(i18n("Delete..."), box1);
- b3->setIconSet(SmallIconSet(QString::fromLatin1("remove")));
- connect(b3, SIGNAL(clicked()), SLOT(slotDeleteTemplate()));
+ b3->setIconSet(SmallIconSet(TQString::tqfromLatin1("remove")));
+ connect(b3, TQT_SIGNAL(clicked()), TQT_SLOT(slotDeleteTemplate()));
whats = i18n("Click to select and remove installed templates.");
- QWhatsThis::add(b3, whats);
+ TQWhatsThis::add(b3, whats);
// stretch to fill lower area
l->addStretch(1);
@@ -497,46 +497,46 @@ void ConfigDialog::setupTemplatePage() {
}
void ConfigDialog::setupFetchPage() {
- QPixmap pix = DesktopIcon(QString::fromLatin1("network"), KIcon::SizeMedium);
- QFrame* frame = addPage(i18n("Data Sources"), i18n("Data Source Options"), pix);
- QHBoxLayout* l = new QHBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
+ TQPixmap pix = DesktopIcon(TQString::tqfromLatin1("network"), KIcon::SizeMedium);
+ TQFrame* frame = addPage(i18n("Data Sources"), i18n("Data Source Options"), pix);
+ TQHBoxLayout* l = new TQHBoxLayout(frame, KDialog::marginHint(), KDialog::spacingHint());
- QVBoxLayout* leftLayout = new QVBoxLayout(l);
+ TQVBoxLayout* leftLayout = new TQVBoxLayout(l);
m_sourceListView = new KListView(frame);
m_sourceListView->addColumn(i18n("Source"));
- m_sourceListView->setResizeMode(QListView::LastColumn);
+ m_sourceListView->setResizeMode(TQListView::LastColumn);
m_sourceListView->setSorting(-1); // no sorting
- m_sourceListView->setSelectionMode(QListView::Single);
+ m_sourceListView->setSelectionMode(TQListView::Single);
leftLayout->addWidget(m_sourceListView, 1);
- connect(m_sourceListView, SIGNAL(selectionChanged(QListViewItem*)), SLOT(slotSelectedSourceChanged(QListViewItem*)));
- connect(m_sourceListView, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), SLOT(slotModifySourceClicked()));
+ connect(m_sourceListView, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(slotSelectedSourceChanged(TQListViewItem*)));
+ connect(m_sourceListView, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), TQT_SLOT(slotModifySourceClicked()));
- QHBox* hb = new QHBox(frame);
+ TQHBox* hb = new TQHBox(frame);
leftLayout->addWidget(hb);
hb->setSpacing(KDialog::spacingHint());
m_moveUpSourceBtn = new KPushButton(i18n("Move &Up"), hb);
- m_moveUpSourceBtn->setIconSet(SmallIconSet(QString::fromLatin1("up")));
- QWhatsThis::add(m_moveUpSourceBtn, i18n("The order of the data sources sets the order "
+ m_moveUpSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("up")));
+ TQWhatsThis::add(m_moveUpSourceBtn, i18n("The order of the data sources sets the order "
"that Tellico uses when entries are automatically updated."));
m_moveDownSourceBtn = new KPushButton(i18n("Move &Down"), hb);
- m_moveDownSourceBtn->setIconSet(SmallIconSet(QString::fromLatin1("down")));
- QWhatsThis::add(m_moveDownSourceBtn, i18n("The order of the data sources sets the order "
+ m_moveDownSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("down")));
+ TQWhatsThis::add(m_moveDownSourceBtn, i18n("The order of the data sources sets the order "
"that Tellico uses when entries are automatically updated."));
// these icons are rather arbitrary, but seem to vaguely fit
- QVBoxLayout* vlay = new QVBoxLayout(l);
+ TQVBoxLayout* vlay = new TQVBoxLayout(l);
KPushButton* newSourceBtn = new KPushButton(i18n("&New..."), frame);
- newSourceBtn->setIconSet(SmallIconSet(QString::fromLatin1("filenew")));
- QWhatsThis::add(newSourceBtn, i18n("Click to add a new data source."));
+ newSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("filenew")));
+ TQWhatsThis::add(newSourceBtn, i18n("Click to add a new data source."));
m_modifySourceBtn = new KPushButton(i18n("&Modify..."), frame);
- m_modifySourceBtn->setIconSet(SmallIconSet(QString::fromLatin1("network")));
- QWhatsThis::add(m_modifySourceBtn, i18n("Click to modify the selected data source."));
+ m_modifySourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("network")));
+ TQWhatsThis::add(m_modifySourceBtn, i18n("Click to modify the selected data source."));
m_removeSourceBtn = new KPushButton(i18n("&Delete"), frame);
- m_removeSourceBtn->setIconSet(SmallIconSet(QString::fromLatin1("remove")));
- QWhatsThis::add(m_removeSourceBtn, i18n("Click to delete the selected data source."));
+ m_removeSourceBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("remove")));
+ TQWhatsThis::add(m_removeSourceBtn, i18n("Click to delete the selected data source."));
m_newStuffBtn = new KPushButton(i18n("Download..."), frame);
- m_newStuffBtn->setIconSet(SmallIconSet(QString::fromLatin1("knewstuff")));
- QWhatsThis::add(m_newStuffBtn, i18n("Click to download additional data sources via the Internet."));
+ m_newStuffBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("knewstuff")));
+ TQWhatsThis::add(m_newStuffBtn, i18n("Click to download additional data sources via the Internet."));
#if !KDE_IS_VERSION(3,3,90)
// only available in KDE 3.4 and up
@@ -551,12 +551,12 @@ void ConfigDialog::setupFetchPage() {
vlay->addWidget(m_newStuffBtn);
vlay->addStretch(1);
- connect(newSourceBtn, SIGNAL(clicked()), SLOT(slotNewSourceClicked()));
- connect(m_modifySourceBtn, SIGNAL(clicked()), SLOT(slotModifySourceClicked()));
- connect(m_moveUpSourceBtn, SIGNAL(clicked()), SLOT(slotMoveUpSourceClicked()));
- connect(m_moveDownSourceBtn, SIGNAL(clicked()), SLOT(slotMoveDownSourceClicked()));
- connect(m_removeSourceBtn, SIGNAL(clicked()), SLOT(slotRemoveSourceClicked()));
- connect(m_newStuffBtn, SIGNAL(clicked()), SLOT(slotNewStuffClicked()));
+ connect(newSourceBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotNewSourceClicked()));
+ connect(m_modifySourceBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotModifySourceClicked()));
+ connect(m_moveUpSourceBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveUpSourceClicked()));
+ connect(m_moveDownSourceBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveDownSourceClicked()));
+ connect(m_removeSourceBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemoveSourceClicked()));
+ connect(m_newStuffBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotNewStuffClicked()));
KAcceleratorManager::manage(frame);
}
@@ -587,13 +587,13 @@ void ConfigDialog::readGeneralConfig() {
bool autoFormat = Config::autoFormat();
m_cbFormat->setChecked(autoFormat);
- const QRegExp comma(QString::fromLatin1("\\s*,\\s*"));
- const QString semicolon = QString::fromLatin1("; ");
+ const TQRegExp comma(TQString::tqfromLatin1("\\s*,\\s*"));
+ const TQString semicolon = TQString::tqfromLatin1("; ");
- m_leCapitals->setText(Config::noCapitalizationString().replace(comma, semicolon));
- m_leArticles->setText(Config::articlesString().replace(comma, semicolon));
- m_leSuffixes->setText(Config::nameSuffixesString().replace(comma, semicolon));
- m_lePrefixes->setText(Config::surnamePrefixesString().replace(comma, semicolon));
+ m_leCapitals->setText(Config::noCapitalizationString().tqreplace(comma, semicolon));
+ m_leArticles->setText(Config::articlesString().tqreplace(comma, semicolon));
+ m_leSuffixes->setText(Config::nameSuffixesString().tqreplace(comma, semicolon));
+ m_lePrefixes->setText(Config::surnamePrefixesString().tqreplace(comma, semicolon));
}
void ConfigDialog::readPrintingConfig() {
@@ -607,9 +607,9 @@ void ConfigDialog::readPrintingConfig() {
void ConfigDialog::readTemplateConfig() {
// entry template selection
const int collType = Kernel::self()->collectionType();
- QString file = Config::templateName(collType);
- file.replace('_', ' ');
- QString fileContext = file + QString::fromLatin1(" XSL Template");
+ TQString file = Config::templateName(collType);
+ file.tqreplace('_', ' ');
+ TQString fileContext = file + TQString::tqfromLatin1(" XSL Template");
m_templateCombo->setCurrentItem(i18n(fileContext.utf8(), file.utf8()));
m_fontCombo->setCurrentFont(Config::templateFont(collType).family());
@@ -633,7 +633,7 @@ void ConfigDialog::readFetchConfig() {
Fetch::ConfigWidget* cw = it->configWidget(this);
if(cw) { // might return 0 when no widget available for fetcher type
m_configWidgets.insert(item, cw);
- // there's weird layout bug if it's not hidden
+ // there's weird tqlayout bug if it's not hidden
cw->hide();
}
kapp->processEvents();
@@ -665,14 +665,14 @@ void ConfigDialog::saveConfiguration() {
Config::setAutoCapitalization(m_cbCapitalize->isChecked());
Config::setAutoFormat(m_cbFormat->isChecked());
- const QRegExp semicolon(QString::fromLatin1("\\s*;\\s*"));
- const QChar comma = ',';
+ const TQRegExp semicolon(TQString::tqfromLatin1("\\s*;\\s*"));
+ const TQChar comma = ',';
- Config::setNoCapitalizationString(m_leCapitals->text().replace(semicolon, comma));
- Config::setArticlesString(m_leArticles->text().replace(semicolon, comma));
+ Config::setNoCapitalizationString(m_leCapitals->text().tqreplace(semicolon, comma));
+ Config::setArticlesString(m_leArticles->text().tqreplace(semicolon, comma));
Data::Field::articlesUpdated();
- Config::setNameSuffixesString(m_leSuffixes->text().replace(semicolon, comma));
- Config::setSurnamePrefixesString(m_lePrefixes->text().replace(semicolon, comma));
+ Config::setNameSuffixesString(m_leSuffixes->text().tqreplace(semicolon, comma));
+ Config::setSurnamePrefixesString(m_lePrefixes->text().tqreplace(semicolon, comma));
Config::setPrintFieldHeaders(m_cbPrintHeaders->isChecked());
Config::setPrintFormatted(m_cbPrintFormatted->isChecked());
@@ -683,7 +683,7 @@ void ConfigDialog::saveConfiguration() {
// entry template selection
const int collType = Kernel::self()->collectionType();
Config::setTemplateName(collType, m_templateCombo->currentData().toString());
- QFont font(m_fontCombo->currentFont(), m_fontSizeInput->value());
+ TQFont font(m_fontCombo->currentFont(), m_fontSizeInput->value());
Config::setTemplateFont(collType, font);
Config::setTemplateBaseColor(collType, m_baseColorCombo->color());
Config::setTemplateTextColor(collType, m_textColorCombo->color());
@@ -691,7 +691,7 @@ void ConfigDialog::saveConfiguration() {
Config::setTemplateHighlightedTextColor(collType, m_highTextColorCombo->color());
// first, tell config widgets they got deleted
- for(QPtrListIterator<Fetch::ConfigWidget> it(m_removedConfigWidgets); it.current(); ++it) {
+ for(TQPtrListIterator<Fetch::ConfigWidget> it(m_removedConfigWidgets); it.current(); ++it) {
it.current()->removed();
}
m_removedConfigWidgets.clear();
@@ -700,14 +700,14 @@ void ConfigDialog::saveConfiguration() {
bool reloadFetchers = false;
int count = 0; // start group numbering at 0
- for(QListViewItemIterator it(m_sourceListView); it.current(); ++it, ++count) {
+ for(TQListViewItemIterator it(m_sourceListView); it.current(); ++it, ++count) {
SourceListViewItem* item = static_cast<SourceListViewItem*>(it.current());
Fetch::ConfigWidget* cw = m_configWidgets[item];
if(!cw || (!cw->shouldSave() && !item->isNewSource())) {
continue;
}
m_newStuffConfigWidgets.removeRef(cw);
- QString group = QString::fromLatin1("Data Source %1").arg(count);
+ TQString group = TQString::tqfromLatin1("Data Source %1").tqarg(count);
// in case we later change the order, clear the group now
masterConfig->deleteGroup(group);
KConfigGroup configGroup(masterConfig, group);
@@ -724,17 +724,17 @@ void ConfigDialog::saveConfiguration() {
KConfigGroup sourceGroup(masterConfig, "Data Sources");
sourceGroup.writeEntry("Sources Count", count);
// and purge old config groups
- QString group = QString::fromLatin1("Data Source %1").arg(count);
+ TQString group = TQString::tqfromLatin1("Data Source %1").tqarg(count);
while(masterConfig->hasGroup(group)) {
masterConfig->deleteGroup(group);
++count;
- group = QString::fromLatin1("Data Source %1").arg(count);
+ group = TQString::tqfromLatin1("Data Source %1").tqarg(count);
}
masterConfig->sync();
Config::writeConfig();
- QString s = m_sourceListView->selectedItem() ? m_sourceListView->selectedItem()->text(0) : QString();
+ TQString s = m_sourceListView->selectedItem() ? m_sourceListView->selectedItem()->text(0) : TQString();
if(reloadFetchers) {
Fetch::Manager::self()->loadFetchers();
Controller::self()->updatedFetchers();
@@ -743,7 +743,7 @@ void ConfigDialog::saveConfiguration() {
if(!m_okClicked) {
readFetchConfig();
if(!s.isEmpty()) {
- for(QListViewItemIterator it(m_sourceListView); it.current(); ++it) {
+ for(TQListViewItemIterator it(m_sourceListView); it.current(); ++it) {
if(it.current()->text(0) == s) {
m_sourceListView->setSelected(it.current(), true);
m_sourceListView->ensureItemVisible(it.current());
@@ -765,7 +765,7 @@ void ConfigDialog::slotModified() {
void ConfigDialog::slotNewSourceClicked() {
FetcherConfigDialog dlg(this);
- if(dlg.exec() != QDialog::Accepted) {
+ if(dlg.exec() != TQDialog::Accepted) {
return;
}
@@ -782,7 +782,7 @@ void ConfigDialog::slotNewSourceClicked() {
if(cw) {
cw->setAccepted(true);
cw->slotSetModified();
- cw->reparent(this, QPoint()); // keep the config widget around
+ cw->reparent(this, TQPoint()); // keep the config widget around
m_configWidgets.insert(item, cw);
}
m_modifySourceBtn->setEnabled(true);
@@ -797,7 +797,7 @@ void ConfigDialog::slotModifySourceClicked() {
}
Fetch::ConfigWidget* cw = 0;
- if(m_configWidgets.contains(item)) {
+ if(m_configWidgets.tqcontains(item)) {
cw = m_configWidgets[item];
}
if(!cw) {
@@ -808,9 +808,9 @@ void ConfigDialog::slotModifySourceClicked() {
}
FetcherConfigDialog dlg(item->text(0), item->fetchType(), item->updateOverwrite(), cw, this);
- if(dlg.exec() == QDialog::Accepted) {
+ if(dlg.exec() == TQDialog::Accepted) {
cw->setAccepted(true); // mark to save
- QString newName = dlg.sourceName();
+ TQString newName = dlg.sourceName();
if(newName != item->text(0)) {
item->setText(0, newName);
cw->slotSetModified();
@@ -818,7 +818,7 @@ void ConfigDialog::slotModifySourceClicked() {
item->setUpdateOverwrite(dlg.updateOverwrite());
slotModified(); // toggle apply button
}
- cw->reparent(this, QPoint()); // keep the config widget around
+ cw->reparent(this, TQPoint()); // keep the config widget around
}
void ConfigDialog::slotRemoveSourceClicked() {
@@ -830,7 +830,7 @@ void ConfigDialog::slotRemoveSourceClicked() {
Fetch::ConfigWidget* cw = m_configWidgets[item];
if(cw) {
m_removedConfigWidgets.append(cw);
- // it gets deleted by the parent
+ // it gets deleted by the tqparent
}
m_configWidgets.remove(item);
delete item;
@@ -839,7 +839,7 @@ void ConfigDialog::slotRemoveSourceClicked() {
}
void ConfigDialog::slotMoveUpSourceClicked() {
- QListViewItem* item = m_sourceListView->selectedItem();
+ TQListViewItem* item = m_sourceListView->selectedItem();
if(!item) {
return;
}
@@ -862,7 +862,7 @@ void ConfigDialog::slotMoveDownSourceClicked() {
if(!item) {
return;
}
- QListViewItem* next = item->nextSibling(); // could be 0
+ TQListViewItem* next = item->nextSibling(); // could be 0
if(next) {
GeneralFetcherInfo info(item->fetchType(), item->text(0), item->updateOverwrite());
SourceListViewItem* newItem = new SourceListViewItem(m_sourceListView, next, info, item->configGroup());
@@ -876,7 +876,7 @@ void ConfigDialog::slotMoveDownSourceClicked() {
}
}
-void ConfigDialog::slotSelectedSourceChanged(QListViewItem* item_) {
+void ConfigDialog::slotSelectedSourceChanged(TQListViewItem* item_) {
m_moveUpSourceBtn->setEnabled(item_ && item_->itemAbove());
m_moveDownSourceBtn->setEnabled(item_ && item_->nextSibling());
}
@@ -885,8 +885,8 @@ void ConfigDialog::slotNewStuffClicked() {
NewStuff::Dialog dlg(NewStuff::DataScript, this);
dlg.exec();
- QPtrList<NewStuff::DataSourceInfo> infoList = dlg.dataSourceInfo();
- for(QPtrListIterator<NewStuff::DataSourceInfo> it(infoList); it.current(); ++it) {
+ TQPtrList<NewStuff::DataSourceInfo> infoList = dlg.dataSourceInfo();
+ for(TQPtrListIterator<NewStuff::DataSourceInfo> it(infoList); it.current(); ++it) {
const NewStuff::DataSourceInfo& info = *it.current();
Fetch::ExecExternalFetcher::ConfigWidget* cw = 0;
SourceListViewItem* item = 0;
@@ -926,7 +926,7 @@ void ConfigDialog::slotNewStuffClicked() {
}
}
-Tellico::SourceListViewItem* ConfigDialog::findItem(const QString& path_) const {
+Tellico::SourceListViewItem* ConfigDialog::findItem(const TQString& path_) const {
if(path_.isEmpty()) {
kdWarning() << "ConfigDialog::findItem() - empty path" << endl;
return 0;
@@ -934,7 +934,7 @@ Tellico::SourceListViewItem* ConfigDialog::findItem(const QString& path_) const
// this is a bit ugly, loop over all items, find the execexternal one
// that matches the path
- for(QListViewItemIterator it(m_sourceListView); it.current(); ++it) {
+ for(TQListViewItemIterator it(m_sourceListView); it.current(); ++it) {
SourceListViewItem* item = static_cast<SourceListViewItem*>(it.current());
if(item->fetchType() != Fetch::ExecExternal) {
continue;
@@ -951,8 +951,8 @@ Tellico::SourceListViewItem* ConfigDialog::findItem(const QString& path_) const
void ConfigDialog::slotShowTemplatePreview() {
GUI::PreviewDialog* dlg = new GUI::PreviewDialog(this);
- const QString templateName = m_templateCombo->currentData().toString();
- dlg->setXSLTFile(templateName + QString::fromLatin1(".xsl"));
+ const TQString templateName = m_templateCombo->currentData().toString();
+ dlg->setXSLTFile(templateName + TQString::tqfromLatin1(".xsl"));
StyleOptions options;
options.fontFamily = m_fontCombo->currentFont();
@@ -973,11 +973,11 @@ void ConfigDialog::slotShowTemplatePreview() {
} else if(f->type() == Data::Field::Choice) {
e->setField(f->name(), f->allowed().front());
} else if(f->type() == Data::Field::Number) {
- e->setField(f->name(), QString::fromLatin1("1"));
+ e->setField(f->name(), TQString::tqfromLatin1("1"));
} else if(f->type() == Data::Field::Bool) {
- e->setField(f->name(), QString::fromLatin1("true"));
+ e->setField(f->name(), TQString::tqfromLatin1("true"));
} else if(f->type() == Data::Field::Rating) {
- e->setField(f->name(), QString::fromLatin1("5"));
+ e->setField(f->name(), TQString::tqfromLatin1("5"));
} else {
e->setField(f->name(), f->title());
}
@@ -990,38 +990,38 @@ void ConfigDialog::slotShowTemplatePreview() {
}
void ConfigDialog::loadTemplateList() {
- QStringList files = KGlobal::dirs()->findAllResources("appdata", QString::fromLatin1("entry-templates/*.xsl"),
+ TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::tqfromLatin1("entry-templates/*.xsl"),
false, true);
- KSortableValueList<QString, QString> templates;
- for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
- QFileInfo fi(*it);
- QString file = fi.fileName().section('.', 0, -2);
- QString name = file;
- name.replace('_', ' ');
- QString title = i18n((name + QString::fromLatin1(" XSL Template")).utf8(), name.utf8());
+ KSortableValueList<TQString, TQString> templates;
+ for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
+ TQFileInfo fi(*it);
+ TQString file = fi.fileName().section('.', 0, -2);
+ TQString name = file;
+ name.tqreplace('_', ' ');
+ TQString title = i18n((name + TQString::tqfromLatin1(" XSL Template")).utf8(), name.utf8());
templates.insert(title, file);
}
templates.sort();
- QString s = m_templateCombo->currentText();
+ TQString s = m_templateCombo->currentText();
m_templateCombo->clear();
- for(KSortableValueList<QString, QString>::iterator it2 = templates.begin(); it2 != templates.end(); ++it2) {
+ for(KSortableValueList<TQString, TQString>::iterator it2 = templates.begin(); it2 != templates.end(); ++it2) {
m_templateCombo->insertItem((*it2).index(), (*it2).value());
}
m_templateCombo->setCurrentItem(s);
}
void ConfigDialog::slotInstallTemplate() {
- QString filter = i18n("*.xsl|XSL Files (*.xsl)") + '\n';
+ TQString filter = i18n("*.xsl|XSL Files (*.xsl)") + '\n';
filter += i18n("*.tar.gz *.tgz|Template Packages (*.tar.gz)") + '\n';
filter += i18n("*|All Files");
- KURL u = KFileDialog::getOpenURL(QString::null, filter, this);
+ KURL u = KFileDialog::getOpenURL(TQString(), filter, this);
if(u.isEmpty() || !u.isValid()) {
return;
}
- NewStuff::Manager man(this);
+ NewStuff::Manager man(TQT_TQOBJECT(this));
if(man.installTemplate(u)) {
loadTemplateList();
}
@@ -1034,24 +1034,24 @@ void ConfigDialog::slotDownloadTemplate() {
}
void ConfigDialog::slotDeleteTemplate() {
- QDir dir(Tellico::saveLocation(QString::fromLatin1("entry-templates/")));
- dir.setNameFilter(QString::fromLatin1("*.xsl"));
- dir.setFilter(QDir::Files | QDir::Writable);
- QStringList files = dir.entryList();
- QMap<QString, QString> nameFileMap;
- for(QStringList::Iterator it = files.begin(); it != files.end(); ++it) {
+ TQDir dir(Tellico::saveLocation(TQString::tqfromLatin1("entry-templates/")));
+ dir.setNameFilter(TQString::tqfromLatin1("*.xsl"));
+ dir.setFilter(TQDir::Files | TQDir::Writable);
+ TQStringList files = dir.entryList();
+ TQMap<TQString, TQString> nameFileMap;
+ for(TQStringList::Iterator it = files.begin(); it != files.end(); ++it) {
(*it).truncate((*it).length()-4); // remove ".xsl"
- QString name = (*it);
- name.replace('_', ' ');
+ TQString name = (*it);
+ name.tqreplace('_', ' ');
nameFileMap.insert(name, *it);
}
bool ok;
- QString name = KInputDialog::getItem(i18n("Delete Template"),
+ TQString name = KInputDialog::getItem(i18n("Delete Template"),
i18n("Select template to delete:"),
nameFileMap.keys(), 0, false, &ok, this);
if(ok && !name.isEmpty()) {
- QString file = nameFileMap[name];
- NewStuff::Manager man(this);
+ TQString file = nameFileMap[name];
+ NewStuff::Manager man(TQT_TQOBJECT(this));
man.removeTemplate(file);
loadTemplateList();
}
diff --git a/src/configdialog.h b/src/configdialog.h
index 64b5dbf..4bf0fe5 100644
--- a/src/configdialog.h
+++ b/src/configdialog.h
@@ -27,8 +27,8 @@ class KIntNumInput;
class KFontCombo;
class KColorCombo;
-class QCheckBox;
-class QRadioButton;
+class TQCheckBox;
+class TQRadioButton;
namespace Tellico {
class SourceListViewItem;
@@ -47,15 +47,16 @@ namespace Tellico {
*/
class ConfigDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* The constructor sets up the Tabbed dialog pages.
*
- * @param parent A pointer to the parent widget
+ * @param tqparent A pointer to the tqparent widget
* @param name The widget name
*/
- ConfigDialog(QWidget* parent, const char* name=0);
+ ConfigDialog(TQWidget* tqparent, const char* name=0);
virtual ~ConfigDialog();
/**
@@ -99,9 +100,9 @@ private slots:
/**
* Update the help link for a page.
*
- QCheckBox* m_cbWriteImagesInFile; * @param w The page
+ TQCheckBox* m_cbWriteImagesInFile; * @param w The page
*/
- void slotUpdateHelpLink(QWidget* w);
+ void slotUpdateHelpLink(TQWidget* w);
/**
* Create a new Internet source
*/
@@ -114,7 +115,7 @@ private slots:
* Remove a Internet source
*/
void slotRemoveSourceClicked();
- void slotSelectedSourceChanged(QListViewItem* item);
+ void slotSelectedSourceChanged(TQListViewItem* item);
void slotMoveUpSourceClicked();
void slotMoveDownSourceClicked();
void slotNewStuffClicked();
@@ -145,27 +146,27 @@ private:
*/
void readFetchConfig();
- SourceListViewItem* findItem(const QString& path) const;
+ SourceListViewItem* findItem(const TQString& path) const;
void loadTemplateList();
bool m_modifying;
bool m_okClicked;
- QRadioButton* m_rbImageInFile;
- QRadioButton* m_rbImageInAppDir;
- QRadioButton* m_rbImageInLocalDir;
- QCheckBox* m_cbOpenLastFile;
- QCheckBox* m_cbShowTipDay;
- QCheckBox* m_cbCapitalize;
- QCheckBox* m_cbFormat;
+ TQRadioButton* m_rbImageInFile;
+ TQRadioButton* m_rbImageInAppDir;
+ TQRadioButton* m_rbImageInLocalDir;
+ TQCheckBox* m_cbOpenLastFile;
+ TQCheckBox* m_cbShowTipDay;
+ TQCheckBox* m_cbCapitalize;
+ TQCheckBox* m_cbFormat;
KLineEdit* m_leCapitals;
KLineEdit* m_leArticles;
KLineEdit* m_leSuffixes;
KLineEdit* m_lePrefixes;
- QCheckBox* m_cbPrintHeaders;
- QCheckBox* m_cbPrintFormatted;
- QCheckBox* m_cbPrintGrouped;
+ TQCheckBox* m_cbPrintHeaders;
+ TQCheckBox* m_cbPrintFormatted;
+ TQCheckBox* m_cbPrintGrouped;
KIntSpinBox* m_imageWidthBox;
KIntSpinBox* m_imageHeightBox;
@@ -179,9 +180,9 @@ private:
KColorCombo* m_highTextColorCombo;
KListView* m_sourceListView;
- QMap<SourceListViewItem*, Fetch::ConfigWidget*> m_configWidgets;
- QPtrList<Fetch::ConfigWidget> m_newStuffConfigWidgets;
- QPtrList<Fetch::ConfigWidget> m_removedConfigWidgets;
+ TQMap<SourceListViewItem*, Fetch::ConfigWidget*> m_configWidgets;
+ TQPtrList<Fetch::ConfigWidget> m_newStuffConfigWidgets;
+ TQPtrList<Fetch::ConfigWidget> m_removedConfigWidgets;
KPushButton* m_modifySourceBtn;
KPushButton* m_moveUpSourceBtn;
KPushButton* m_moveDownSourceBtn;
@@ -191,22 +192,22 @@ private:
class GeneralFetcherInfo {
public:
- GeneralFetcherInfo(Fetch::Type t, const QString& n, bool o) : type(t), name(n), updateOverwrite(o) {}
+ GeneralFetcherInfo(Fetch::Type t, const TQString& n, bool o) : type(t), name(n), updateOverwrite(o) {}
Fetch::Type type;
- QString name;
+ TQString name;
bool updateOverwrite : 1;
};
class SourceListViewItem : public KListViewItem {
public:
- SourceListViewItem(KListView* parent, const GeneralFetcherInfo& info,
- const QString& groupName = QString::null);
+ SourceListViewItem(KListView* tqparent, const GeneralFetcherInfo& info,
+ const TQString& groupName = TQString());
- SourceListViewItem(KListView* parent, QListViewItem* after,
- const GeneralFetcherInfo& info, const QString& groupName = QString::null);
+ SourceListViewItem(KListView* tqparent, TQListViewItem* after,
+ const GeneralFetcherInfo& info, const TQString& groupName = TQString());
- void setConfigGroup(const QString& s) { m_configGroup = s; }
- const QString& configGroup() const { return m_configGroup; }
+ void setConfigGroup(const TQString& s) { m_configGroup = s; }
+ const TQString& configGroup() const { return m_configGroup; }
const Fetch::Type& fetchType() const { return m_info.type; }
void setUpdateOverwrite(bool b) { m_info.updateOverwrite = b; }
bool updateOverwrite() const { return m_info.updateOverwrite; }
@@ -217,7 +218,7 @@ public:
private:
GeneralFetcherInfo m_info;
- QString m_configGroup;
+ TQString m_configGroup;
bool m_newSource : 1;
Fetch::Fetcher::Ptr m_fetcher;
};
diff --git a/src/controller.cpp b/src/controller.cpp
index 1b3e29b..770ef79 100644
--- a/src/controller.cpp
+++ b/src/controller.cpp
@@ -44,14 +44,14 @@
#include <kaction.h>
#include <ktoolbarbutton.h>
-#include <qpopupmenu.h>
+#include <tqpopupmenu.h>
using Tellico::Controller;
Controller* Controller::s_self = 0;
-Controller::Controller(MainWindow* parent_, const char* name_)
- : QObject(parent_, name_), m_mainWindow(parent_), m_working (false), m_widgetWithSelection(0) {
+Controller::Controller(MainWindow* tqparent_, const char* name_)
+ : TQObject(tqparent_, name_), m_mainWindow(tqparent_), m_working (false), m_widgetWithSelection(0) {
}
void Controller::addObserver(Observer* obs) {
@@ -66,12 +66,12 @@ Tellico::GroupIterator Controller::groupIterator() const {
return GroupIterator(m_mainWindow->m_groupView);
}
-QString Controller::groupBy() const {
+TQString Controller::groupBy() const {
return m_mainWindow->m_groupView->groupBy();
}
-QStringList Controller::expandedGroupBy() const {
- QStringList g = groupBy();
+TQStringList Controller::expandedGroupBy() const {
+ TQStringList g = groupBy();
// special case for pseudo-group
if(g[0] == Data::Collection::s_peopleGroupName) {
g.clear();
@@ -87,15 +87,15 @@ QStringList Controller::expandedGroupBy() const {
return g;
}
-QStringList Controller::sortTitles() const {
- QStringList list;
+TQStringList Controller::sortTitles() const {
+ TQStringList list;
list << m_mainWindow->m_detailedView->sortColumnTitle1();
list << m_mainWindow->m_detailedView->sortColumnTitle2();
list << m_mainWindow->m_detailedView->sortColumnTitle3();
return list;
}
-QStringList Controller::visibleColumns() const {
+TQStringList Controller::visibleColumns() const {
return m_mainWindow->m_detailedView->visibleColumns();
}
@@ -141,11 +141,11 @@ void Controller::slotCollectionAdded(Data::CollPtr coll_) {
updateActions();
- connect(coll_, SIGNAL(signalGroupsModified(Tellico::Data::CollPtr, PtrVector<Tellico::Data::EntryGroup>)),
- m_mainWindow->m_groupView, SLOT(slotModifyGroups(Tellico::Data::CollPtr, PtrVector<Tellico::Data::EntryGroup>)));
+ connect(coll_, TQT_SIGNAL(signalGroupsModified(Tellico::Data::CollPtr, PtrVector<Tellico::Data::EntryGroup>)),
+ m_mainWindow->m_groupView, TQT_SLOT(slotModifyGroups(Tellico::Data::CollPtr, PtrVector<Tellico::Data::EntryGroup>)));
- connect(coll_, SIGNAL(signalRefreshField(Tellico::Data::FieldPtr)),
- this, SLOT(slotRefreshField(Tellico::Data::FieldPtr)));
+ connect(coll_, TQT_SIGNAL(signalRefreshField(Tellico::Data::FieldPtr)),
+ this, TQT_SLOT(slotRefreshField(Tellico::Data::FieldPtr)));
}
void Controller::slotCollectionModified(Data::CollPtr coll_) {
@@ -278,7 +278,7 @@ void Controller::slotClearSelection() {
m_working = false;
}
-void Controller::slotUpdateSelection(QWidget* widget_, const Data::EntryVec& entries_) {
+void Controller::slotUpdateSelection(TQWidget* widget_, const Data::EntryVec& entries_) {
if(m_working) {
return;
}
@@ -336,7 +336,7 @@ void Controller::goEntrySibling(EntryDirection dir_) {
return;
}
// find the widget that has an entry selected
- GUI::ListView* view = ::qt_cast<GUI::ListView*>(m_widgetWithSelection);
+ GUI::ListView* view = ::tqqt_cast<GUI::ListView*>(m_widgetWithSelection);
if(!view) {
return;
}
@@ -406,7 +406,7 @@ void Controller::slotUpdateCurrent(const Data::EntryVec& entries_) {
m_working = false;
}
-void Controller::slotUpdateSelectedEntries(const QString& source_) {
+void Controller::slotUpdateSelectedEntries(const TQString& source_) {
if(m_selectedEntries.isEmpty()) {
return;
}
@@ -429,24 +429,24 @@ void Controller::slotDeleteSelectedEntries() {
// confirm delete
if(m_selectedEntries.count() == 1) {
- QString str = i18n("Do you really want to delete this entry?");
- QString dontAsk = QString::fromLatin1("DeleteEntry");
+ TQString str = i18n("Do you really want to delete this entry?");
+ TQString dontAsk = TQString::tqfromLatin1("DeleteEntry");
int ret = KMessageBox::warningContinueCancel(Kernel::self()->widget(), str, i18n("Delete Entry"),
- KGuiItem(i18n("&Delete"), QString::fromLatin1("editdelete")), dontAsk);
+ KGuiItem(i18n("&Delete"), TQString::tqfromLatin1("editdelete")), dontAsk);
if(ret != KMessageBox::Continue) {
return;
}
} else {
- QStringList names;
+ TQStringList names;
for(Data::EntryVecIt entry = m_selectedEntries.begin(); entry != m_selectedEntries.end(); ++entry) {
names += entry->title();
}
- QString str = i18n("Do you really want to delete these entries?");
+ TQString str = i18n("Do you really want to delete these entries?");
// historically called DeleteMultipleBooks, don't change
- QString dontAsk = QString::fromLatin1("DeleteMultipleBooks");
+ TQString dontAsk = TQString::tqfromLatin1("DeleteMultipleBooks");
int ret = KMessageBox::warningContinueCancelList(Kernel::self()->widget(), str, names,
i18n("Delete Multiple Entries"),
- KGuiItem(i18n("&Delete"), QString::fromLatin1("editdelete")), dontAsk);
+ KGuiItem(i18n("&Delete"), TQString::tqfromLatin1("editdelete")), dontAsk);
if(ret != KMessageBox::Continue) {
return;
}
@@ -545,7 +545,7 @@ void Controller::editEntry(Data::EntryPtr) const {
m_mainWindow->slotShowEntryEditor();
}
-void Controller::plugCollectionActions(QPopupMenu* popup_) {
+void Controller::plugCollectionActions(TQPopupMenu* popup_) {
if(!popup_) {
return;
}
@@ -555,7 +555,7 @@ void Controller::plugCollectionActions(QPopupMenu* popup_) {
m_mainWindow->action("change_entry_grouping")->plug(popup_);
}
-void Controller::plugEntryActions(QPopupMenu* popup_) {
+void Controller::plugEntryActions(TQPopupMenu* popup_) {
if(!popup_) {
return;
}
@@ -573,11 +573,11 @@ void Controller::plugEntryActions(QPopupMenu* popup_) {
m_mainWindow->m_checkOutEntry->plug(popup_);
}
-void Controller::plugUpdateMenu(QPopupMenu* popup_) {
- QPopupMenu* updatePopup = 0;
+void Controller::plugUpdateMenu(TQPopupMenu* popup_) {
+ TQPopupMenu* updatePopup = 0;
const uint count = popup_->count();
for(uint i = 0; i < count; ++i) {
- QMenuItem* item = popup_->findItem(popup_->idAt(i));
+ TQMenuItem* item = popup_->tqfindItem(popup_->idAt(i));
if(item && item->text() == m_mainWindow->m_updateEntryMenu->text()) {
updatePopup = item->popup();
break;
@@ -591,7 +591,7 @@ void Controller::plugUpdateMenu(QPopupMenu* popup_) {
// I can't figure out why the actions get duplicated, but they do
// so clear them all
m_mainWindow->m_updateAll->unplug(updatePopup);
- for(QPtrListIterator<KAction> it(m_mainWindow->m_fetchActions); it.current(); ++it) {
+ for(TQPtrListIterator<KAction> it(m_mainWindow->m_fetchActions); it.current(); ++it) {
it.current()->unplug(updatePopup);
}
@@ -600,16 +600,16 @@ void Controller::plugUpdateMenu(QPopupMenu* popup_) {
m_mainWindow->m_updateAll->plug(updatePopup);
updatePopup->insertSeparator();
- for(QPtrListIterator<KAction> it(m_mainWindow->m_fetchActions); it.current(); ++it) {
+ for(TQPtrListIterator<KAction> it(m_mainWindow->m_fetchActions); it.current(); ++it) {
it.current()->plug(updatePopup);
}
}
void Controller::updateActions() const {
bool emptySelection = m_selectedEntries.isEmpty();
- m_mainWindow->stateChanged(QString::fromLatin1("empty_selection"),
+ m_mainWindow->stateChanged(TQString::tqfromLatin1("empty_selection"),
emptySelection ? KXMLGUIClient::StateNoReverse : KXMLGUIClient::StateReverse);
- for(QPtrListIterator<KAction> it(m_mainWindow->m_fetchActions); it.current(); ++it) {
+ for(TQPtrListIterator<KAction> it(m_mainWindow->m_fetchActions); it.current(); ++it) {
it.current()->setEnabled(!emptySelection);
}
//only enable citation items when it's a bibliography
@@ -674,12 +674,12 @@ void Controller::slotCheckOut() {
Data::EntryVec loanedEntries = m_selectedEntries;
// check to see if any of the entries are already on-loan, and warn user
- QMap<QString, Data::EntryPtr> alreadyLoaned;
+ TQMap<TQString, Data::EntryPtr> alreadyLoaned;
const Data::BorrowerVec& borrowers = Data::Document::self()->collection()->borrowers();
for(Data::BorrowerVec::ConstIterator it = borrowers.begin(); it != borrowers.end(); ++it) {
const Data::LoanVec& loans = it->loans();
for(Data::LoanVec::ConstIterator it2 = loans.begin(); it2 != loans.end(); ++it2) {
- if(m_selectedEntries.contains(it2->entry())) {
+ if(m_selectedEntries.tqcontains(it2->entry())) {
alreadyLoaned.insert(it2->entry()->title(), it2->entry());
}
}
@@ -691,8 +691,8 @@ void Controller::slotCheckOut() {
"times. They will be removed from the list of items "
"to lend."),
alreadyLoaned.keys());
- QMapConstIterator<QString, Data::EntryPtr> it = alreadyLoaned.constBegin();
- QMapConstIterator<QString, Data::EntryPtr> end = alreadyLoaned.constEnd();
+ TQMapConstIterator<TQString, Data::EntryPtr> it = alreadyLoaned.constBegin();
+ TQMapConstIterator<TQString, Data::EntryPtr> end = alreadyLoaned.constEnd();
for( ; it != end; ++it) {
loanedEntries.remove(it.data());
}
@@ -748,7 +748,7 @@ void Controller::hideTabs() const {
inline
bool Controller::canCheckIn() const {
for(Data::EntryVec::ConstIterator entry = m_selectedEntries.begin(); entry != m_selectedEntries.end(); ++entry) {
- if(entry->field(QString::fromLatin1("loaned")) == Latin1Literal("true")) {
+ if(entry->field(TQString::tqfromLatin1("loaned")) == Latin1Literal("true")) {
return true;
}
}
diff --git a/src/controller.h b/src/controller.h
index 58c3917..462d0bb 100644
--- a/src/controller.h
+++ b/src/controller.h
@@ -14,7 +14,7 @@
#ifndef TELLICOCONTROLLER_H
#define TELLICOCONTROLLER_H
-class QPopupMenu;
+class TQPopupMenu;
namespace Tellico {
class MainWindow;
@@ -27,7 +27,7 @@ namespace Tellico {
#include "entry.h"
-#include <qobject.h>
+#include <tqobject.h>
namespace Tellico {
class Observer;
@@ -35,16 +35,17 @@ class Observer;
/**
* @author Robby Stephenson
*/
-class Controller : public QObject {
+class Controller : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
static Controller* self() { return s_self; }
/**
* Initializes the singleton. Should just be called once, from Tellico::MainWindow
*/
- static void init(MainWindow* parent, const char* name=0) {
- if(!s_self) s_self = new Controller(parent, name);
+ static void init(MainWindow* tqparent, const char* name=0) {
+ if(!s_self) s_self = new Controller(tqparent, name);
}
const Data::EntryVec& selectedEntries() const { return m_selectedEntries; }
@@ -55,11 +56,11 @@ public:
/**
* Plug the default collection actions into a widget
*/
- void plugCollectionActions(QPopupMenu* popup);
+ void plugCollectionActions(TQPopupMenu* popup);
/**
* Plug the default entry actions into a widget
*/
- void plugEntryActions(QPopupMenu* popup);
+ void plugEntryActions(TQPopupMenu* popup);
void updateActions() const;
GroupIterator groupIterator() const;
@@ -68,21 +69,21 @@ public:
* That field name may not be an actual field in the collection, since
* pseudo-groups like _people exist.
*/
- QString groupBy() const;
+ TQString groupBy() const;
/**
* Returns a list of the fields being used to group the entries.
* For ordinary fields, the list has a single item, the field name.
* For the pseudo-group _people, all the people fields are included.
*/
- QStringList expandedGroupBy() const;
+ TQStringList expandedGroupBy() const;
/**
* Returns a list of the titles of the fields being used to sort the entries in the detailed column view.
*/
- QStringList sortTitles() const;
+ TQStringList sortTitles() const;
/**
* Returns the title of the fields currently visible in the detailed column view.
*/
- QStringList visibleColumns() const;
+ TQStringList visibleColumns() const;
void addObserver(Observer* obs);
void removeObserver(Observer* obs);
@@ -107,7 +108,7 @@ public:
public slots:
/**
* When a collection is added to the document, certain actions need to be taken
- * by the parent app. The collection toolbar is updated, the entry count is set, and
+ * by the tqparent app. The collection toolbar is updated, the entry count is set, and
* the collection's modified signal is connected to the @ref GroupView widget.
*
* @param coll A pointer to the collection being added
@@ -130,10 +131,10 @@ public slots:
* @param widget The widget doing the selecting, if NULL, then use previous
* @param entries The list of selected entries
*/
- void slotUpdateSelection(QWidget* widget, const Tellico::Data::EntryVec& entries);
+ void slotUpdateSelection(TQWidget* widget, const Tellico::Data::EntryVec& entries);
void slotUpdateCurrent(const Tellico::Data::EntryVec& entries);
void slotCopySelectedEntries();
- void slotUpdateSelectedEntries(const QString& source);
+ void slotUpdateSelectedEntries(const TQString& source);
void slotDeleteSelectedEntries();
void slotMergeSelectedEntries();
void slotUpdateFilter(Tellico::FilterPtr filter);
@@ -148,11 +149,11 @@ signals:
private:
static Controller* s_self;
- Controller(MainWindow* parent, const char* name);
+ Controller(MainWindow* tqparent, const char* name);
void blockAllSignals(bool block) const;
bool canCheckIn() const;
- void plugUpdateMenu(QPopupMenu* popup);
+ void plugUpdateMenu(TQPopupMenu* popup);
enum EntryDirection { PrevEntry, NextEntry };
void goEntrySibling(EntryDirection dir);
@@ -168,7 +169,7 @@ private:
*/
Data::EntryVec m_selectedEntries;
Data::EntryVec m_currentEntries;
- QWidget* m_widgetWithSelection;
+ TQWidget* m_widgetWithSelection;
};
} // end namespace
diff --git a/src/core/dcopinterface.cpp b/src/core/dcopinterface.cpp
index f375b6b..bd7014c 100644
--- a/src/core/dcopinterface.cpp
+++ b/src/core/dcopinterface.cpp
@@ -22,8 +22,8 @@
using Tellico::ApplicationInterface;
using Tellico::CollectionInterface;
-Tellico::Import::Action ApplicationInterface::actionType(const QString& actionName) {
- QString name = actionName.lower();
+Tellico::Import::Action ApplicationInterface::actionType(const TQString& actionName) {
+ TQString name = actionName.lower();
if(name == Latin1Literal("append")) {
return Import::Append;
} else if(name == Latin1Literal("merge")) {
@@ -32,8 +32,8 @@ Tellico::Import::Action ApplicationInterface::actionType(const QString& actionNa
return Import::Replace;
}
-QValueList<long> ApplicationInterface::selectedEntries() const {
- QValueList<long> ids;
+TQValueList<long> ApplicationInterface::selectedEntries() const {
+ TQValueList<long> ids;
Data::EntryVec entries = Controller::self()->selectedEntries();
for(Data::EntryVecIt entry = entries.begin(); entry != entries.end(); ++entry) {
ids << entry->id();
@@ -41,8 +41,8 @@ QValueList<long> ApplicationInterface::selectedEntries() const {
return ids;
}
-QValueList<long> ApplicationInterface::filteredEntries() const {
- QValueList<long> ids;
+TQValueList<long> ApplicationInterface::filteredEntries() const {
+ TQValueList<long> ids;
Data::EntryVec entries = Controller::self()->visibleEntries();
for(Data::EntryVecIt entry = entries.begin(); entry != entries.end(); ++entry) {
ids << entry->id();
@@ -73,8 +73,8 @@ bool CollectionInterface::removeEntry(long id_) {
return coll->entryById(id_) == 0;
}
-QStringList CollectionInterface::values(const QString& fieldName_) const {
- QStringList results;
+TQStringList CollectionInterface::values(const TQString& fieldName_) const {
+ TQStringList results;
Data::CollPtr coll = Data::Document::self()->collection();
if(!coll) {
return results;
@@ -93,8 +93,8 @@ QStringList CollectionInterface::values(const QString& fieldName_) const {
return results;
}
-QStringList CollectionInterface::values(long id_, const QString& fieldName_) const {
- QStringList results;
+TQStringList CollectionInterface::values(long id_, const TQString& fieldName_) const {
+ TQStringList results;
Data::CollPtr coll = Data::Document::self()->collection();
if(!coll) {
return results;
@@ -113,27 +113,27 @@ QStringList CollectionInterface::values(long id_, const QString& fieldName_) con
return results;
}
-QStringList CollectionInterface::bibtexKeys() const {
+TQStringList CollectionInterface::bibtexKeys() const {
Data::CollPtr coll = Data::Document::self()->collection();
if(!coll || coll->type() != Data::Collection::Bibtex) {
- return QStringList();
+ return TQStringList();
}
return BibtexHandler::bibtexKeys(Controller::self()->selectedEntries());
}
-QString CollectionInterface::bibtexKey(long id_) const {
+TQString CollectionInterface::bibtexKey(long id_) const {
Data::CollPtr coll = Data::Document::self()->collection();
if(!coll || coll->type() != Data::Collection::Bibtex) {
- return QString();
+ return TQString();
}
Data::EntryPtr entry = coll->entryById(id_);
if(!entry) {
- return QString();
+ return TQString();
}
return BibtexHandler::bibtexKeys(entry).first();
}
-bool CollectionInterface::setFieldValue(long id_, const QString& fieldName_, const QString& value_) {
+bool CollectionInterface::setFieldValue(long id_, const TQString& fieldName_, const TQString& value_) {
Data::CollPtr coll = Data::Document::self()->collection();
if(!coll) {
return false;
@@ -150,7 +150,7 @@ bool CollectionInterface::setFieldValue(long id_, const QString& fieldName_, con
return true;
}
-bool CollectionInterface::addFieldValue(long id_, const QString& fieldName_, const QString& value_) {
+bool CollectionInterface::addFieldValue(long id_, const TQString& fieldName_, const TQString& value_) {
Data::CollPtr coll = Data::Document::self()->collection();
if(!coll) {
return false;
@@ -160,10 +160,10 @@ bool CollectionInterface::addFieldValue(long id_, const QString& fieldName_, con
return false;
}
Data::EntryPtr oldEntry = new Data::Entry(*entry);
- QStringList values = entry->fields(fieldName_, false);
- QStringList newValues = values;
+ TQStringList values = entry->fields(fieldName_, false);
+ TQStringList newValues = values;
newValues << value_;
- if(!entry->setField(fieldName_, newValues.join(QString::fromLatin1("; ")))) {
+ if(!entry->setField(fieldName_, newValues.join(TQString::tqfromLatin1("; ")))) {
return false;
}
Kernel::self()->modifyEntries(oldEntry, entry);
diff --git a/src/core/dcopinterface.h b/src/core/dcopinterface.h
index 018de80..e0c6c73 100644
--- a/src/core/dcopinterface.h
+++ b/src/core/dcopinterface.h
@@ -19,40 +19,40 @@
#include <dcopobject.h>
#include <kurl.h>
-#include <qstringlist.h> // used in generated dcopinterface_skel.cpp
+#include <tqstringlist.h> // used in generated dcopinterface_skel.cpp
namespace Tellico {
class ApplicationInterface : public DCOPObject {
K_DCOP
k_dcop:
- bool importTellico(const QString& file, const QString& action)
+ bool importTellico(const TQString& file, const TQString& action)
{ return importFile(Import::TellicoXML, KURL::fromPathOrURL(file), actionType(action)); }
- bool importBibtex(const QString& file, const QString& action)
+ bool importBibtex(const TQString& file, const TQString& action)
{ return importFile(Import::Bibtex, KURL::fromPathOrURL(file), actionType(action)); }
- bool importMODS(const QString& file, const QString& action)
+ bool importMODS(const TQString& file, const TQString& action)
{ return importFile(Import::MODS, KURL::fromPathOrURL(file), actionType(action)); }
- bool importRIS(const QString& file, const QString& action)
+ bool importRIS(const TQString& file, const TQString& action)
{ return importFile(Import::RIS, KURL::fromPathOrURL(file), actionType(action)); }
- bool exportXML(const QString& file)
+ bool exportXML(const TQString& file)
{ return exportCollection(Export::TellicoXML, KURL::fromPathOrURL(file)); }
- bool exportZip(const QString& file)
+ bool exportZip(const TQString& file)
{ return exportCollection(Export::TellicoZip, KURL::fromPathOrURL(file)); }
- bool exportBibtex(const QString& file)
+ bool exportBibtex(const TQString& file)
{ return exportCollection(Export::Bibtex, KURL::fromPathOrURL(file)); }
- bool exportHTML(const QString& file)
+ bool exportHTML(const TQString& file)
{ return exportCollection(Export::HTML, KURL::fromPathOrURL(file)); }
- bool exportCSV(const QString& file)
+ bool exportCSV(const TQString& file)
{ return exportCollection(Export::CSV, KURL::fromPathOrURL(file)); }
- bool exportPilotDB(const QString& file)
+ bool exportPilotDB(const TQString& file)
{ return exportCollection(Export::PilotDB, KURL::fromPathOrURL(file)); }
- QValueList<long> selectedEntries() const;
- QValueList<long> filteredEntries() const;
+ TQValueList<long> selectedEntries() const;
+ TQValueList<long> filteredEntries() const;
- virtual void openFile(const QString& file) = 0;
- virtual void setFilter(const QString& text) = 0;
+ virtual void openFile(const TQString& file) = 0;
+ virtual void setFilter(const TQString& text) = 0;
virtual bool showEntry(long id) = 0;
protected:
@@ -61,24 +61,27 @@ protected:
virtual bool exportCollection(Export::Format format, const KURL& url) = 0;
private:
- Import::Action actionType(const QString& actionName);
+ Import::Action actionType(const TQString& actionName);
};
class CollectionInterface : public DCOPObject {
K_DCOP
k_dcop:
- CollectionInterface() : DCOPObject("collection") {}
-
long addEntry();
bool removeEntry(long entryID);
- QStringList values(const QString& fieldName) const;
- QStringList values(long entryID, const QString& fieldName) const;
- QStringList bibtexKeys() const;
- QString bibtexKey(long entryID) const;
+ TQStringList values(const TQString& fieldName) const;
+ TQStringList values(long entryID, const TQString& fieldName) const;
+ TQStringList bibtexKeys() const;
+ TQString bibtexKey(long entryID) const;
+
+ bool setFieldValue(long entryID, const TQString& fieldName, const TQString& value);
+ bool addFieldValue(long entryID, const TQString& fieldName, const TQString& value);
- bool setFieldValue(long entryID, const QString& fieldName, const QString& value);
- bool addFieldValue(long entryID, const QString& fieldName, const QString& value);
+ friend class MainWindow;
+
+protected:
+ CollectionInterface() : DCOPObject("collection") {}
};
} // end namespace
diff --git a/src/core/dcopinterface_skel.cpp b/src/core/dcopinterface_skel.cpp
index 9edf4ad..49bdce0 100644
--- a/src/core/dcopinterface_skel.cpp
+++ b/src/core/dcopinterface_skel.cpp
@@ -9,26 +9,26 @@
#include "./dcopinterface.h"
#include <kdatastream.h>
-#include <qasciidict.h>
+#include <tqasciidict.h>
namespace Tellico {
static const int ApplicationInterface_fhash = 17;
static const char* const ApplicationInterface_ftable[16][3] = {
- { "bool", "importTellico(QString,QString)", "importTellico(QString file,QString action)" },
- { "bool", "importBibtex(QString,QString)", "importBibtex(QString file,QString action)" },
- { "bool", "importMODS(QString,QString)", "importMODS(QString file,QString action)" },
- { "bool", "importRIS(QString,QString)", "importRIS(QString file,QString action)" },
- { "bool", "exportXML(QString)", "exportXML(QString file)" },
- { "bool", "exportZip(QString)", "exportZip(QString file)" },
- { "bool", "exportBibtex(QString)", "exportBibtex(QString file)" },
- { "bool", "exportHTML(QString)", "exportHTML(QString file)" },
- { "bool", "exportCSV(QString)", "exportCSV(QString file)" },
- { "bool", "exportPilotDB(QString)", "exportPilotDB(QString file)" },
- { "QValueList<long int>", "selectedEntries()", "selectedEntries()" },
- { "QValueList<long int>", "filteredEntries()", "filteredEntries()" },
- { "void", "openFile(QString)", "openFile(QString file)" },
- { "void", "setFilter(QString)", "setFilter(QString text)" },
+ { "bool", "importTellico(TQString,TQString)", "importTellico(TQString file,TQString action)" },
+ { "bool", "importBibtex(TQString,TQString)", "importBibtex(TQString file,TQString action)" },
+ { "bool", "importMODS(TQString,TQString)", "importMODS(TQString file,TQString action)" },
+ { "bool", "importRIS(TQString,TQString)", "importRIS(TQString file,TQString action)" },
+ { "bool", "exportXML(TQString)", "exportXML(TQString file)" },
+ { "bool", "exportZip(TQString)", "exportZip(TQString file)" },
+ { "bool", "exportBibtex(TQString)", "exportBibtex(TQString file)" },
+ { "bool", "exportHTML(TQString)", "exportHTML(TQString file)" },
+ { "bool", "exportCSV(TQString)", "exportCSV(TQString file)" },
+ { "bool", "exportPilotDB(TQString)", "exportPilotDB(TQString file)" },
+ { "TQValueList<long int>", "selectedEntries()", "selectedEntries()" },
+ { "TQValueList<long int>", "filteredEntries()", "filteredEntries()" },
+ { "void", "openFile(TQString)", "openFile(TQString file)" },
+ { "void", "setFilter(TQString)", "setFilter(TQString text)" },
{ "bool", "showEntry(long int)", "showEntry(long int id)" },
{ 0, 0, 0 }
};
@@ -50,139 +50,139 @@ static const int ApplicationInterface_ftable_hiddens[15] = {
0,
};
-bool ApplicationInterface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
+bool ApplicationInterface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
- static QAsciiDict<int>* fdict = 0;
+ static TQAsciiDict<int>* fdict = 0;
if ( !fdict ) {
- fdict = new QAsciiDict<int>( ApplicationInterface_fhash, true, false );
+ fdict = new TQAsciiDict<int>( ApplicationInterface_fhash, true, false );
for ( int i = 0; ApplicationInterface_ftable[i][1]; i++ )
fdict->insert( ApplicationInterface_ftable[i][1], new int( i ) );
}
- int* fp = fdict->find( fun );
+ int* fp = fdict->tqfind( fun );
switch ( fp?*fp:-1) {
- case 0: { // bool importTellico(QString,QString)
- QString arg0;
- QString arg1;
- QDataStream arg( data, IO_ReadOnly );
+ case 0: { // bool importTellico(TQString,TQString)
+ TQString arg0;
+ TQString arg1;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
if (arg.atEnd()) return false;
arg >> arg1;
replyType = ApplicationInterface_ftable[0][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << importTellico(arg0, arg1 );
} break;
- case 1: { // bool importBibtex(QString,QString)
- QString arg0;
- QString arg1;
- QDataStream arg( data, IO_ReadOnly );
+ case 1: { // bool importBibtex(TQString,TQString)
+ TQString arg0;
+ TQString arg1;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
if (arg.atEnd()) return false;
arg >> arg1;
replyType = ApplicationInterface_ftable[1][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << importBibtex(arg0, arg1 );
} break;
- case 2: { // bool importMODS(QString,QString)
- QString arg0;
- QString arg1;
- QDataStream arg( data, IO_ReadOnly );
+ case 2: { // bool importMODS(TQString,TQString)
+ TQString arg0;
+ TQString arg1;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
if (arg.atEnd()) return false;
arg >> arg1;
replyType = ApplicationInterface_ftable[2][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << importMODS(arg0, arg1 );
} break;
- case 3: { // bool importRIS(QString,QString)
- QString arg0;
- QString arg1;
- QDataStream arg( data, IO_ReadOnly );
+ case 3: { // bool importRIS(TQString,TQString)
+ TQString arg0;
+ TQString arg1;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
if (arg.atEnd()) return false;
arg >> arg1;
replyType = ApplicationInterface_ftable[3][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << importRIS(arg0, arg1 );
} break;
- case 4: { // bool exportXML(QString)
- QString arg0;
- QDataStream arg( data, IO_ReadOnly );
+ case 4: { // bool exportXML(TQString)
+ TQString arg0;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = ApplicationInterface_ftable[4][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << exportXML(arg0 );
} break;
- case 5: { // bool exportZip(QString)
- QString arg0;
- QDataStream arg( data, IO_ReadOnly );
+ case 5: { // bool exportZip(TQString)
+ TQString arg0;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = ApplicationInterface_ftable[5][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << exportZip(arg0 );
} break;
- case 6: { // bool exportBibtex(QString)
- QString arg0;
- QDataStream arg( data, IO_ReadOnly );
+ case 6: { // bool exportBibtex(TQString)
+ TQString arg0;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = ApplicationInterface_ftable[6][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << exportBibtex(arg0 );
} break;
- case 7: { // bool exportHTML(QString)
- QString arg0;
- QDataStream arg( data, IO_ReadOnly );
+ case 7: { // bool exportHTML(TQString)
+ TQString arg0;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = ApplicationInterface_ftable[7][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << exportHTML(arg0 );
} break;
- case 8: { // bool exportCSV(QString)
- QString arg0;
- QDataStream arg( data, IO_ReadOnly );
+ case 8: { // bool exportCSV(TQString)
+ TQString arg0;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = ApplicationInterface_ftable[8][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << exportCSV(arg0 );
} break;
- case 9: { // bool exportPilotDB(QString)
- QString arg0;
- QDataStream arg( data, IO_ReadOnly );
+ case 9: { // bool exportPilotDB(TQString)
+ TQString arg0;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = ApplicationInterface_ftable[9][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << exportPilotDB(arg0 );
} break;
- case 10: { // QValueList<long int> selectedEntries()
+ case 10: { // TQValueList<long int> selectedEntries()
replyType = ApplicationInterface_ftable[10][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << selectedEntries( );
} break;
- case 11: { // QValueList<long int> filteredEntries()
+ case 11: { // TQValueList<long int> filteredEntries()
replyType = ApplicationInterface_ftable[11][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << filteredEntries( );
} break;
- case 12: { // void openFile(QString)
- QString arg0;
- QDataStream arg( data, IO_ReadOnly );
+ case 12: { // void openFile(TQString)
+ TQString arg0;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = ApplicationInterface_ftable[12][0];
openFile(arg0 );
} break;
- case 13: { // void setFilter(QString)
- QString arg0;
- QDataStream arg( data, IO_ReadOnly );
+ case 13: { // void setFilter(TQString)
+ TQString arg0;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = ApplicationInterface_ftable[13][0];
@@ -190,11 +190,11 @@ bool ApplicationInterface::process(const QCString &fun, const QByteArray &data,
} break;
case 14: { // bool showEntry(long int)
long int arg0;
- QDataStream arg( data, IO_ReadOnly );
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = ApplicationInterface_ftable[14][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << showEntry(arg0 );
} break;
default:
@@ -216,7 +216,7 @@ QCStringList ApplicationInterface::functions()
for ( int i = 0; ApplicationInterface_ftable[i][2]; i++ ) {
if (ApplicationInterface_ftable_hiddens[i])
continue;
- QCString func = ApplicationInterface_ftable[i][0];
+ TQCString func = ApplicationInterface_ftable[i][0];
func += ' ';
func += ApplicationInterface_ftable[i][2];
funcs << func;
@@ -227,7 +227,7 @@ QCStringList ApplicationInterface::functions()
} // namespace
#include <kdatastream.h>
-#include <qasciidict.h>
+#include <tqasciidict.h>
namespace Tellico {
@@ -235,12 +235,12 @@ static const int CollectionInterface_fhash = 11;
static const char* const CollectionInterface_ftable[9][3] = {
{ "long int", "addEntry()", "addEntry()" },
{ "bool", "removeEntry(long int)", "removeEntry(long int entryID)" },
- { "QStringList", "values(QString)", "values(QString fieldName)" },
- { "QStringList", "values(long int,QString)", "values(long int entryID,QString fieldName)" },
- { "QStringList", "bibtexKeys()", "bibtexKeys()" },
- { "QString", "bibtexKey(long int)", "bibtexKey(long int entryID)" },
- { "bool", "setFieldValue(long int,QString,QString)", "setFieldValue(long int entryID,QString fieldName,QString value)" },
- { "bool", "addFieldValue(long int,QString,QString)", "addFieldValue(long int entryID,QString fieldName,QString value)" },
+ { TQSTRINGLIST_OBJECT_NAME_STRING, "values(TQString)", "values(TQString fieldName)" },
+ { TQSTRINGLIST_OBJECT_NAME_STRING, "values(long int,TQString)", "values(long int entryID,TQString fieldName)" },
+ { TQSTRINGLIST_OBJECT_NAME_STRING, "bibtexKeys()", "bibtexKeys()" },
+ { TQSTRING_OBJECT_NAME_STRING, "bibtexKey(long int)", "bibtexKey(long int entryID)" },
+ { "bool", "setFieldValue(long int,TQString,TQString)", "setFieldValue(long int entryID,TQString fieldName,TQString value)" },
+ { "bool", "addFieldValue(long int,TQString,TQString)", "addFieldValue(long int entryID,TQString fieldName,TQString value)" },
{ 0, 0, 0 }
};
static const int CollectionInterface_ftable_hiddens[8] = {
@@ -254,70 +254,70 @@ static const int CollectionInterface_ftable_hiddens[8] = {
0,
};
-bool CollectionInterface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
+bool CollectionInterface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
- static QAsciiDict<int>* fdict = 0;
+ static TQAsciiDict<int>* fdict = 0;
if ( !fdict ) {
- fdict = new QAsciiDict<int>( CollectionInterface_fhash, true, false );
+ fdict = new TQAsciiDict<int>( CollectionInterface_fhash, true, false );
for ( int i = 0; CollectionInterface_ftable[i][1]; i++ )
fdict->insert( CollectionInterface_ftable[i][1], new int( i ) );
}
- int* fp = fdict->find( fun );
+ int* fp = fdict->tqfind( fun );
switch ( fp?*fp:-1) {
case 0: { // long int addEntry()
replyType = CollectionInterface_ftable[0][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << addEntry( );
} break;
case 1: { // bool removeEntry(long int)
long int arg0;
- QDataStream arg( data, IO_ReadOnly );
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = CollectionInterface_ftable[1][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << removeEntry(arg0 );
} break;
- case 2: { // QStringList values(QString)
- QString arg0;
- QDataStream arg( data, IO_ReadOnly );
+ case 2: { // TQStringList values(TQString)
+ TQString arg0;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = CollectionInterface_ftable[2][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << values(arg0 );
} break;
- case 3: { // QStringList values(long int,QString)
+ case 3: { // TQStringList values(long int,TQString)
long int arg0;
- QString arg1;
- QDataStream arg( data, IO_ReadOnly );
+ TQString arg1;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
if (arg.atEnd()) return false;
arg >> arg1;
replyType = CollectionInterface_ftable[3][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << values(arg0, arg1 );
} break;
- case 4: { // QStringList bibtexKeys()
+ case 4: { // TQStringList bibtexKeys()
replyType = CollectionInterface_ftable[4][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << bibtexKeys( );
} break;
- case 5: { // QString bibtexKey(long int)
+ case 5: { // TQString bibtexKey(long int)
long int arg0;
- QDataStream arg( data, IO_ReadOnly );
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
replyType = CollectionInterface_ftable[5][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << bibtexKey(arg0 );
} break;
- case 6: { // bool setFieldValue(long int,QString,QString)
+ case 6: { // bool setFieldValue(long int,TQString,TQString)
long int arg0;
- QString arg1;
- QString arg2;
- QDataStream arg( data, IO_ReadOnly );
+ TQString arg1;
+ TQString arg2;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
if (arg.atEnd()) return false;
@@ -325,14 +325,14 @@ bool CollectionInterface::process(const QCString &fun, const QByteArray &data, Q
if (arg.atEnd()) return false;
arg >> arg2;
replyType = CollectionInterface_ftable[6][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << setFieldValue(arg0, arg1, arg2 );
} break;
- case 7: { // bool addFieldValue(long int,QString,QString)
+ case 7: { // bool addFieldValue(long int,TQString,TQString)
long int arg0;
- QString arg1;
- QString arg2;
- QDataStream arg( data, IO_ReadOnly );
+ TQString arg1;
+ TQString arg2;
+ TQDataStream arg( data, IO_ReadOnly );
if (arg.atEnd()) return false;
arg >> arg0;
if (arg.atEnd()) return false;
@@ -340,7 +340,7 @@ bool CollectionInterface::process(const QCString &fun, const QByteArray &data, Q
if (arg.atEnd()) return false;
arg >> arg2;
replyType = CollectionInterface_ftable[7][0];
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << addFieldValue(arg0, arg1, arg2 );
} break;
default:
@@ -362,7 +362,7 @@ QCStringList CollectionInterface::functions()
for ( int i = 0; CollectionInterface_ftable[i][2]; i++ ) {
if (CollectionInterface_ftable_hiddens[i])
continue;
- QCString func = CollectionInterface_ftable[i][0];
+ TQCString func = CollectionInterface_ftable[i][0];
func += ' ';
func += CollectionInterface_ftable[i][2];
funcs << func;
diff --git a/src/core/drophandler.cpp b/src/core/drophandler.cpp
index e27df9d..6deb2e1 100644
--- a/src/core/drophandler.cpp
+++ b/src/core/drophandler.cpp
@@ -21,7 +21,7 @@
using Tellico::DropHandler;
-DropHandler::DropHandler(QObject* parent_) : QObject(parent_) {
+DropHandler::DropHandler(TQObject* tqparent_) : TQObject(tqparent_) {
}
DropHandler::~DropHandler() {
@@ -29,30 +29,30 @@ DropHandler::~DropHandler() {
// assume the object is always the main window, that's the
// only object with this event filter
-bool DropHandler::eventFilter(QObject* obj_, QEvent* ev_) {
+bool DropHandler::eventFilter(TQObject* obj_, TQEvent* ev_) {
Q_UNUSED(obj_);
- if(ev_->type() == QEvent::DragEnter) {
- return dragEnter(static_cast<QDragEnterEvent*>(ev_));
- } else if(ev_->type() == QEvent::Drop) {
- return drop(static_cast<QDropEvent*>(ev_));
+ if(ev_->type() == TQEvent::DragEnter) {
+ return dragEnter(static_cast<TQDragEnterEvent*>(ev_));
+ } else if(ev_->type() == TQEvent::Drop) {
+ return drop(static_cast<TQDropEvent*>(ev_));
}
return false;
}
-bool DropHandler::dragEnter(QDragEnterEvent* event_) {
- bool accept = KURLDrag::canDecode(event_) || QTextDrag::canDecode(event_);
+bool DropHandler::dragEnter(TQDragEnterEvent* event_) {
+ bool accept = KURLDrag::canDecode(event_) || TQTextDrag::canDecode(event_);
if(accept) {
event_->accept(accept);
}
return accept;
}
-bool DropHandler::drop(QDropEvent* event_) {
+bool DropHandler::drop(TQDropEvent* event_) {
KURL::List urls;
- QString text;
+ TQString text;
if(KURLDrag::decode(event_, urls)) {
- } else if(QTextDrag::decode(event_, text) && !text.isEmpty()) {
+ } else if(TQTextDrag::decode(event_, text) && !text.isEmpty()) {
urls << KURL(text);
}
return !urls.isEmpty() && handleURL(urls);
@@ -63,21 +63,21 @@ bool DropHandler::handleURL(const KURL::List& urls_) {
KURL::List tc, pdf, bib, ris;
for(KURL::List::ConstIterator it = urls_.begin(); it != urls_.end(); ++it) {
KMimeType::Ptr ptr = KMimeType::findByURL(*it);
- if(ptr->is(QString::fromLatin1("application/x-tellico"))) {
+ if(ptr->is(TQString::tqfromLatin1("application/x-tellico"))) {
tc << *it;
- } else if(ptr->is(QString::fromLatin1("application/pdf"))) {
+ } else if(ptr->is(TQString::tqfromLatin1("application/pdf"))) {
pdf << *it;
- } else if(ptr->is(QString::fromLatin1("text/x-bibtex")) ||
- ptr->is(QString::fromLatin1("application/x-bibtex"))) {
+ } else if(ptr->is(TQString::tqfromLatin1("text/x-bibtex")) ||
+ ptr->is(TQString::tqfromLatin1("application/x-bibtex"))) {
bib << *it;
- } else if(ptr->is(QString::fromLatin1("application/x-research-info-systems"))) {
+ } else if(ptr->is(TQString::tqfromLatin1("application/x-research-info-systems"))) {
ris << *it;
} else {
myDebug() << "DropHandler::handleURL() - unrecognized type: " << ptr->name() << " (" << *it << ")" << endl;
hasUnknown = true;
}
}
- MainWindow* mainWindow = ::qt_cast<MainWindow*>(Kernel::self()->widget());
+ MainWindow* mainWindow = ::tqqt_cast<MainWindow*>(Kernel::self()->widget());
if(!mainWindow) {
myDebug() << "DropHandler::handleURL() - no main window!" << endl;
return !hasUnknown;
diff --git a/src/core/drophandler.h b/src/core/drophandler.h
index ac4d146..0c64659 100644
--- a/src/core/drophandler.h
+++ b/src/core/drophandler.h
@@ -14,24 +14,25 @@
#ifndef TELLICO_DROPHANDLER_H
#define TELLICO_DROPHANDLER_H
-#include <qobject.h>
+#include <tqobject.h>
#include <kurl.h>
namespace Tellico {
-class DropHandler : public QObject {
+class DropHandler : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
- DropHandler(QObject* parent);
+ DropHandler(TQObject* tqparent);
~DropHandler();
protected:
- bool eventFilter(QObject* object, QEvent* event);
+ bool eventFilter(TQObject* object, TQEvent* event);
private:
- bool dragEnter(QDragEnterEvent* event);
- bool drop(QDropEvent* event);
+ bool dragEnter(TQDragEnterEvent* event);
+ bool drop(TQDropEvent* event);
bool handleURL(const KURL::List& urls);
};
diff --git a/src/core/netaccess.cpp b/src/core/netaccess.cpp
index 77b6554..ef756cc 100644
--- a/src/core/netaccess.cpp
+++ b/src/core/netaccess.cpp
@@ -22,16 +22,16 @@
#include <kio/previewjob.h>
#include <ktempfile.h>
-#include <qapplication.h>
-#include <qfile.h>
+#include <tqapplication.h>
+#include <tqfile.h>
#include <unistd.h> // for unlink()
using Tellico::NetAccess;
-QStringList* NetAccess::s_tmpFiles = 0;
+TQStringList* NetAccess::s_tmpFiles = 0;
-bool NetAccess::download(const KURL& url_, QString& target_, QWidget* window_) {
+bool NetAccess::download(const KURL& url_, TQString& target_, TQWidget* window_) {
if(url_.isLocalFile()) {
return KIO::NetAccess::download(url_, target_, window_);
}
@@ -45,7 +45,7 @@ bool NetAccess::download(const KURL& url_, QString& target_, QWidget* window_) {
KTempFile tmpFile;
target_ = tmpFile.name();
if(!s_tmpFiles) {
- s_tmpFiles = new QStringList;
+ s_tmpFiles = new TQStringList;
}
s_tmpFiles->append(target_);
}
@@ -57,43 +57,43 @@ bool NetAccess::download(const KURL& url_, QString& target_, QWidget* window_) {
return KIO::NetAccess::synchronousRun(job, window_);
}
-void NetAccess::removeTempFile(const QString& name_) {
+void NetAccess::removeTempFile(const TQString& name_) {
if(!s_tmpFiles) {
return;
}
- if(s_tmpFiles->contains(name_)) {
- ::unlink(QFile::encodeName(name_));
+ if(s_tmpFiles->tqcontains(name_)) {
+ ::unlink(TQFile::encodeName(name_));
s_tmpFiles->remove(name_);
}
}
-QPixmap NetAccess::filePreview(const KURL& url, int size) {
+TQPixmap NetAccess::filePreview(const KURL& url, int size) {
NetAccess netaccess;
KURL::List list;
list.append(url);
KIO::Job* previewJob = KIO::filePreview(list, size, size);
- connect(previewJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
- &netaccess, SLOT(slotPreview(const KFileItem*, const QPixmap&)));
+ connect(previewJob, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)),
+ &netaccess, TQT_SLOT(slotPreview(const KFileItem*, const TQPixmap&)));
KIO::NetAccess::synchronousRun(previewJob, Kernel::self()->widget());
return netaccess.m_preview;
}
-QPixmap NetAccess::filePreview(KFileItem* item, int size) {
+TQPixmap NetAccess::filePreview(KFileItem* item, int size) {
NetAccess netaccess;
KFileItemList list;
list.append(item);
KIO::Job* previewJob = KIO::filePreview(list, size, size);
- connect(previewJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)),
- &netaccess, SLOT(slotPreview(const KFileItem*, const QPixmap&)));
+ connect(previewJob, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)),
+ &netaccess, TQT_SLOT(slotPreview(const KFileItem*, const TQPixmap&)));
KIO::NetAccess::synchronousRun(previewJob, Kernel::self()->widget());
return netaccess.m_preview;
}
-void NetAccess::slotPreview(const KFileItem*, const QPixmap& pix_) {
+void NetAccess::slotPreview(const KFileItem*, const TQPixmap& pix_) {
m_preview = pix_;
}
diff --git a/src/core/netaccess.h b/src/core/netaccess.h
index df11e0d..f793674 100644
--- a/src/core/netaccess.h
+++ b/src/core/netaccess.h
@@ -14,8 +14,8 @@
#ifndef TELLICO_NETACCESS_H
#define TELLICO_NETACCESS_H
-#include <qobject.h>
-#include <qpixmap.h>
+#include <tqobject.h>
+#include <tqpixmap.h>
class KURL;
class KFileItem;
@@ -25,22 +25,23 @@ namespace KIO {
namespace Tellico {
-class NetAccess : public QObject {
+class NetAccess : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
- static bool download(const KURL& u, QString& target, QWidget* window);
- static void removeTempFile(const QString& name);
- static QPixmap filePreview(const KURL& fileName, int size=196);
- static QPixmap filePreview(KFileItem* item, int size=196);
+ static bool download(const KURL& u, TQString& target, TQWidget* window);
+ static void removeTempFile(const TQString& name);
+ static TQPixmap filePreview(const KURL& fileName, int size=196);
+ static TQPixmap filePreview(KFileItem* item, int size=196);
private slots:
- void slotPreview(const KFileItem* item, const QPixmap& pix);
+ void slotPreview(const KFileItem* item, const TQPixmap& pix);
private:
- static QStringList* s_tmpFiles;
+ static TQStringList* s_tmpFiles;
- QPixmap m_preview;
+ TQPixmap m_preview;
};
}
diff --git a/src/core/tellico_config.cpp b/src/core/tellico_config.cpp
index f2050f0..4984cdb 100644
--- a/src/core/tellico_config.cpp
+++ b/src/core/tellico_config.cpp
@@ -21,430 +21,430 @@ Config *Config::self()
}
Config::Config( )
- : KConfigSkeleton( QString::fromLatin1( "tellicorc" ) )
+ : KConfigSkeleton( TQString::tqfromLatin1( "tellicorc" ) )
{
mSelf = this;
- setCurrentGroup( QString::fromLatin1( "TipOfDay" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "TipOfDay" ) );
KConfigSkeleton::ItemBool *itemShowTipOfDay;
- itemShowTipOfDay = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "RunOnStart" ), mShowTipOfDay, true );
- addItem( itemShowTipOfDay, QString::fromLatin1( "showTipOfDay" ) );
+ itemShowTipOfDay = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "RunOnStart" ), mShowTipOfDay, true );
+ addItem( itemShowTipOfDay, TQString::tqfromLatin1( "showTipOfDay" ) );
- setCurrentGroup( QString::fromLatin1( "Main Window Options" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Main Window Options" ) );
- QValueList<int> defaultMainSplitterSizes;
+ TQValueList<int> defaultMainSplitterSizes;
KConfigSkeleton::ItemIntList *itemMainSplitterSizes;
- itemMainSplitterSizes = new KConfigSkeleton::ItemIntList( currentGroup(), QString::fromLatin1( "Main Splitter Sizes" ), mMainSplitterSizes, defaultMainSplitterSizes );
- addItem( itemMainSplitterSizes, QString::fromLatin1( "MainSplitterSizes" ) );
- QValueList<int> defaultSecondarySplitterSizes;
+ itemMainSplitterSizes = new KConfigSkeleton::ItemIntList( currentGroup(), TQString::tqfromLatin1( "Main Splitter Sizes" ), mMainSplitterSizes, defaultMainSplitterSizes );
+ addItem( itemMainSplitterSizes, TQString::tqfromLatin1( "MainSplitterSizes" ) );
+ TQValueList<int> defaultSecondarySplitterSizes;
KConfigSkeleton::ItemIntList *itemSecondarySplitterSizes;
- itemSecondarySplitterSizes = new KConfigSkeleton::ItemIntList( currentGroup(), QString::fromLatin1( "Secondary Splitter Sizes" ), mSecondarySplitterSizes, defaultSecondarySplitterSizes );
- addItem( itemSecondarySplitterSizes, QString::fromLatin1( "SecondarySplitterSizes" ) );
+ itemSecondarySplitterSizes = new KConfigSkeleton::ItemIntList( currentGroup(), TQString::tqfromLatin1( "Secondary Splitter Sizes" ), mSecondarySplitterSizes, defaultSecondarySplitterSizes );
+ addItem( itemSecondarySplitterSizes, TQString::tqfromLatin1( "SecondarySplitterSizes" ) );
- setCurrentGroup( QString::fromLatin1( "Detailed View Options" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Detailed View Options" ) );
KConfigSkeleton::ItemInt *itemMaxPixmapWidth;
- itemMaxPixmapWidth = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "MaxPixmapWidth" ), mMaxPixmapWidth, 50 );
- addItem( itemMaxPixmapWidth, QString::fromLatin1( "MaxPixmapWidth" ) );
+ itemMaxPixmapWidth = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "MaxPixmapWidth" ), mMaxPixmapWidth, 50 );
+ addItem( itemMaxPixmapWidth, TQString::tqfromLatin1( "MaxPixmapWidth" ) );
KConfigSkeleton::ItemInt *itemMaxPixmapHeight;
- itemMaxPixmapHeight = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "MaxPixmapHeight" ), mMaxPixmapHeight, 50 );
- addItem( itemMaxPixmapHeight, QString::fromLatin1( "MaxPixmapHeight" ) );
+ itemMaxPixmapHeight = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "MaxPixmapHeight" ), mMaxPixmapHeight, 50 );
+ addItem( itemMaxPixmapHeight, TQString::tqfromLatin1( "MaxPixmapHeight" ) );
- setCurrentGroup( QString::fromLatin1( "Group View Options" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Group View Options" ) );
KConfigSkeleton::ItemInt *itemGroupViewSortColumn;
- itemGroupViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "SortColumn" ), mGroupViewSortColumn, 0 );
- addItem( itemGroupViewSortColumn, QString::fromLatin1( "groupViewSortColumn" ) );
+ itemGroupViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "SortColumn" ), mGroupViewSortColumn, 0 );
+ addItem( itemGroupViewSortColumn, TQString::tqfromLatin1( "groupViewSortColumn" ) );
KConfigSkeleton::ItemBool *itemGroupViewSortAscending;
- itemGroupViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "SortAscending" ), mGroupViewSortAscending, true );
- addItem( itemGroupViewSortAscending, QString::fromLatin1( "groupViewSortAscending" ) );
+ itemGroupViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "SortAscending" ), mGroupViewSortAscending, true );
+ addItem( itemGroupViewSortAscending, TQString::tqfromLatin1( "groupViewSortAscending" ) );
- setCurrentGroup( QString::fromLatin1( "Filter View Options" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Filter View Options" ) );
KConfigSkeleton::ItemInt *itemFilterViewSortColumn;
- itemFilterViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "SortColumn" ), mFilterViewSortColumn, 0 );
- addItem( itemFilterViewSortColumn, QString::fromLatin1( "filterViewSortColumn" ) );
+ itemFilterViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "SortColumn" ), mFilterViewSortColumn, 0 );
+ addItem( itemFilterViewSortColumn, TQString::tqfromLatin1( "filterViewSortColumn" ) );
KConfigSkeleton::ItemBool *itemFilterViewSortAscending;
- itemFilterViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "SortAscending" ), mFilterViewSortAscending, true );
- addItem( itemFilterViewSortAscending, QString::fromLatin1( "filterViewSortAscending" ) );
+ itemFilterViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "SortAscending" ), mFilterViewSortAscending, true );
+ addItem( itemFilterViewSortAscending, TQString::tqfromLatin1( "filterViewSortAscending" ) );
- setCurrentGroup( QString::fromLatin1( "Loan View Options" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Loan View Options" ) );
KConfigSkeleton::ItemInt *itemLoanViewSortColumn;
- itemLoanViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "SortColumn" ), mLoanViewSortColumn, 0 );
- addItem( itemLoanViewSortColumn, QString::fromLatin1( "loanViewSortColumn" ) );
+ itemLoanViewSortColumn = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "SortColumn" ), mLoanViewSortColumn, 0 );
+ addItem( itemLoanViewSortColumn, TQString::tqfromLatin1( "loanViewSortColumn" ) );
KConfigSkeleton::ItemBool *itemLoanViewSortAscending;
- itemLoanViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "SortAscending" ), mLoanViewSortAscending, true );
- addItem( itemLoanViewSortAscending, QString::fromLatin1( "loanViewSortAscending" ) );
+ itemLoanViewSortAscending = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "SortAscending" ), mLoanViewSortAscending, true );
+ addItem( itemLoanViewSortAscending, TQString::tqfromLatin1( "loanViewSortAscending" ) );
- setCurrentGroup( QString::fromLatin1( "Export Options - Bibtex" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Export Options - Bibtex" ) );
KConfigSkeleton::ItemBool *itemUseBraces;
- itemUseBraces = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Use Braces" ), mUseBraces, true );
- addItem( itemUseBraces, QString::fromLatin1( "UseBraces" ) );
+ itemUseBraces = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Use Braces" ), mUseBraces, true );
+ addItem( itemUseBraces, TQString::tqfromLatin1( "UseBraces" ) );
- setCurrentGroup( QString::fromLatin1( "General Options" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "General Options" ) );
KConfigSkeleton::ItemBool *itemShowGroupWidget;
- itemShowGroupWidget = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Show Group Widget" ), mShowGroupWidget, true );
- addItem( itemShowGroupWidget, QString::fromLatin1( "ShowGroupWidget" ) );
+ itemShowGroupWidget = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Show Group Widget" ), mShowGroupWidget, true );
+ addItem( itemShowGroupWidget, TQString::tqfromLatin1( "ShowGroupWidget" ) );
KConfigSkeleton::ItemBool *itemShowEditWidget;
- itemShowEditWidget = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Show Edit Widget" ), mShowEditWidget, false );
- addItem( itemShowEditWidget, QString::fromLatin1( "ShowEditWidget" ) );
+ itemShowEditWidget = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Show Edit Widget" ), mShowEditWidget, false );
+ addItem( itemShowEditWidget, TQString::tqfromLatin1( "ShowEditWidget" ) );
KConfigSkeleton::ItemBool *itemShowEntryView;
- itemShowEntryView = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Show Entry View" ), mShowEntryView, true );
- addItem( itemShowEntryView, QString::fromLatin1( "ShowEntryView" ) );
- QValueList<KConfigSkeleton::ItemEnum::Choice> valuesImageLocation;
+ itemShowEntryView = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Show Entry View" ), mShowEntryView, true );
+ addItem( itemShowEntryView, TQString::tqfromLatin1( "ShowEntryView" ) );
+ TQValueList<KConfigSkeleton::ItemEnum::Choice> valuesImageLocation;
{
KConfigSkeleton::ItemEnum::Choice choice;
- choice.name = QString::fromLatin1( "ImagesInFile" );
+ choice.name = TQString::tqfromLatin1( "ImagesInFile" );
valuesImageLocation.append( choice );
}
{
KConfigSkeleton::ItemEnum::Choice choice;
- choice.name = QString::fromLatin1( "ImagesInAppDir" );
+ choice.name = TQString::tqfromLatin1( "ImagesInAppDir" );
valuesImageLocation.append( choice );
}
{
KConfigSkeleton::ItemEnum::Choice choice;
- choice.name = QString::fromLatin1( "ImagesInLocalDir" );
+ choice.name = TQString::tqfromLatin1( "ImagesInLocalDir" );
valuesImageLocation.append( choice );
}
KConfigSkeleton::ItemEnum *itemImageLocation;
- itemImageLocation = new KConfigSkeleton::ItemEnum( currentGroup(), QString::fromLatin1( "Image Location" ), mImageLocation, valuesImageLocation, ImagesInFile );
- addItem( itemImageLocation, QString::fromLatin1( "ImageLocation" ) );
+ itemImageLocation = new KConfigSkeleton::ItemEnum( currentGroup(), TQString::tqfromLatin1( "Image Location" ), mImageLocation, valuesImageLocation, ImagesInFile );
+ addItem( itemImageLocation, TQString::tqfromLatin1( "ImageLocation" ) );
KConfigSkeleton::ItemBool *itemAskWriteImagesInFile;
- itemAskWriteImagesInFile = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Ask Write Images In File" ), mAskWriteImagesInFile, true );
- addItem( itemAskWriteImagesInFile, QString::fromLatin1( "AskWriteImagesInFile" ) );
+ itemAskWriteImagesInFile = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Ask Write Images In File" ), mAskWriteImagesInFile, true );
+ addItem( itemAskWriteImagesInFile, TQString::tqfromLatin1( "AskWriteImagesInFile" ) );
KConfigSkeleton::ItemBool *itemReopenLastFile;
- itemReopenLastFile = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Reopen Last File" ), mReopenLastFile, true );
- addItem( itemReopenLastFile, QString::fromLatin1( "ReopenLastFile" ) );
+ itemReopenLastFile = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Reopen Last File" ), mReopenLastFile, true );
+ addItem( itemReopenLastFile, TQString::tqfromLatin1( "ReopenLastFile" ) );
KConfigSkeleton::ItemBool *itemAutoCapitalization;
- itemAutoCapitalization = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Auto Capitalization" ), mAutoCapitalization, true );
- addItem( itemAutoCapitalization, QString::fromLatin1( "AutoCapitalization" ) );
+ itemAutoCapitalization = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Auto Capitalization" ), mAutoCapitalization, true );
+ addItem( itemAutoCapitalization, TQString::tqfromLatin1( "AutoCapitalization" ) );
KConfigSkeleton::ItemBool *itemAutoFormat;
- itemAutoFormat = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Auto Format" ), mAutoFormat, true );
- addItem( itemAutoFormat, QString::fromLatin1( "AutoFormat" ) );
+ itemAutoFormat = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Auto Format" ), mAutoFormat, true );
+ addItem( itemAutoFormat, TQString::tqfromLatin1( "AutoFormat" ) );
KConfigSkeleton::ItemString *itemLastOpenFile;
- itemLastOpenFile = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Last Open File" ), mLastOpenFile );
- addItem( itemLastOpenFile, QString::fromLatin1( "LastOpenFile" ) );
+ itemLastOpenFile = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Last Open File" ), mLastOpenFile );
+ addItem( itemLastOpenFile, TQString::tqfromLatin1( "LastOpenFile" ) );
KConfigSkeleton::ItemString *itemNoCapitalizationString;
- itemNoCapitalizationString = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "No Capitalization" ), mNoCapitalizationString, i18n("a,an,and,as,at,but,by,for,from,in,into,nor,of,off,on,onto,or,out,over,the,to,up,with") );
- addItem( itemNoCapitalizationString, QString::fromLatin1( "noCapitalizationString" ) );
+ itemNoCapitalizationString = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "No Capitalization" ), mNoCapitalizationString, i18n("a,an,and,as,at,but,by,for,from,in,into,nor,of,off,on,onto,or,out,over,the,to,up,with") );
+ addItem( itemNoCapitalizationString, TQString::tqfromLatin1( "noCapitalizationString" ) );
KConfigSkeleton::ItemString *itemArticlesString;
- itemArticlesString = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Articles" ), mArticlesString, i18n("the") );
- addItem( itemArticlesString, QString::fromLatin1( "articlesString" ) );
+ itemArticlesString = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Articles" ), mArticlesString, i18n("the") );
+ addItem( itemArticlesString, TQString::tqfromLatin1( "articlesString" ) );
KConfigSkeleton::ItemString *itemNameSuffixesString;
- itemNameSuffixesString = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Name Suffixes" ), mNameSuffixesString, i18n("jr.,jr,iii,iv") );
- addItem( itemNameSuffixesString, QString::fromLatin1( "nameSuffixesString" ) );
+ itemNameSuffixesString = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Name Suffixes" ), mNameSuffixesString, i18n("jr.,jr,iii,iv") );
+ addItem( itemNameSuffixesString, TQString::tqfromLatin1( "nameSuffixesString" ) );
KConfigSkeleton::ItemString *itemSurnamePrefixesString;
- itemSurnamePrefixesString = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Surname Prefixes" ), mSurnamePrefixesString, i18n("de,van,der,van der,von") );
- addItem( itemSurnamePrefixesString, QString::fromLatin1( "surnamePrefixesString" ) );
+ itemSurnamePrefixesString = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Surname Prefixes" ), mSurnamePrefixesString, i18n("de,van,der,van der,von") );
+ addItem( itemSurnamePrefixesString, TQString::tqfromLatin1( "surnamePrefixesString" ) );
KConfigSkeleton::ItemInt *itemMaxIconSize;
- itemMaxIconSize = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "Max Icon Size" ), mMaxIconSize, 96 );
- addItem( itemMaxIconSize, QString::fromLatin1( "MaxIconSize" ) );
+ itemMaxIconSize = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "Max Icon Size" ), mMaxIconSize, 96 );
+ addItem( itemMaxIconSize, TQString::tqfromLatin1( "MaxIconSize" ) );
KConfigSkeleton::ItemInt *itemImageCacheSize;
- itemImageCacheSize = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "Image Cache Size" ), mImageCacheSize, (10 * 1024 * 1024) );
- addItem( itemImageCacheSize, QString::fromLatin1( "ImageCacheSize" ) );
+ itemImageCacheSize = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "Image Cache Size" ), mImageCacheSize, (10 * 1024 * 1024) );
+ addItem( itemImageCacheSize, TQString::tqfromLatin1( "ImageCacheSize" ) );
KConfigSkeleton::ItemUInt *itemMaxCustomURLSettings;
- itemMaxCustomURLSettings = new KConfigSkeleton::ItemUInt( currentGroup(), QString::fromLatin1( "Max Custom URL Settings" ), mMaxCustomURLSettings, 9 );
- addItem( itemMaxCustomURLSettings, QString::fromLatin1( "MaxCustomURLSettings" ) );
+ itemMaxCustomURLSettings = new KConfigSkeleton::ItemUInt( currentGroup(), TQString::tqfromLatin1( "Max Custom URL Settings" ), mMaxCustomURLSettings, 9 );
+ addItem( itemMaxCustomURLSettings, TQString::tqfromLatin1( "MaxCustomURLSettings" ) );
- setCurrentGroup( QString::fromLatin1( "Printing" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Printing" ) );
KConfigSkeleton::ItemBool *itemPrintFieldHeaders;
- itemPrintFieldHeaders = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Print Field Headers" ), mPrintFieldHeaders, true );
- addItem( itemPrintFieldHeaders, QString::fromLatin1( "PrintFieldHeaders" ) );
+ itemPrintFieldHeaders = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Print Field Headers" ), mPrintFieldHeaders, true );
+ addItem( itemPrintFieldHeaders, TQString::tqfromLatin1( "PrintFieldHeaders" ) );
KConfigSkeleton::ItemBool *itemPrintFormatted;
- itemPrintFormatted = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Print Formatted" ), mPrintFormatted, true );
- addItem( itemPrintFormatted, QString::fromLatin1( "PrintFormatted" ) );
+ itemPrintFormatted = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Print Formatted" ), mPrintFormatted, true );
+ addItem( itemPrintFormatted, TQString::tqfromLatin1( "PrintFormatted" ) );
KConfigSkeleton::ItemBool *itemPrintGrouped;
- itemPrintGrouped = new KConfigSkeleton::ItemBool( currentGroup(), QString::fromLatin1( "Print Grouped" ), mPrintGrouped, true );
- addItem( itemPrintGrouped, QString::fromLatin1( "PrintGrouped" ) );
+ itemPrintGrouped = new KConfigSkeleton::ItemBool( currentGroup(), TQString::tqfromLatin1( "Print Grouped" ), mPrintGrouped, true );
+ addItem( itemPrintGrouped, TQString::tqfromLatin1( "PrintGrouped" ) );
KConfigSkeleton::ItemInt *itemMaxImageWidth;
- itemMaxImageWidth = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "Max Image Width" ), mMaxImageWidth, 50 );
- addItem( itemMaxImageWidth, QString::fromLatin1( "MaxImageWidth" ) );
+ itemMaxImageWidth = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "Max Image Width" ), mMaxImageWidth, 50 );
+ addItem( itemMaxImageWidth, TQString::tqfromLatin1( "MaxImageWidth" ) );
KConfigSkeleton::ItemInt *itemMaxImageHeight;
- itemMaxImageHeight = new KConfigSkeleton::ItemInt( currentGroup(), QString::fromLatin1( "Max Image Height" ), mMaxImageHeight, 50 );
- addItem( itemMaxImageHeight, QString::fromLatin1( "MaxImageHeight" ) );
+ itemMaxImageHeight = new KConfigSkeleton::ItemInt( currentGroup(), TQString::tqfromLatin1( "Max Image Height" ), mMaxImageHeight, 50 );
+ addItem( itemMaxImageHeight, TQString::tqfromLatin1( "MaxImageHeight" ) );
- setCurrentGroup( QString::fromLatin1( "Options - book" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - book" ) );
KConfigSkeleton::ItemString *itemTemplateBook;
- itemTemplateBook = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateBook, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateBook, QString::fromLatin1( "templateBook" ) );
+ itemTemplateBook = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateBook, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateBook, TQString::tqfromLatin1( "templateBook" ) );
KConfigSkeleton::ItemFont *itemFontBook;
- itemFontBook = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontBook, KGlobalSettings::generalFont() );
- addItem( itemFontBook, QString::fromLatin1( "fontBook" ) );
+ itemFontBook = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontBook, KGlobalSettings::generalFont() );
+ addItem( itemFontBook, TQString::tqfromLatin1( "fontBook" ) );
KConfigSkeleton::ItemColor *itemBaseColorBook;
- itemBaseColorBook = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorBook, KGlobalSettings::baseColor() );
- addItem( itemBaseColorBook, QString::fromLatin1( "baseColorBook" ) );
+ itemBaseColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorBook, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorBook, TQString::tqfromLatin1( "baseColorBook" ) );
KConfigSkeleton::ItemColor *itemTextColorBook;
- itemTextColorBook = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorBook, KGlobalSettings::textColor() );
- addItem( itemTextColorBook, QString::fromLatin1( "textColorBook" ) );
+ itemTextColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorBook, KGlobalSettings::textColor() );
+ addItem( itemTextColorBook, TQString::tqfromLatin1( "textColorBook" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorBook;
- itemHighlightedBaseColorBook = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBook, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorBook, QString::fromLatin1( "highlightedBaseColorBook" ) );
+ itemHighlightedBaseColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBook, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorBook, TQString::tqfromLatin1( "highlightedBaseColorBook" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorBook;
- itemHighlightedTextColorBook = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBook, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorBook, QString::fromLatin1( "highlightedTextColorBook" ) );
+ itemHighlightedTextColorBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBook, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorBook, TQString::tqfromLatin1( "highlightedTextColorBook" ) );
- setCurrentGroup( QString::fromLatin1( "Options - video" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - video" ) );
KConfigSkeleton::ItemString *itemTemplateVideo;
- itemTemplateVideo = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateVideo, QString::fromLatin1( "Video" ) );
- addItem( itemTemplateVideo, QString::fromLatin1( "templateVideo" ) );
+ itemTemplateVideo = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateVideo, TQString::tqfromLatin1( "Video" ) );
+ addItem( itemTemplateVideo, TQString::tqfromLatin1( "templateVideo" ) );
KConfigSkeleton::ItemFont *itemFontVideo;
- itemFontVideo = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontVideo, KGlobalSettings::generalFont() );
- addItem( itemFontVideo, QString::fromLatin1( "fontVideo" ) );
+ itemFontVideo = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontVideo, KGlobalSettings::generalFont() );
+ addItem( itemFontVideo, TQString::tqfromLatin1( "fontVideo" ) );
KConfigSkeleton::ItemColor *itemBaseColorVideo;
- itemBaseColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorVideo, KGlobalSettings::baseColor() );
- addItem( itemBaseColorVideo, QString::fromLatin1( "baseColorVideo" ) );
+ itemBaseColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorVideo, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorVideo, TQString::tqfromLatin1( "baseColorVideo" ) );
KConfigSkeleton::ItemColor *itemTextColorVideo;
- itemTextColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorVideo, KGlobalSettings::textColor() );
- addItem( itemTextColorVideo, QString::fromLatin1( "textColorVideo" ) );
+ itemTextColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorVideo, KGlobalSettings::textColor() );
+ addItem( itemTextColorVideo, TQString::tqfromLatin1( "textColorVideo" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorVideo;
- itemHighlightedBaseColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorVideo, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorVideo, QString::fromLatin1( "highlightedBaseColorVideo" ) );
+ itemHighlightedBaseColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorVideo, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorVideo, TQString::tqfromLatin1( "highlightedBaseColorVideo" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorVideo;
- itemHighlightedTextColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorVideo, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorVideo, QString::fromLatin1( "highlightedTextColorVideo" ) );
+ itemHighlightedTextColorVideo = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorVideo, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorVideo, TQString::tqfromLatin1( "highlightedTextColorVideo" ) );
- setCurrentGroup( QString::fromLatin1( "Options - album" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - album" ) );
KConfigSkeleton::ItemString *itemTemplateAlbum;
- itemTemplateAlbum = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateAlbum, QString::fromLatin1( "Album" ) );
- addItem( itemTemplateAlbum, QString::fromLatin1( "templateAlbum" ) );
+ itemTemplateAlbum = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateAlbum, TQString::tqfromLatin1( "Album" ) );
+ addItem( itemTemplateAlbum, TQString::tqfromLatin1( "templateAlbum" ) );
KConfigSkeleton::ItemFont *itemFontAlbum;
- itemFontAlbum = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontAlbum, KGlobalSettings::generalFont() );
- addItem( itemFontAlbum, QString::fromLatin1( "fontAlbum" ) );
+ itemFontAlbum = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontAlbum, KGlobalSettings::generalFont() );
+ addItem( itemFontAlbum, TQString::tqfromLatin1( "fontAlbum" ) );
KConfigSkeleton::ItemColor *itemBaseColorAlbum;
- itemBaseColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorAlbum, KGlobalSettings::baseColor() );
- addItem( itemBaseColorAlbum, QString::fromLatin1( "baseColorAlbum" ) );
+ itemBaseColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorAlbum, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorAlbum, TQString::tqfromLatin1( "baseColorAlbum" ) );
KConfigSkeleton::ItemColor *itemTextColorAlbum;
- itemTextColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorAlbum, KGlobalSettings::textColor() );
- addItem( itemTextColorAlbum, QString::fromLatin1( "textColorAlbum" ) );
+ itemTextColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorAlbum, KGlobalSettings::textColor() );
+ addItem( itemTextColorAlbum, TQString::tqfromLatin1( "textColorAlbum" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorAlbum;
- itemHighlightedBaseColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorAlbum, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorAlbum, QString::fromLatin1( "highlightedBaseColorAlbum" ) );
+ itemHighlightedBaseColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorAlbum, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorAlbum, TQString::tqfromLatin1( "highlightedBaseColorAlbum" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorAlbum;
- itemHighlightedTextColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorAlbum, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorAlbum, QString::fromLatin1( "highlightedTextColorAlbum" ) );
+ itemHighlightedTextColorAlbum = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorAlbum, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorAlbum, TQString::tqfromLatin1( "highlightedTextColorAlbum" ) );
- setCurrentGroup( QString::fromLatin1( "Options - bibtex" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - bibtex" ) );
KConfigSkeleton::ItemPath *itemLyxpipe;
- itemLyxpipe = new KConfigSkeleton::ItemPath( currentGroup(), QString::fromLatin1( "lyxpipe" ), mLyxpipe, QString::fromLatin1( "$HOME/.lyx/lyxpipe" ) );
- addItem( itemLyxpipe, QString::fromLatin1( "lyxpipe" ) );
+ itemLyxpipe = new KConfigSkeleton::ItemPath( currentGroup(), TQString::tqfromLatin1( "lyxpipe" ), mLyxpipe, TQString::tqfromLatin1( "$HOME/.lyx/lyxpipe" ) );
+ addItem( itemLyxpipe, TQString::tqfromLatin1( "lyxpipe" ) );
KConfigSkeleton::ItemString *itemTemplateBibtex;
- itemTemplateBibtex = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateBibtex, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateBibtex, QString::fromLatin1( "templateBibtex" ) );
+ itemTemplateBibtex = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateBibtex, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateBibtex, TQString::tqfromLatin1( "templateBibtex" ) );
KConfigSkeleton::ItemFont *itemFontBibtex;
- itemFontBibtex = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontBibtex, KGlobalSettings::generalFont() );
- addItem( itemFontBibtex, QString::fromLatin1( "fontBibtex" ) );
+ itemFontBibtex = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontBibtex, KGlobalSettings::generalFont() );
+ addItem( itemFontBibtex, TQString::tqfromLatin1( "fontBibtex" ) );
KConfigSkeleton::ItemColor *itemBaseColorBibtex;
- itemBaseColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorBibtex, KGlobalSettings::baseColor() );
- addItem( itemBaseColorBibtex, QString::fromLatin1( "baseColorBibtex" ) );
+ itemBaseColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorBibtex, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorBibtex, TQString::tqfromLatin1( "baseColorBibtex" ) );
KConfigSkeleton::ItemColor *itemTextColorBibtex;
- itemTextColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorBibtex, KGlobalSettings::textColor() );
- addItem( itemTextColorBibtex, QString::fromLatin1( "textColorBibtex" ) );
+ itemTextColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorBibtex, KGlobalSettings::textColor() );
+ addItem( itemTextColorBibtex, TQString::tqfromLatin1( "textColorBibtex" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorBibtex;
- itemHighlightedBaseColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBibtex, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorBibtex, QString::fromLatin1( "highlightedBaseColorBibtex" ) );
+ itemHighlightedBaseColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBibtex, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorBibtex, TQString::tqfromLatin1( "highlightedBaseColorBibtex" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorBibtex;
- itemHighlightedTextColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBibtex, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorBibtex, QString::fromLatin1( "highlightedTextColorBibtex" ) );
+ itemHighlightedTextColorBibtex = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBibtex, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorBibtex, TQString::tqfromLatin1( "highlightedTextColorBibtex" ) );
- setCurrentGroup( QString::fromLatin1( "Options - comic" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - comic" ) );
KConfigSkeleton::ItemString *itemTemplateComicBook;
- itemTemplateComicBook = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateComicBook, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateComicBook, QString::fromLatin1( "templateComicBook" ) );
+ itemTemplateComicBook = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateComicBook, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateComicBook, TQString::tqfromLatin1( "templateComicBook" ) );
KConfigSkeleton::ItemFont *itemFontComicBook;
- itemFontComicBook = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontComicBook, KGlobalSettings::generalFont() );
- addItem( itemFontComicBook, QString::fromLatin1( "fontComicBook" ) );
+ itemFontComicBook = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontComicBook, KGlobalSettings::generalFont() );
+ addItem( itemFontComicBook, TQString::tqfromLatin1( "fontComicBook" ) );
KConfigSkeleton::ItemColor *itemBaseColorComicBook;
- itemBaseColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorComicBook, KGlobalSettings::baseColor() );
- addItem( itemBaseColorComicBook, QString::fromLatin1( "baseColorComicBook" ) );
+ itemBaseColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorComicBook, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorComicBook, TQString::tqfromLatin1( "baseColorComicBook" ) );
KConfigSkeleton::ItemColor *itemTextColorComicBook;
- itemTextColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorComicBook, KGlobalSettings::textColor() );
- addItem( itemTextColorComicBook, QString::fromLatin1( "textColorComicBook" ) );
+ itemTextColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorComicBook, KGlobalSettings::textColor() );
+ addItem( itemTextColorComicBook, TQString::tqfromLatin1( "textColorComicBook" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorComicBook;
- itemHighlightedBaseColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorComicBook, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorComicBook, QString::fromLatin1( "highlightedBaseColorComicBook" ) );
+ itemHighlightedBaseColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorComicBook, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorComicBook, TQString::tqfromLatin1( "highlightedBaseColorComicBook" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorComicBook;
- itemHighlightedTextColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorComicBook, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorComicBook, QString::fromLatin1( "highlightedTextColorComicBook" ) );
+ itemHighlightedTextColorComicBook = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorComicBook, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorComicBook, TQString::tqfromLatin1( "highlightedTextColorComicBook" ) );
- setCurrentGroup( QString::fromLatin1( "Options - wine" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - wine" ) );
KConfigSkeleton::ItemString *itemTemplateWine;
- itemTemplateWine = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateWine, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateWine, QString::fromLatin1( "templateWine" ) );
+ itemTemplateWine = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateWine, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateWine, TQString::tqfromLatin1( "templateWine" ) );
KConfigSkeleton::ItemFont *itemFontWine;
- itemFontWine = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontWine, KGlobalSettings::generalFont() );
- addItem( itemFontWine, QString::fromLatin1( "fontWine" ) );
+ itemFontWine = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontWine, KGlobalSettings::generalFont() );
+ addItem( itemFontWine, TQString::tqfromLatin1( "fontWine" ) );
KConfigSkeleton::ItemColor *itemBaseColorWine;
- itemBaseColorWine = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorWine, KGlobalSettings::baseColor() );
- addItem( itemBaseColorWine, QString::fromLatin1( "baseColorWine" ) );
+ itemBaseColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorWine, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorWine, TQString::tqfromLatin1( "baseColorWine" ) );
KConfigSkeleton::ItemColor *itemTextColorWine;
- itemTextColorWine = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorWine, KGlobalSettings::textColor() );
- addItem( itemTextColorWine, QString::fromLatin1( "textColorWine" ) );
+ itemTextColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorWine, KGlobalSettings::textColor() );
+ addItem( itemTextColorWine, TQString::tqfromLatin1( "textColorWine" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorWine;
- itemHighlightedBaseColorWine = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorWine, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorWine, QString::fromLatin1( "highlightedBaseColorWine" ) );
+ itemHighlightedBaseColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorWine, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorWine, TQString::tqfromLatin1( "highlightedBaseColorWine" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorWine;
- itemHighlightedTextColorWine = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorWine, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorWine, QString::fromLatin1( "highlightedTextColorWine" ) );
+ itemHighlightedTextColorWine = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorWine, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorWine, TQString::tqfromLatin1( "highlightedTextColorWine" ) );
- setCurrentGroup( QString::fromLatin1( "Options - coin" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - coin" ) );
KConfigSkeleton::ItemString *itemTemplateCoin;
- itemTemplateCoin = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateCoin, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateCoin, QString::fromLatin1( "templateCoin" ) );
+ itemTemplateCoin = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateCoin, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateCoin, TQString::tqfromLatin1( "templateCoin" ) );
KConfigSkeleton::ItemFont *itemFontCoin;
- itemFontCoin = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontCoin, KGlobalSettings::generalFont() );
- addItem( itemFontCoin, QString::fromLatin1( "fontCoin" ) );
+ itemFontCoin = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontCoin, KGlobalSettings::generalFont() );
+ addItem( itemFontCoin, TQString::tqfromLatin1( "fontCoin" ) );
KConfigSkeleton::ItemColor *itemBaseColorCoin;
- itemBaseColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorCoin, KGlobalSettings::baseColor() );
- addItem( itemBaseColorCoin, QString::fromLatin1( "baseColorCoin" ) );
+ itemBaseColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorCoin, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorCoin, TQString::tqfromLatin1( "baseColorCoin" ) );
KConfigSkeleton::ItemColor *itemTextColorCoin;
- itemTextColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorCoin, KGlobalSettings::textColor() );
- addItem( itemTextColorCoin, QString::fromLatin1( "textColorCoin" ) );
+ itemTextColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorCoin, KGlobalSettings::textColor() );
+ addItem( itemTextColorCoin, TQString::tqfromLatin1( "textColorCoin" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorCoin;
- itemHighlightedBaseColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorCoin, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorCoin, QString::fromLatin1( "highlightedBaseColorCoin" ) );
+ itemHighlightedBaseColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorCoin, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorCoin, TQString::tqfromLatin1( "highlightedBaseColorCoin" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorCoin;
- itemHighlightedTextColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorCoin, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorCoin, QString::fromLatin1( "highlightedTextColorCoin" ) );
+ itemHighlightedTextColorCoin = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorCoin, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorCoin, TQString::tqfromLatin1( "highlightedTextColorCoin" ) );
- setCurrentGroup( QString::fromLatin1( "Options - stamp" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - stamp" ) );
KConfigSkeleton::ItemString *itemTemplateStamp;
- itemTemplateStamp = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateStamp, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateStamp, QString::fromLatin1( "templateStamp" ) );
+ itemTemplateStamp = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateStamp, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateStamp, TQString::tqfromLatin1( "templateStamp" ) );
KConfigSkeleton::ItemFont *itemFontStamp;
- itemFontStamp = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontStamp, KGlobalSettings::generalFont() );
- addItem( itemFontStamp, QString::fromLatin1( "fontStamp" ) );
+ itemFontStamp = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontStamp, KGlobalSettings::generalFont() );
+ addItem( itemFontStamp, TQString::tqfromLatin1( "fontStamp" ) );
KConfigSkeleton::ItemColor *itemBaseColorStamp;
- itemBaseColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorStamp, KGlobalSettings::baseColor() );
- addItem( itemBaseColorStamp, QString::fromLatin1( "baseColorStamp" ) );
+ itemBaseColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorStamp, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorStamp, TQString::tqfromLatin1( "baseColorStamp" ) );
KConfigSkeleton::ItemColor *itemTextColorStamp;
- itemTextColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorStamp, KGlobalSettings::textColor() );
- addItem( itemTextColorStamp, QString::fromLatin1( "textColorStamp" ) );
+ itemTextColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorStamp, KGlobalSettings::textColor() );
+ addItem( itemTextColorStamp, TQString::tqfromLatin1( "textColorStamp" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorStamp;
- itemHighlightedBaseColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorStamp, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorStamp, QString::fromLatin1( "highlightedBaseColorStamp" ) );
+ itemHighlightedBaseColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorStamp, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorStamp, TQString::tqfromLatin1( "highlightedBaseColorStamp" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorStamp;
- itemHighlightedTextColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorStamp, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorStamp, QString::fromLatin1( "highlightedTextColorStamp" ) );
+ itemHighlightedTextColorStamp = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorStamp, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorStamp, TQString::tqfromLatin1( "highlightedTextColorStamp" ) );
- setCurrentGroup( QString::fromLatin1( "Options - card" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - card" ) );
KConfigSkeleton::ItemString *itemTemplateCard;
- itemTemplateCard = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateCard, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateCard, QString::fromLatin1( "templateCard" ) );
+ itemTemplateCard = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateCard, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateCard, TQString::tqfromLatin1( "templateCard" ) );
KConfigSkeleton::ItemFont *itemFontCard;
- itemFontCard = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontCard, KGlobalSettings::generalFont() );
- addItem( itemFontCard, QString::fromLatin1( "fontCard" ) );
+ itemFontCard = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontCard, KGlobalSettings::generalFont() );
+ addItem( itemFontCard, TQString::tqfromLatin1( "fontCard" ) );
KConfigSkeleton::ItemColor *itemBaseColorCard;
- itemBaseColorCard = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorCard, KGlobalSettings::baseColor() );
- addItem( itemBaseColorCard, QString::fromLatin1( "baseColorCard" ) );
+ itemBaseColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorCard, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorCard, TQString::tqfromLatin1( "baseColorCard" ) );
KConfigSkeleton::ItemColor *itemTextColorCard;
- itemTextColorCard = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorCard, KGlobalSettings::textColor() );
- addItem( itemTextColorCard, QString::fromLatin1( "textColorCard" ) );
+ itemTextColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorCard, KGlobalSettings::textColor() );
+ addItem( itemTextColorCard, TQString::tqfromLatin1( "textColorCard" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorCard;
- itemHighlightedBaseColorCard = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorCard, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorCard, QString::fromLatin1( "highlightedBaseColorCard" ) );
+ itemHighlightedBaseColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorCard, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorCard, TQString::tqfromLatin1( "highlightedBaseColorCard" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorCard;
- itemHighlightedTextColorCard = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorCard, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorCard, QString::fromLatin1( "highlightedTextColorCard" ) );
+ itemHighlightedTextColorCard = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorCard, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorCard, TQString::tqfromLatin1( "highlightedTextColorCard" ) );
- setCurrentGroup( QString::fromLatin1( "Options - game" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - game" ) );
KConfigSkeleton::ItemString *itemTemplateGame;
- itemTemplateGame = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateGame, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateGame, QString::fromLatin1( "templateGame" ) );
+ itemTemplateGame = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateGame, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateGame, TQString::tqfromLatin1( "templateGame" ) );
KConfigSkeleton::ItemFont *itemFontGame;
- itemFontGame = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontGame, KGlobalSettings::generalFont() );
- addItem( itemFontGame, QString::fromLatin1( "fontGame" ) );
+ itemFontGame = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontGame, KGlobalSettings::generalFont() );
+ addItem( itemFontGame, TQString::tqfromLatin1( "fontGame" ) );
KConfigSkeleton::ItemColor *itemBaseColorGame;
- itemBaseColorGame = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorGame, KGlobalSettings::baseColor() );
- addItem( itemBaseColorGame, QString::fromLatin1( "baseColorGame" ) );
+ itemBaseColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorGame, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorGame, TQString::tqfromLatin1( "baseColorGame" ) );
KConfigSkeleton::ItemColor *itemTextColorGame;
- itemTextColorGame = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorGame, KGlobalSettings::textColor() );
- addItem( itemTextColorGame, QString::fromLatin1( "textColorGame" ) );
+ itemTextColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorGame, KGlobalSettings::textColor() );
+ addItem( itemTextColorGame, TQString::tqfromLatin1( "textColorGame" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorGame;
- itemHighlightedBaseColorGame = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorGame, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorGame, QString::fromLatin1( "highlightedBaseColorGame" ) );
+ itemHighlightedBaseColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorGame, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorGame, TQString::tqfromLatin1( "highlightedBaseColorGame" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorGame;
- itemHighlightedTextColorGame = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorGame, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorGame, QString::fromLatin1( "highlightedTextColorGame" ) );
+ itemHighlightedTextColorGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorGame, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorGame, TQString::tqfromLatin1( "highlightedTextColorGame" ) );
- setCurrentGroup( QString::fromLatin1( "Options - file" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - file" ) );
KConfigSkeleton::ItemString *itemTemplateFile;
- itemTemplateFile = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateFile, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateFile, QString::fromLatin1( "templateFile" ) );
+ itemTemplateFile = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateFile, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateFile, TQString::tqfromLatin1( "templateFile" ) );
KConfigSkeleton::ItemFont *itemFontFile;
- itemFontFile = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontFile, KGlobalSettings::generalFont() );
- addItem( itemFontFile, QString::fromLatin1( "fontFile" ) );
+ itemFontFile = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontFile, KGlobalSettings::generalFont() );
+ addItem( itemFontFile, TQString::tqfromLatin1( "fontFile" ) );
KConfigSkeleton::ItemColor *itemBaseColorFile;
- itemBaseColorFile = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorFile, KGlobalSettings::baseColor() );
- addItem( itemBaseColorFile, QString::fromLatin1( "baseColorFile" ) );
+ itemBaseColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorFile, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorFile, TQString::tqfromLatin1( "baseColorFile" ) );
KConfigSkeleton::ItemColor *itemTextColorFile;
- itemTextColorFile = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorFile, KGlobalSettings::textColor() );
- addItem( itemTextColorFile, QString::fromLatin1( "textColorFile" ) );
+ itemTextColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorFile, KGlobalSettings::textColor() );
+ addItem( itemTextColorFile, TQString::tqfromLatin1( "textColorFile" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorFile;
- itemHighlightedBaseColorFile = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorFile, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorFile, QString::fromLatin1( "highlightedBaseColorFile" ) );
+ itemHighlightedBaseColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorFile, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorFile, TQString::tqfromLatin1( "highlightedBaseColorFile" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorFile;
- itemHighlightedTextColorFile = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorFile, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorFile, QString::fromLatin1( "highlightedTextColorFile" ) );
+ itemHighlightedTextColorFile = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorFile, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorFile, TQString::tqfromLatin1( "highlightedTextColorFile" ) );
- setCurrentGroup( QString::fromLatin1( "Options - boardgame" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - boardgame" ) );
KConfigSkeleton::ItemString *itemTemplateBoardGame;
- itemTemplateBoardGame = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateBoardGame, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateBoardGame, QString::fromLatin1( "templateBoardGame" ) );
+ itemTemplateBoardGame = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateBoardGame, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateBoardGame, TQString::tqfromLatin1( "templateBoardGame" ) );
KConfigSkeleton::ItemFont *itemFontBoardGame;
- itemFontBoardGame = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontBoardGame, KGlobalSettings::generalFont() );
- addItem( itemFontBoardGame, QString::fromLatin1( "fontBoardGame" ) );
+ itemFontBoardGame = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontBoardGame, KGlobalSettings::generalFont() );
+ addItem( itemFontBoardGame, TQString::tqfromLatin1( "fontBoardGame" ) );
KConfigSkeleton::ItemColor *itemBaseColorBoardGame;
- itemBaseColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorBoardGame, KGlobalSettings::baseColor() );
- addItem( itemBaseColorBoardGame, QString::fromLatin1( "baseColorBoardGame" ) );
+ itemBaseColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorBoardGame, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorBoardGame, TQString::tqfromLatin1( "baseColorBoardGame" ) );
KConfigSkeleton::ItemColor *itemTextColorBoardGame;
- itemTextColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorBoardGame, KGlobalSettings::textColor() );
- addItem( itemTextColorBoardGame, QString::fromLatin1( "textColorBoardGame" ) );
+ itemTextColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorBoardGame, KGlobalSettings::textColor() );
+ addItem( itemTextColorBoardGame, TQString::tqfromLatin1( "textColorBoardGame" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorBoardGame;
- itemHighlightedBaseColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBoardGame, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorBoardGame, QString::fromLatin1( "highlightedBaseColorBoardGame" ) );
+ itemHighlightedBaseColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBoardGame, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorBoardGame, TQString::tqfromLatin1( "highlightedBaseColorBoardGame" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorBoardGame;
- itemHighlightedTextColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBoardGame, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorBoardGame, QString::fromLatin1( "highlightedTextColorBoardGame" ) );
+ itemHighlightedTextColorBoardGame = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBoardGame, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorBoardGame, TQString::tqfromLatin1( "highlightedTextColorBoardGame" ) );
- setCurrentGroup( QString::fromLatin1( "Options - entry" ) );
+ setCurrentGroup( TQString::tqfromLatin1( "Options - entry" ) );
KConfigSkeleton::ItemString *itemTemplateBase;
- itemTemplateBase = new KConfigSkeleton::ItemString( currentGroup(), QString::fromLatin1( "Entry Template" ), mTemplateBase, QString::fromLatin1( "Fancy" ) );
- addItem( itemTemplateBase, QString::fromLatin1( "templateBase" ) );
+ itemTemplateBase = new KConfigSkeleton::ItemString( currentGroup(), TQString::tqfromLatin1( "Entry Template" ), mTemplateBase, TQString::tqfromLatin1( "Fancy" ) );
+ addItem( itemTemplateBase, TQString::tqfromLatin1( "templateBase" ) );
KConfigSkeleton::ItemFont *itemFontBase;
- itemFontBase = new KConfigSkeleton::ItemFont( currentGroup(), QString::fromLatin1( "Template Font" ), mFontBase, KGlobalSettings::generalFont() );
- addItem( itemFontBase, QString::fromLatin1( "fontBase" ) );
+ itemFontBase = new KConfigSkeleton::ItemFont( currentGroup(), TQString::tqfromLatin1( "Template Font" ), mFontBase, KGlobalSettings::generalFont() );
+ addItem( itemFontBase, TQString::tqfromLatin1( "fontBase" ) );
KConfigSkeleton::ItemColor *itemBaseColorBase;
- itemBaseColorBase = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Base Color" ), mBaseColorBase, KGlobalSettings::baseColor() );
- addItem( itemBaseColorBase, QString::fromLatin1( "baseColorBase" ) );
+ itemBaseColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Base Color" ), mBaseColorBase, KGlobalSettings::baseColor() );
+ addItem( itemBaseColorBase, TQString::tqfromLatin1( "baseColorBase" ) );
KConfigSkeleton::ItemColor *itemTextColorBase;
- itemTextColorBase = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Text Color" ), mTextColorBase, KGlobalSettings::textColor() );
- addItem( itemTextColorBase, QString::fromLatin1( "textColorBase" ) );
+ itemTextColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Text Color" ), mTextColorBase, KGlobalSettings::textColor() );
+ addItem( itemTextColorBase, TQString::tqfromLatin1( "textColorBase" ) );
KConfigSkeleton::ItemColor *itemHighlightedBaseColorBase;
- itemHighlightedBaseColorBase = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBase, KGlobalSettings::highlightColor() );
- addItem( itemHighlightedBaseColorBase, QString::fromLatin1( "highlightedBaseColorBase" ) );
+ itemHighlightedBaseColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlight Color" ), mHighlightedBaseColorBase, KGlobalSettings::highlightColor() );
+ addItem( itemHighlightedBaseColorBase, TQString::tqfromLatin1( "highlightedBaseColorBase" ) );
KConfigSkeleton::ItemColor *itemHighlightedTextColorBase;
- itemHighlightedTextColorBase = new KConfigSkeleton::ItemColor( currentGroup(), QString::fromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBase, KGlobalSettings::highlightedTextColor() );
- addItem( itemHighlightedTextColorBase, QString::fromLatin1( "highlightedTextColorBase" ) );
+ itemHighlightedTextColorBase = new KConfigSkeleton::ItemColor( currentGroup(), TQString::tqfromLatin1( "Template Highlighted Text Color" ), mHighlightedTextColorBase, KGlobalSettings::highlightedTextColor() );
+ addItem( itemHighlightedTextColorBase, TQString::tqfromLatin1( "highlightedTextColorBase" ) );
}
Config::~Config()
diff --git a/src/core/tellico_config_addons.cpp b/src/core/tellico_config_addons.cpp
index 9b388d5..e4e7260 100644
--- a/src/core/tellico_config_addons.cpp
+++ b/src/core/tellico_config_addons.cpp
@@ -54,7 +54,7 @@
SET(name, BoardGame, value)
namespace {
- static const QRegExp commaSplit = QRegExp(QString::fromLatin1("\\s*,\\s*"));
+ static const TQRegExp commaSplit = TQRegExp(TQString::tqfromLatin1("\\s*,\\s*"));
}
using Tellico::Config;
@@ -64,96 +64,96 @@ void Config::deleteAndReset() {
mSelf = 0;
}
-QStringList Config::noCapitalizationList() {
- return QStringList::split(commaSplit, Config::noCapitalizationString());
+TQStringList Config::noCapitalizationList() {
+ return TQStringList::split(commaSplit, Config::noCapitalizationString());
}
-QStringList Config::articleList() {
- return QStringList::split(commaSplit, Config::articlesString());
+TQStringList Config::articleList() {
+ return TQStringList::split(commaSplit, Config::articlesString());
}
-QStringList Config::nameSuffixList() {
- return QStringList::split(commaSplit, Config::nameSuffixesString());
+TQStringList Config::nameSuffixList() {
+ return TQStringList::split(commaSplit, Config::nameSuffixesString());
}
-QStringList Config::surnamePrefixList() {
- return QStringList::split(commaSplit, Config::surnamePrefixesString());
+TQStringList Config::surnamePrefixList() {
+ return TQStringList::split(commaSplit, Config::surnamePrefixesString());
}
-QString Config::templateName(int type_) {
+TQString Config::templateName(int type_) {
switch(type_) {
ALL_GET(template);
}
- return QString();
+ return TQString();
}
-QFont Config::templateFont(int type_) {
+TQFont Config::templateFont(int type_) {
switch(type_) {
ALL_GET(font);
}
- return QFont();
+ return TQFont();
}
-QColor Config::templateBaseColor(int type_) {
+TQColor Config::templateBaseColor(int type_) {
switch(type_) {
ALL_GET(baseColor)
}
- return QColor();
+ return TQColor();
}
-QColor Config::templateTextColor(int type_) {
+TQColor Config::templateTextColor(int type_) {
switch(type_) {
ALL_GET(textColor)
}
- return QColor();
+ return TQColor();
}
-QColor Config::templateHighlightedBaseColor(int type_) {
+TQColor Config::templateHighlightedBaseColor(int type_) {
switch(type_) {
ALL_GET(highlightedBaseColor)
}
- return QColor();
+ return TQColor();
}
-QColor Config::templateHighlightedTextColor(int type_) {
+TQColor Config::templateHighlightedTextColor(int type_) {
switch(type_) {
ALL_GET(highlightedTextColor)
}
- return QColor();
+ return TQColor();
}
-void Config::setTemplateName(int type_, const QString& name_) {
+void Config::setTemplateName(int type_, const TQString& name_) {
switch(type_) {
ALL_SET(setTemplate,name_)
}
}
-void Config::setTemplateFont(int type_, const QFont& font_) {
+void Config::setTemplateFont(int type_, const TQFont& font_) {
switch(type_) {
ALL_SET(setFont,font_)
}
}
-void Config::setTemplateBaseColor(int type_, const QColor& color_) {
+void Config::setTemplateBaseColor(int type_, const TQColor& color_) {
switch(type_) {
ALL_SET(setBaseColor,color_)
}
}
-void Config::setTemplateTextColor(int type_, const QColor& color_) {
+void Config::setTemplateTextColor(int type_, const TQColor& color_) {
switch(type_) {
ALL_SET(setTextColor,color_)
}
}
-void Config::setTemplateHighlightedBaseColor(int type_, const QColor& color_) {
+void Config::setTemplateHighlightedBaseColor(int type_, const TQColor& color_) {
switch(type_) {
ALL_SET(setHighlightedBaseColor,color_)
}
}
-void Config::setTemplateHighlightedTextColor(int type_, const QColor& color_) {
+void Config::setTemplateHighlightedTextColor(int type_, const TQColor& color_) {
switch(type_) {
ALL_SET(setHighlightedTextColor,color_)
}
diff --git a/src/core/tellico_config_addons.h b/src/core/tellico_config_addons.h
index 7573257..7f243a3 100644
--- a/src/core/tellico_config_addons.h
+++ b/src/core/tellico_config_addons.h
@@ -16,21 +16,21 @@
public:
static void deleteAndReset();
- static QStringList noCapitalizationList();
- static QStringList articleList();
- static QStringList nameSuffixList();
- static QStringList surnamePrefixList();
+ static TQStringList noCapitalizationList();
+ static TQStringList articleList();
+ static TQStringList nameSuffixList();
+ static TQStringList surnamePrefixList();
- static QString templateName(int type);
- static QFont templateFont(int type);
- static QColor templateBaseColor(int type);
- static QColor templateTextColor(int type);
- static QColor templateHighlightedBaseColor(int type);
- static QColor templateHighlightedTextColor(int type);
+ static TQString templateName(int type);
+ static TQFont templateFont(int type);
+ static TQColor templateBaseColor(int type);
+ static TQColor templateTextColor(int type);
+ static TQColor templateHighlightedBaseColor(int type);
+ static TQColor templateHighlightedTextColor(int type);
- static void setTemplateName(int type, const QString& name);
- static void setTemplateFont(int type, const QFont& font);
- static void setTemplateBaseColor(int type, const QColor& color);
- static void setTemplateTextColor(int type, const QColor& color);
- static void setTemplateHighlightedBaseColor(int type, const QColor& color);
- static void setTemplateHighlightedTextColor(int type, const QColor& color);
+ static void setTemplateName(int type, const TQString& name);
+ static void setTemplateFont(int type, const TQFont& font);
+ static void setTemplateBaseColor(int type, const TQColor& color);
+ static void setTemplateTextColor(int type, const TQColor& color);
+ static void setTemplateHighlightedBaseColor(int type, const TQColor& color);
+ static void setTemplateHighlightedTextColor(int type, const TQColor& color);
diff --git a/src/datavectors.h b/src/datavectors.h
index 9dd8257..14e38d6 100644
--- a/src/datavectors.h
+++ b/src/datavectors.h
@@ -16,13 +16,13 @@
#include "ptrvector.h"
-#include <qmap.h>
-#include <qpair.h>
+#include <tqmap.h>
+#include <tqpair.h>
#include <ksharedptr.h>
namespace Tellico {
- typedef QMap<QString, QString> StringMap;
+ typedef TQMap<TQString, TQString> StringMap;
class Filter;
typedef KSharedPtr<Filter> FilterPtr;
@@ -51,8 +51,8 @@ namespace Tellico {
// first item is a vector of all entries that got added in the merge process
// second item is a pair of entries that had their track field modified
// since a music collection is the only one that would actually merge entries
- typedef QValueVector< QPair<EntryPtr, QString> > PairVector;
- typedef QPair<Data::EntryVec, PairVector> MergePair;
+ typedef TQValueVector< TQPair<EntryPtr, TQString> > PairVector;
+ typedef TQPair<Data::EntryVec, PairVector> MergePair;
class Borrower;
typedef KSharedPtr<Borrower> BorrowerPtr;
diff --git a/src/detailedentryitem.cpp b/src/detailedentryitem.cpp
index 0a71f25..4904e19 100644
--- a/src/detailedentryitem.cpp
+++ b/src/detailedentryitem.cpp
@@ -21,10 +21,10 @@
#include <klocale.h>
#include <kstringhandler.h>
-#include <qpainter.h>
-#include <qheader.h>
-#include <qdatetime.h>
-#include <qtimer.h>
+#include <tqpainter.h>
+#include <tqheader.h>
+#include <tqdatetime.h>
+#include <tqtimer.h>
namespace {
static const short ENTRY_MAX_MINUTES_MESSAGE = 5;
@@ -32,8 +32,8 @@ namespace {
using Tellico::DetailedEntryItem;
-DetailedEntryItem::DetailedEntryItem(DetailedListView* parent_, Data::EntryPtr entry_)
- : EntryItem(parent_, entry_), m_state(Normal), m_time(0), m_timer(0) {
+DetailedEntryItem::DetailedEntryItem(DetailedListView* tqparent_, Data::EntryPtr entry_)
+ : EntryItem(tqparent_, entry_), m_state(Normal), m_time(0), m_timer(0) {
}
DetailedEntryItem::~DetailedEntryItem() {
@@ -56,22 +56,22 @@ void DetailedEntryItem::setState(State state_) {
m_timer = 0;
} else {
if(!m_time) {
- m_time = new QTime;
+ m_time = new TQTime;
}
m_time->start();
if(!m_timer) {
- m_timer = new QTimer();
- m_timer->connect(m_timer, SIGNAL(timeout()), listView(), SLOT(triggerUpdate()));
+ m_timer = new TQTimer();
+ m_timer->connect(m_timer, TQT_SIGNAL(timeout()), listView(), TQT_SLOT(triggerUpdate()));
}
m_timer->start(30 * 1000); // every 30 seconds
}
// have to put this in a timer, or it doesn't update properly
- QTimer::singleShot(500, listView(), SLOT(triggerUpdate()));
+ TQTimer::singleShot(500, listView(), TQT_SLOT(triggerUpdate()));
}
-void DetailedEntryItem::paintCell(QPainter* p_, const QColorGroup& cg_,
+void DetailedEntryItem::paintCell(TQPainter* p_, const TQColorGroup& cg_,
int column_, int width_, int align_) {
if(m_state == Normal) {
EntryItem::paintCell(p_, cg_, column_, width_, align_);
@@ -84,7 +84,7 @@ void DetailedEntryItem::paintCell(QPainter* p_, const QColorGroup& cg_,
t = 0;
}
- QFont f = p_->font();
+ TQFont f = p_->font();
f.setBold(true);
if(m_state == New) {
f.setItalic(true);
@@ -92,22 +92,22 @@ void DetailedEntryItem::paintCell(QPainter* p_, const QColorGroup& cg_,
p_->setFont(f);
// taken from ListViewItem, but without line drawn to right of cell
- QColorGroup cg = cg_;
- const QPixmap* pm = listView()->viewport()->backgroundPixmap();
+ TQColorGroup cg = cg_;
+ const TQPixmap* pm = listView()->viewport()->backgroundPixmap();
if(pm && !pm->isNull()) {
- cg.setBrush(QColorGroup::Base, QBrush(backgroundColor(column_), *pm));
- QPoint o = p_->brushOrigin();
+ cg.setBrush(TQColorGroup::Base, TQBrush(backgroundColor(column_), *pm));
+ TQPoint o = p_->brushOrigin();
p_->setBrushOrigin(o.x()-listView()->contentsX(), o.y()-listView()->contentsY());
} else {
- cg.setColor(listView()->viewport()->backgroundMode() == Qt::FixedColor ?
- QColorGroup::Background : QColorGroup::Base,
+ cg.setColor(listView()->viewport()->backgroundMode() == TQt::FixedColor ?
+ TQColorGroup::Background : TQColorGroup::Base,
backgroundColor(column_));
}
// don't call KListViewItem::paintCell() since that also does alternate painting, etc...
- QListViewItem::paintCell(p_, cg, column_, width_, align_);
+ TQListViewItem::paintCell(p_, cg, column_, width_, align_);
}
-QColor DetailedEntryItem::backgroundColor(int column_) {
+TQColor DetailedEntryItem::backgroundColor(int column_) {
GUI::ListView* lv = listView();
if(!lv || m_state == Normal || isSelected()) {
return EntryItem::backgroundColor(column_);
@@ -116,12 +116,12 @@ QColor DetailedEntryItem::backgroundColor(int column_) {
if(t > ENTRY_MAX_MINUTES_MESSAGE) {
return EntryItem::backgroundColor(column_);
}
- return blendColors(lv->colorGroup().highlight(),
- lv->colorGroup().base(),
+ return blendColors(lv->tqcolorGroup().highlight(),
+ lv->tqcolorGroup().base(),
80 + 20*t/ENTRY_MAX_MINUTES_MESSAGE /* percent */);
// no more than 20% of highlight color
}
-void DetailedEntryItem::paintFocus(QPainter*, const QColorGroup&, const QRect&) {
+void DetailedEntryItem::paintFocus(TQPainter*, const TQColorGroup&, const TQRect&) {
// don't paint anything
}
diff --git a/src/detailedentryitem.h b/src/detailedentryitem.h
index 50f0671..719e7d0 100644
--- a/src/detailedentryitem.h
+++ b/src/detailedentryitem.h
@@ -14,8 +14,8 @@
#ifndef TELLICO_DETAILEDENTRYITEM_H
#define TELLICO_DETAILEDENTRYITEM_H
-class QTime;
-class QTimer;
+class TQTime;
+class TQTimer;
#include "entryitem.h"
@@ -30,24 +30,24 @@ class DetailedEntryItem : public EntryItem {
public:
enum State { Normal, New, Modified };
- DetailedEntryItem(DetailedListView* parent, Data::EntryPtr entry);
+ DetailedEntryItem(DetailedListView* tqparent, Data::EntryPtr entry);
~DetailedEntryItem();
void setState(State state);
- virtual QColor backgroundColor(int column);
- virtual void paintCell(QPainter* p, const QColorGroup& cg,
+ virtual TQColor backgroundColor(int column);
+ virtual void paintCell(TQPainter* p, const TQColorGroup& cg,
int column, int width, int align);
private:
/**
* Paints a focus indicator on the rectangle (current item). Disable for current items.
*/
- void paintFocus(QPainter*, const QColorGroup&, const QRect&);
+ void paintFocus(TQPainter*, const TQColorGroup&, const TQRect&);
State m_state;
- QTime* m_time;
- QTimer* m_timer;
+ TQTime* m_time;
+ TQTimer* m_timer;
};
}
diff --git a/src/detailedlistview.cpp b/src/detailedlistview.cpp
index 5c4e2d2..3256bcb 100644
--- a/src/detailedlistview.cpp
+++ b/src/detailedlistview.cpp
@@ -30,10 +30,10 @@
#include <kiconloader.h>
#include <kpopupmenu.h>
-#include <qptrlist.h>
-#include <qstringlist.h>
-#include <qvaluelist.h>
-#include <qheader.h>
+#include <tqptrlist.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+#include <tqheader.h>
namespace {
static const int MIN_COL_WIDTH = 50;
@@ -41,8 +41,8 @@ namespace {
using Tellico::DetailedListView;
-DetailedListView::DetailedListView(QWidget* parent_, const char* name_/*=0*/)
- : GUI::ListView(parent_, name_), m_filter(0),
+DetailedListView::DetailedListView(TQWidget* tqparent_, const char* name_/*=0*/)
+ : GUI::ListView(tqparent_, name_), m_filter(0),
m_prevSortColumn(-1), m_prev2SortColumn(-1), m_firstSection(-1),
m_pixWidth(50), m_pixHeight(50) {
// myDebug() << "DetailedListView()" << endl;
@@ -50,25 +50,25 @@ DetailedListView::DetailedListView(QWidget* parent_, const char* name_/*=0*/)
setShowSortIndicator(true);
setShadeSortColumn(true);
-// connect(this, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()));
- connect(this, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)),
- SLOT(contextMenuRequested(QListViewItem*, const QPoint&, int)));
- connect(header(), SIGNAL(indexChange(int, int, int)),
- SLOT(slotUpdatePixmap()));
+// connect(this, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelectionChanged()));
+ connect(this, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)),
+ TQT_SLOT(contextMenuRequested(TQListViewItem*, const TQPoint&, int)));
+ connect(header(), TQT_SIGNAL(indexChange(int, int, int)),
+ TQT_SLOT(slotUpdatePixmap()));
// header menu
header()->setClickEnabled(true);
header()->installEventFilter(this);
- connect(header(), SIGNAL(sizeChange(int, int, int)),
- this, SLOT(slotCacheColumnWidth(int, int, int)));
+ connect(header(), TQT_SIGNAL(sizeChange(int, int, int)),
+ this, TQT_SLOT(slotCacheColumnWidth(int, int, int)));
m_headerMenu = new KPopupMenu(this);
m_headerMenu->setCheckable(true);
m_headerMenu->insertTitle(i18n("View Columns"));
- connect(m_headerMenu, SIGNAL(activated(int)),
- this, SLOT(slotHeaderMenuActivated(int)));
+ connect(m_headerMenu, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(slotHeaderMenuActivated(int)));
- m_checkPix = UserIcon(QString::fromLatin1("checkmark"));
+ m_checkPix = UserIcon(TQString::tqfromLatin1("checkmark"));
}
DetailedListView::~DetailedListView() {
@@ -82,37 +82,37 @@ void DetailedListView::addCollection(Data::CollPtr coll_) {
m_imageColumns.clear();
// myDebug() << "DetailedListView::addCollection()" << endl;
- KConfigGroup config(kapp->config(), QString::fromLatin1("Options - %1").arg(coll_->typeName()));
+ KConfigGroup config(kapp->config(), TQString::tqfromLatin1("Options - %1").tqarg(coll_->typeName()));
- QString configN;
+ TQString configN;
if(coll_->type() == Data::Collection::Base) {
KURL url = Kernel::self()->URL();
for(uint i = 0; i < Config::maxCustomURLSettings(); ++i) {
- KURL u = config.readEntry(QString::fromLatin1("URL_%1").arg(i));
+ KURL u = config.readEntry(TQString::tqfromLatin1("URL_%1").tqarg(i));
if(u == url) {
- configN = QString::fromLatin1("_%1").arg(i);
+ configN = TQString::tqfromLatin1("_%1").tqarg(i);
break;
}
}
}
- QStringList colNames = config.readListEntry("ColumnNames" + configN);
+ TQStringList colNames = config.readListEntry("ColumnNames" + configN);
if(colNames.isEmpty()) {
- colNames = QString::fromLatin1("title");
+ colNames = TQString::tqfromLatin1("title");
}
// this block compensates for the chance that the user added a field and it wasn't
- // written to the widths. Also compensates for 0.5.x to 0.6.x column layout changes
- QValueList<int> colWidths = config.readIntListEntry("ColumnWidths" + configN);
+ // written to the widths. Also compensates for 0.5.x to 0.6.x column tqlayout changes
+ TQValueList<int> colWidths = config.readIntListEntry("ColumnWidths" + configN);
if(colWidths.empty()) {
colWidths.insert(colWidths.begin(), colNames.count(), -1); // automatic width
}
- QValueList<int> colOrder = config.readIntListEntry("ColumnOrder" + configN);
+ TQValueList<int> colOrder = config.readIntListEntry("ColumnOrder" + configN);
// need to remove values for fields which don't exist in the current collection
- QStringList newCols;
- QValueList<int> newWidths, removeCols;
+ TQStringList newCols;
+ TQValueList<int> newWidths, removeCols;
for(uint i = 0; i < colNames.count(); ++i) {
if(!colNames[i].isEmpty() && coll_->hasField(colNames[i])) {
newCols += colNames[i];
@@ -127,9 +127,9 @@ void DetailedListView::addCollection(Data::CollPtr coll_) {
qHeapSort(removeCols);
// now need to shift values in the order if any columns were removed
// only need to shift by number of "holes"
- QValueList<int> newOrder;
- for(QValueList<int>::ConstIterator it = colOrder.begin(); it != colOrder.end(); ++it) {
- if(removeCols.findIndex(*it) == -1) {
+ TQValueList<int> newOrder;
+ for(TQValueList<int>::ConstIterator it = colOrder.begin(); it != colOrder.end(); ++it) {
+ if(removeCols.tqfindIndex(*it) == -1) {
int i = *it;
for(uint j = 0; j < removeCols.count() && removeCols[j] < i; ++j) {
--i;
@@ -142,7 +142,7 @@ void DetailedListView::addCollection(Data::CollPtr coll_) {
bool none = true;
Data::FieldVec fields = coll_->fields();
for(Data::FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) {
- if(colNames.findIndex(fIt->name()) > -1 && colWidths.count() > 0) {
+ if(colNames.tqfindIndex(fIt->name()) > -1 && colWidths.count() > 0) {
addField(fIt, colWidths.front());
if(none && colWidths.front() != 0) {
none = false;
@@ -153,10 +153,10 @@ void DetailedListView::addCollection(Data::CollPtr coll_) {
}
}
if(none && columns() > 0 && !colNames.isEmpty()) {
- showColumn(coll_->fieldNames().findIndex(colNames[0]));
+ showColumn(coll_->fieldNames().tqfindIndex(colNames[0]));
}
- QValueList<int>::ConstIterator it = colOrder.begin();
+ TQValueList<int>::ConstIterator it = colOrder.begin();
for(int i = 0; it != colOrder.end(); ++it) {
header()->moveSection(i++, *it);
}
@@ -298,7 +298,7 @@ void DetailedListView::removeCollection(Data::CollPtr coll_) {
m_columnWidths.clear();
clearComparisons();
- m_entryPix = QPixmap();
+ m_entryPix = TQPixmap();
// clear the filter, too
m_filter = 0;
@@ -337,7 +337,7 @@ void DetailedListView::populateItem(DetailedEntryItem* item_) {
}
}
-void DetailedListView::contextMenuRequested(QListViewItem* item_, const QPoint& point_, int) {
+void DetailedListView::contextMenuRequested(TQListViewItem* item_, const TQPoint& point_, int) {
if(!item_) {
return;
}
@@ -346,7 +346,7 @@ void DetailedListView::contextMenuRequested(QListViewItem* item_, const QPoint&
menu.exec(point_);
}
-// don't shadow QListView::setSelected
+// don't shadow TQListView::setSelected
void DetailedListView::setEntrySelected(Data::EntryPtr entry_) {
// myDebug() << "DetailedListView::setEntrySelected()" << endl;
// if entry_ is null pointer, just return
@@ -365,7 +365,7 @@ void DetailedListView::setEntrySelected(Data::EntryPtr entry_) {
}
Tellico::DetailedEntryItem* DetailedListView::locateItem(Data::EntryPtr entry_) {
- for(QListViewItemIterator it(this); it.current(); ++it) {
+ for(TQListViewItemIterator it(this); it.current(); ++it) {
DetailedEntryItem* item = static_cast<DetailedEntryItem*>(it.current());
if(item->entry() == entry_) {
return item;
@@ -375,11 +375,11 @@ Tellico::DetailedEntryItem* DetailedListView::locateItem(Data::EntryPtr entry_)
return 0;
}
-bool DetailedListView::eventFilter(QObject* obj_, QEvent* ev_) {
- if(ev_->type() == QEvent::MouseButtonPress
- && static_cast<QMouseEvent*>(ev_)->button() == Qt::RightButton
- && obj_ == header()) {
- m_headerMenu->popup(static_cast<QMouseEvent*>(ev_)->globalPos());
+bool DetailedListView::eventFilter(TQObject* obj_, TQEvent* ev_) {
+ if(ev_->type() == TQEvent::MouseButtonPress
+ && TQT_TQMOUSEEVENT(ev_)->button() == Qt::RightButton
+ && TQT_BASE_OBJECT(obj_) == TQT_BASE_OBJECT(header())) {
+ m_headerMenu->popup(TQT_TQMOUSEEVENT(ev_)->globalPos());
return true;
}
return GUI::ListView::eventFilter(obj_, ev_);
@@ -416,7 +416,7 @@ void DetailedListView::slotRefresh() {
// iterate over all items
- for(QListViewItemIterator it(this); it.current(); ++it) {
+ for(TQListViewItemIterator it(this); it.current(); ++it) {
item = static_cast<DetailedEntryItem*>(it.current());
setPixmapAndText(item, colNum, field);
@@ -434,7 +434,7 @@ void DetailedListView::slotRefresh() {
}
void DetailedListView::slotRefreshImages() {
- for(QValueVector<int>::const_iterator it = m_imageColumns.begin(); it != m_imageColumns.end(); ++it) {
+ for(TQValueVector<int>::const_iterator it = m_imageColumns.begin(); it != m_imageColumns.end(); ++it) {
if(columnWidth(*it) > 0) {
populateColumn(*it);
}
@@ -448,24 +448,24 @@ void DetailedListView::setPixmapAndText(DetailedEntryItem* item_, int col_, Data
// if the bool is not empty, show the checkmark pixmap
if(field_->type() == Data::Field::Bool) {
- const QString value = item_->entry()->field(field_);
- item_->setPixmap(col_, value.isEmpty() ? QPixmap() : m_checkPix);
- item_->setText(col_, QString::null);
+ const TQString value = item_->entry()->field(field_);
+ item_->setPixmap(col_, value.isEmpty() ? TQPixmap() : m_checkPix);
+ item_->setText(col_, TQString());
} else if(field_->type() == Data::Field::Image) {
// if we're currently loading a collection
// don't load the image just yet, it'll get refreshed later
if(m_loadingCollection || columnWidth(col_) == 0) {
- item_->setPixmap(col_, QPixmap());
- item_->setText(col_, QString::null);
+ item_->setPixmap(col_, TQPixmap());
+ item_->setText(col_, TQString());
} else {
item_->setPixmap(col_, ImageFactory::pixmap(item_->entry()->field(field_), m_pixWidth, m_pixHeight));
- item_->setText(col_, QString::null);
+ item_->setText(col_, TQString());
}
} else if(field_->type() == Data::Field::Rating) {
item_->setPixmap(col_, GUI::RatingWidget::pixmap(item_->entry()->field(field_)));
- item_->setText(col_, QString::null);
+ item_->setText(col_, TQString());
} else { // for everything else, there's no pixmap, unless it's the first column
- item_->setPixmap(col_, col_ == m_firstSection ? m_entryPix : QPixmap());
+ item_->setPixmap(col_, col_ == m_firstSection ? m_entryPix : TQPixmap());
item_->setText(col_, item_->entry()->formattedField(field_));
}
item_->widthChanged(col_);
@@ -475,13 +475,13 @@ void DetailedListView::showColumn(int col_) {
// myDebug() << "DetailedListView::showColumn() - " << columnText(col_) << endl;
int w = m_columnWidths[col_]; // this should be safe - all were initialized to 0
if(w == 0) {
- setColumnWidthMode(col_, QListView::Maximum);
- for(QListViewItemIterator it(this); it.current(); ++it) {
- w = QMAX(it.current()->width(fontMetrics(), this, col_), w);
+ setColumnWidthMode(col_, TQListView::Maximum);
+ for(TQListViewItemIterator it(this); it.current(); ++it) {
+ w = TQMAX(it.current()->width(fontMetrics(), this, col_), w);
}
- w = QMAX(w, MIN_COL_WIDTH);
+ w = TQMAX(w, MIN_COL_WIDTH);
} else {
- setColumnWidthMode(col_, QListView::Manual);
+ setColumnWidthMode(col_, TQListView::Manual);
}
setColumnWidth(col_, w);
@@ -494,7 +494,7 @@ void DetailedListView::showColumn(int col_) {
void DetailedListView::hideColumn(int col_) {
// myDebug() << "DetailedListView::hideColumn() - " << columnText(col_) << endl;
- setColumnWidthMode(col_, QListView::Manual);
+ setColumnWidthMode(col_, TQListView::Manual);
setColumnWidth(col_, 0);
header()->setResizeEnabled(false, col_);
@@ -505,8 +505,8 @@ void DetailedListView::hideColumn(int col_) {
Data::FieldPtr field = entry->collection()->fieldByTitle(columnText(col_));
if(field && field->type() == Data::Field::Image) {
m_isDirty[col_] = true;
- for(QListViewItemIterator it(this); it.current(); ++it) {
- it.current()->setPixmap(col_, QPixmap());
+ for(TQListViewItemIterator it(this); it.current(); ++it) {
+ it.current()->setPixmap(col_, TQPixmap());
}
}
}
@@ -524,7 +524,7 @@ void DetailedListView::slotCacheColumnWidth(int section_, int oldSize_, int newS
if(newSize_ > 0) {
m_columnWidths[section_] = newSize_;
}
- setColumnWidthMode(section_, QListView::Manual);
+ setColumnWidthMode(section_, TQListView::Manual);
}
void DetailedListView::setFilter(FilterPtr filter_) {
@@ -536,7 +536,7 @@ void DetailedListView::setFilter(FilterPtr filter_) {
int count = 0;
// iterate over all items
DetailedEntryItem* item;
- for(QListViewItemIterator it(this); it.current(); ++it) {
+ for(TQListViewItemIterator it(this); it.current(); ++it) {
item = static_cast<DetailedEntryItem*>(it.current());
if(m_filter && !m_filter->matches(item->entry())) {
item->setVisible(false);
@@ -561,17 +561,17 @@ void DetailedListView::addField(Data::FieldPtr field_, int width_) {
if(field_->type() == Data::Field::Bool
|| field_->type() == Data::Field::Number
|| field_->type() == Data::Field::Image) {
- setColumnAlignment(col, Qt::AlignHCenter | Qt::AlignVCenter);
+ setColumnAlignment(col, TQt::AlignHCenter | TQt::AlignVCenter);
if(field_->type() == Data::Field::Image) {
m_imageColumns.push_back(col);
}
} else {
- setColumnAlignment(col, Qt::AlignLeft | Qt::AlignVCenter);
+ setColumnAlignment(col, TQt::AlignLeft | TQt::AlignVCenter);
}
// width might be -1, which means set the width to maximum
// but m_columnWidths is the cached width, so just set it to 0
- m_columnWidths.push_back(QMAX(width_, 0));
+ m_columnWidths.push_back(TQMAX(width_, 0));
m_isDirty.push_back(true);
@@ -600,9 +600,9 @@ void DetailedListView::modifyField(Tellico::Data::CollPtr, Data::FieldPtr oldFie
if(newField_->type() == Data::Field::Bool
|| newField_->type() == Data::Field::Number
|| newField_->type() == Data::Field::Image) {
- setColumnAlignment(sec, Qt::AlignHCenter | Qt::AlignVCenter);
+ setColumnAlignment(sec, TQt::AlignHCenter | TQt::AlignVCenter);
if(oldField_->type() == Data::Field::Image) {
- QValueVector<int>::iterator it = qFind(m_imageColumns.begin(), m_imageColumns.end(), sec);
+ TQValueVector<int>::iterator it = tqFind(m_imageColumns.begin(), m_imageColumns.end(), sec);
if(it != m_imageColumns.end()) {
m_imageColumns.erase(it);
}
@@ -611,7 +611,7 @@ void DetailedListView::modifyField(Tellico::Data::CollPtr, Data::FieldPtr oldFie
m_imageColumns.push_back(sec);
}
} else {
- setColumnAlignment(sec, Qt::AlignLeft | Qt::AlignVCenter);
+ setColumnAlignment(sec, TQt::AlignLeft | TQt::AlignVCenter);
}
m_headerMenu->changeItem(m_headerMenu->idAt(sec+1), newField_->title()); // add 1 since menu has title
setComparison(sec, ListViewComparison::create(newField_));
@@ -663,19 +663,19 @@ void DetailedListView::reorderFields(const Data::FieldVec& fields_) {
}
}
- QStringList visible = visibleColumns();
+ TQStringList visible = visibleColumns();
for( ; it != fields_.end() && sec < columns(); ++sec, ++it) {
header()->setLabel(sec, it->title());
- bool isVisible = (visible.findIndex(it->title()) > -1);
+ bool isVisible = (visible.tqfindIndex(it->title()) > -1);
m_headerMenu->changeItem(m_headerMenu->idAt(sec+1), it->title());
m_headerMenu->setItemChecked(m_headerMenu->idAt(sec+1), isVisible);
m_columnWidths[sec] = 0;
if(it->type() == Data::Field::Bool
|| it->type() == Data::Field::Number
|| it->type() == Data::Field::Image) {
- setColumnAlignment(sec, Qt::AlignHCenter | Qt::AlignVCenter);
+ setColumnAlignment(sec, TQt::AlignHCenter | TQt::AlignVCenter);
} else {
- setColumnAlignment(sec, Qt::AlignLeft | Qt::AlignVCenter);
+ setColumnAlignment(sec, TQt::AlignLeft | TQt::AlignVCenter);
}
if(isVisible) {
@@ -740,23 +740,23 @@ void DetailedListView::slotUpdatePixmap() {
return;
}
- for(QListViewItemIterator it(this); it.current(); ++it) {
+ for(TQListViewItemIterator it(this); it.current(); ++it) {
setPixmapAndText(static_cast<DetailedEntryItem*>(it.current()), oldSection, field1);
setPixmapAndText(static_cast<DetailedEntryItem*>(it.current()), m_firstSection, field2);
}
}
void DetailedListView::saveConfig(Tellico::Data::CollPtr coll_, int configIndex_) {
- KConfigGroup config(kapp->config(), QString::fromLatin1("Options - %1").arg(coll_->typeName()));
+ KConfigGroup config(kapp->config(), TQString::tqfromLatin1("Options - %1").tqarg(coll_->typeName()));
// all of this is to have custom settings on a per file basis
- QString configN;
+ TQString configN;
if(coll_->type() == Data::Collection::Base) {
- QValueList<ConfigInfo> info;
+ TQValueList<ConfigInfo> info;
for(uint i = 0; i < Config::maxCustomURLSettings(); ++i) {
- KURL u = config.readEntry(QString::fromLatin1("URL_%1").arg(i));
+ KURL u = config.readEntry(TQString::tqfromLatin1("URL_%1").tqarg(i));
if(!u.isEmpty() && static_cast<int>(i) != configIndex_) {
- configN = QString::fromLatin1("_%1").arg(i);
+ configN = TQString::tqfromLatin1("_%1").tqarg(i);
ConfigInfo ci;
ci.cols = config.readListEntry("ColumnNames" + configN);
ci.widths = config.readIntListEntry("ColumnWidths" + configN);
@@ -769,10 +769,10 @@ void DetailedListView::saveConfig(Tellico::Data::CollPtr coll_, int configIndex_
}
}
// subtract one since we're writing the current settings, too
- uint limit = QMIN(info.count(), Config::maxCustomURLSettings()-1);
+ uint limit = TQMIN(info.count(), Config::maxCustomURLSettings()-1);
for(uint i = 0; i < limit; ++i) {
// starts at one since the current config will be written below
- configN = QString::fromLatin1("_%1").arg(i+1);
+ configN = TQString::tqfromLatin1("_%1").tqarg(i+1);
config.writeEntry("ColumnNames" + configN, info[i].cols);
config.writeEntry("ColumnWidths" + configN, info[i].widths);
config.writeEntry("ColumnOrder" + configN, info[i].order);
@@ -781,12 +781,12 @@ void DetailedListView::saveConfig(Tellico::Data::CollPtr coll_, int configIndex_
config.writeEntry("PrevSortColumn" + configN, info[i].prevSort);
config.writeEntry("Prev2SortColumn" + configN, info[i].prev2Sort);
}
- configN = QString::fromLatin1("_0");
+ configN = TQString::tqfromLatin1("_0");
}
- QValueList<int> widths, order;
+ TQValueList<int> widths, order;
for(int i = 0; i < columns(); ++i) {
- if(columnWidthMode(i) == QListView::Manual) {
+ if(columnWidthMode(i) == TQListView::Manual) {
widths += columnWidth(i);
} else {
widths += -1; // Maximum width mode
@@ -801,27 +801,27 @@ void DetailedListView::saveConfig(Tellico::Data::CollPtr coll_, int configIndex_
config.writeEntry("PrevSortColumn" + configN, prevSortedColumn());
config.writeEntry("Prev2SortColumn" + configN, prev2SortedColumn());
- QStringList colNames;
+ TQStringList colNames;
for(int col = 0; col < columns(); ++col) {
colNames += coll_->fieldNameByTitle(columnText(col));
}
config.writeEntry("ColumnNames" + configN, colNames);
}
-QString DetailedListView::sortColumnTitle1() const {
- return columnSorted() == -1 ? QString::null : header()->label(columnSorted());
+TQString DetailedListView::sortColumnTitle1() const {
+ return columnSorted() == -1 ? TQString() : header()->label(columnSorted());
}
-QString DetailedListView::sortColumnTitle2() const {
- return prevSortedColumn() == -1 ? QString::null : header()->label(prevSortedColumn());
+TQString DetailedListView::sortColumnTitle2() const {
+ return prevSortedColumn() == -1 ? TQString() : header()->label(prevSortedColumn());
}
-QString DetailedListView::sortColumnTitle3() const {
- return prev2SortedColumn() == -1 ? QString::null : header()->label(prev2SortedColumn());
+TQString DetailedListView::sortColumnTitle3() const {
+ return prev2SortedColumn() == -1 ? TQString() : header()->label(prev2SortedColumn());
}
-QStringList DetailedListView::visibleColumns() const {
- QStringList titles;
+TQStringList DetailedListView::visibleColumns() const {
+ TQStringList titles;
for(int i = 0; i < columns(); ++i) {
if(columnWidth(header()->mapToSection(i)) > 0) {
titles << columnText(header()->mapToSection(i));
@@ -835,7 +835,7 @@ Tellico::Data::EntryVec DetailedListView::visibleEntries() {
// We could just return the full collection entry list if the filter is 0
// but printing depends on the sorted order
Data::EntryVec entries;
- for(QListViewItemIterator it(this); it.current(); ++it) {
+ for(TQListViewItemIterator it(this); it.current(); ++it) {
if(it.current()->isVisible()) {
entries.append(static_cast<DetailedEntryItem*>(it.current())->entry());
}
@@ -845,7 +845,7 @@ Tellico::Data::EntryVec DetailedListView::visibleEntries() {
void DetailedListView::selectAllVisible() {
blockSignals(true);
- for(QListViewItemIterator it(this); it.current(); ++it) {
+ for(TQListViewItemIterator it(this); it.current(); ++it) {
if(it.current()->isVisible()) {
setSelected(it.current(), true);
}
@@ -855,8 +855,8 @@ void DetailedListView::selectAllVisible() {
slotSelectionChanged();
}
-void DetailedListView::resetEntryStatus() {
- for(QListViewItemIterator it(this); it.current(); ++it) {
+void DetailedListView::resetEntrytqStatus() {
+ for(TQListViewItemIterator it(this); it.current(); ++it) {
static_cast<DetailedEntryItem*>(it.current())->setState(DetailedEntryItem::Normal);
}
triggerUpdate();
diff --git a/src/detailedlistview.h b/src/detailedlistview.h
index c6c7299..c0efa9d 100644
--- a/src/detailedlistview.h
+++ b/src/detailedlistview.h
@@ -18,9 +18,9 @@
#include "observer.h"
#include "filter.h"
-#include <qstringlist.h>
-#include <qpixmap.h>
-#include <qvaluevector.h>
+#include <tqstringlist.h>
+#include <tqpixmap.h>
+#include <tqvaluevector.h>
class KPopupMenu;
@@ -35,21 +35,22 @@ namespace Tellico {
*/
class DetailedListView : public GUI::ListView, public Observer {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* The constructor initializes the popup menu, but no columns are inserted.
*
- * @param parent A pointer to the parent widget
+ * @param tqparent A pointer to the tqparent widget
* @param name The widget name
*/
- DetailedListView(QWidget* parent, const char* name=0);
+ DetailedListView(TQWidget* tqparent, const char* name=0);
~DetailedListView();
/**
* Event filter used to popup the menu
*/
- bool eventFilter(QObject* obj, QEvent* ev);
+ bool eventFilter(TQObject* obj, TQEvent* ev);
/**
* Selects the item which refers to a certain entry.
*
@@ -63,10 +64,10 @@ public:
int prev2SortedColumn() const;
virtual void setSorting(int column, bool ascending = true);
void setPrevSortedColumn(int prev1, int prev2);
- QString sortColumnTitle1() const;
- QString sortColumnTitle2() const;
- QString sortColumnTitle3() const;
- QStringList visibleColumns() const;
+ TQString sortColumnTitle1() const;
+ TQString sortColumnTitle2() const;
+ TQString sortColumnTitle3() const;
+ TQStringList visibleColumns() const;
Data::EntryVec visibleEntries();
/**
@@ -120,7 +121,7 @@ public:
* @param height Height
*/
void setPixmapSize(int width, int height) { m_pixWidth = width; m_pixHeight = height; }
- void resetEntryStatus();
+ void resetEntrytqStatus();
virtual int compare(int col, const GUI::ListViewItem* item1, GUI::ListViewItem* item2, bool asc);
@@ -174,7 +175,7 @@ private slots:
* @param point The location point
* @param col The column number, not currently used
*/
- void contextMenuRequested(QListViewItem* item, const QPoint& point, int col);
+ void contextMenuRequested(TQListViewItem* item, const TQPoint& point, int col);
void slotHeaderMenuActivated(int id);
void slotCacheColumnWidth(int section, int oldSize, int newSize);
/**
@@ -184,9 +185,9 @@ private slots:
private:
struct ConfigInfo {
- QStringList cols;
- QValueList<int> widths;
- QValueList<int> order;
+ TQStringList cols;
+ TQValueList<int> widths;
+ TQValueList<int> order;
int colSorted;
bool ascSort : 1;
int prevSort;
@@ -194,12 +195,12 @@ private:
};
KPopupMenu* m_headerMenu;
- QValueVector<int> m_columnWidths;
- QValueVector<bool> m_isDirty;
- QValueVector<int> m_imageColumns;
+ TQValueVector<int> m_columnWidths;
+ TQValueVector<bool> m_isDirty;
+ TQValueVector<int> m_imageColumns;
bool m_loadingCollection;
- QPixmap m_entryPix;
- QPixmap m_checkPix;
+ TQPixmap m_entryPix;
+ TQPixmap m_checkPix;
FilterPtr m_filter;
int m_prevSortColumn;
diff --git a/src/document.cpp b/src/document.cpp
index 6163af8..2d051a7 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -35,8 +35,8 @@
#include <kglobal.h>
#include <kapplication.h>
-#include <qregexp.h>
-#include <qtimer.h>
+#include <tqregexp.h>
+#include <tqtimer.h>
// use a vector so we can use a sort functor
#include <vector>
@@ -45,7 +45,7 @@
using Tellico::Data::Document;
Document* Document::s_self = 0;
-Document::Document() : QObject(), m_coll(0), m_isModified(false),
+Document::Document() : TQObject(), m_coll(0), m_isModified(false),
m_loadAllImages(false), m_validFile(false), m_importer(0), m_cancelImageWriting(false),
m_fileFormat(Import::TellicoImporter::Unknown) {
m_allImagesOnDisk = Config::imageLocation() != Config::ImagesInFile;
@@ -143,7 +143,7 @@ bool Document::openDocument(const KURL& url_) {
// }
if(m_importer->hasImages()) {
m_cancelImageWriting = false;
- QTimer::singleShot(500, this, SLOT(slotLoadAllImages()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotLoadAllImages()));
} else {
emit signalCollectionImagesLoaded(m_coll);
}
@@ -155,7 +155,7 @@ bool Document::saveModified() {
if(m_isModified) {
MainWindow* app = static_cast<MainWindow*>(Kernel::self()->widget());
- QString str = i18n("The current file has been modified.\n"
+ TQString str = i18n("The current file has been modified.\n"
"Do you want to save it?");
int want_save = KMessageBox::warningYesNoCancel(Kernel::self()->widget(), str, i18n("Unsaved Changes"),
KStdGuiItem::save(), KStdGuiItem::discard());
@@ -387,7 +387,7 @@ void Document::unMergeCollection(CollPtr coll_, FieldVec origFields_, MergePair
m_coll->blockSignals(true);
- QStringList origFieldNames;
+ TQStringList origFieldNames;
for(FieldVec::Iterator field = origFields_.begin(); field != origFields_.end(); ++field) {
m_coll->modifyField(field);
origFieldNames << field->name();
@@ -398,7 +398,7 @@ void Document::unMergeCollection(CollPtr coll_, FieldVec origFields_, MergePair
m_coll->removeEntries(entries);
// second item in pair are the entries which got modified by the original merge command
- const QString track = QString::fromLatin1("track");
+ const TQString track = TQString::tqfromLatin1("track");
PairVector trackChanges = entryPair_.second;
// need to go through them in reverse since one entry may have been modified multiple times
// first item in the pair is the entry pointer
@@ -411,7 +411,7 @@ void Document::unMergeCollection(CollPtr coll_, FieldVec origFields_, MergePair
// don't removeField() until after removeEntry() is done
FieldVec currFields = m_coll->fields();
for(FieldVec::Iterator field = currFields.begin(); field != currFields.end(); ++field) {
- if(origFieldNames.findIndex(field->name()) == -1) {
+ if(origFieldNames.tqfindIndex(field->name()) == -1) {
m_coll->removeField(field);
}
}
@@ -423,7 +423,7 @@ bool Document::isEmpty() const {
return (!m_coll || m_coll->entries().isEmpty());
}
-bool Document::loadImage(const QString& id_) {
+bool Document::loadImage(const TQString& id_) {
// myLog() << "Document::loadImage() - id = " << id_ << endl;
if(!m_coll) {
return false;
@@ -464,14 +464,14 @@ void Document::checkOutEntry(Data::EntryPtr entry_) {
return;
}
- const QString loaned = QString::fromLatin1("loaned");
+ const TQString loaned = TQString::tqfromLatin1("loaned");
if(!m_coll->hasField(loaned)) {
FieldPtr f = new Field(loaned, i18n("Loaned"), Field::Bool);
f->setFlags(Field::AllowGrouped);
f->setCategory(i18n("Personal"));
m_coll->addField(f);
}
- entry_->setField(loaned, QString::fromLatin1("true"));
+ entry_->setField(loaned, TQString::tqfromLatin1("true"));
EntryVec vec;
vec.append(entry_);
m_coll->updateDicts(vec);
@@ -482,15 +482,15 @@ void Document::checkInEntry(Data::EntryPtr entry_) {
return;
}
- const QString loaned = QString::fromLatin1("loaned");
+ const TQString loaned = TQString::tqfromLatin1("loaned");
if(!m_coll->hasField(loaned)) {
return;
}
- entry_->setField(loaned, QString::null);
+ entry_->setField(loaned, TQString());
m_coll->updateDicts(EntryVec(entry_));
}
-void Document::renameCollection(const QString& newTitle_) {
+void Document::renameCollection(const TQString& newTitle_) {
m_coll->setTitle(newTitle_);
}
@@ -498,7 +498,7 @@ void Document::renameCollection(const QString& newTitle_) {
// by loading every image, it gets pulled out of the zip file and
// copied to disk. then the zip file can be closed and not retained in memory
void Document::slotLoadAllImages() {
- QString id;
+ TQString id;
StringSet images;
Data::EntryVec entries = m_coll->entries();
Data::FieldVec imageFields = m_coll->imageFields();
@@ -534,15 +534,15 @@ void Document::slotLoadAllImages() {
void Document::writeAllImages(int cacheDir_, const KURL& localDir_) {
// images get 80 steps in saveDocument()
- const uint stepSize = 1 + QMAX(1, m_coll->entryCount()/80); // add 1 since it could round off
+ const uint stepSize = 1 + TQMAX(1, m_coll->entryCount()/80); // add 1 since it could round off
uint j = 1;
- QString oldLocalDir = ImageFactory::localDir();
+ TQString oldLocalDir = ImageFactory::localDir();
ImageFactory::setLocalDirectory(localDir_);
ImageFactory::CacheDir cacheDir = static_cast<ImageFactory::CacheDir>(cacheDir_);
- QString id;
+ TQString id;
StringSet images;
EntryVec entries = m_coll->entries();
FieldVec imageFields = m_coll->imageFields();
@@ -580,7 +580,7 @@ void Document::writeAllImages(int cacheDir_, const KURL& localDir_) {
bool Document::pruneImages() {
bool found = false;
- QString id;
+ TQString id;
StringSet images;
Data::EntryVec entries = m_coll->entries();
Data::FieldVec imageFields = m_coll->imageFields();
@@ -592,7 +592,7 @@ bool Document::pruneImages() {
}
const Data::Image& img = ImageFactory::imageById(id);
if(img.isNull()) {
- entry->setField(field, QString::null);
+ entry->setField(field, TQString());
found = true;
myDebug() << "Document::pruneImages() - removing null image for " << entry->title() << ": " << id << endl;
} else {
@@ -624,13 +624,13 @@ Tellico::Data::EntryVec Document::sortEntries(EntryVec entries_) const {
vec.push_back(e);
}
- QStringList titles = Controller::self()->sortTitles();
+ TQStringList titles = Controller::self()->sortTitles();
// have to go in reverse for sorting
for(int i = titles.count()-1; i >= 0; --i) {
if(titles[i].isEmpty()) {
continue;
}
- QString field = m_coll->fieldNameByTitle(titles[i]);
+ TQString field = m_coll->fieldNameByTitle(titles[i]);
std::sort(vec.begin(), vec.end(), EntryCmp(field));
}
@@ -663,15 +663,15 @@ void Document::removeImagesNotInCollection(EntryVec entries_, EntryVec entriesTo
StringSet imagesToRemove;
for(FieldVecIt f = fields.begin(); f != fields.end(); ++f) {
for(EntryVecIt e = entries_.begin(); e != entries_.end(); ++e) {
- QString id = e->field(f->name());
+ TQString id = e->field(f->name());
if(!id.isEmpty() && imagesToCheck.has(id) && !images.has(id)) {
imagesToRemove.add(id);
}
}
}
- const QStringList realImagesToRemove = imagesToRemove.toList();
- for(QStringList::ConstIterator it = realImagesToRemove.begin(); it != realImagesToRemove.end(); ++it) {
+ const TQStringList realImagesToRemove = imagesToRemove.toList();
+ for(TQStringList::ConstIterator it = realImagesToRemove.begin(); it != realImagesToRemove.end(); ++it) {
ImageFactory::removeImage(*it, false); // doesn't delete, just remove link
}
}
diff --git a/src/document.h b/src/document.h
index 82d74f7..2481df9 100644
--- a/src/document.h
+++ b/src/document.h
@@ -21,8 +21,8 @@
#include <kurl.h>
-#include <qobject.h>
-#include <qguardedptr.h>
+#include <tqobject.h>
+#include <tqguardedptr.h>
namespace Tellico {
namespace Import {
@@ -32,13 +32,14 @@ namespace Tellico {
/**
* The Document contains everything needed to deal with the contents, thus separated from
- * the viewer, the Tellico object. It can take of opening and saving documents, and contains
+ * the viewer, the Tellico object. It can take of opening and saving documents, and tqcontains
* a list of the collections in the document.
*
* @author Robby Stephenson
*/
-class Document : public QObject {
+class Document : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
static Document* self() { if(!s_self) s_self = new Document(); return s_self; }
@@ -135,7 +136,7 @@ public:
* since each entry in @p coll must be compared to ever entry in the current collection.
*
* @param coll A pointer to the collection to be merged.
- * @return A QPair of the merged entries, see note in datavectors.h
+ * @return A TQPair of the merged entries, see note in datavectors.h
*/
MergePair mergeCollection(CollPtr coll);
/**
@@ -150,7 +151,7 @@ public:
/**
* Attempts to load an image from the document file
*/
- bool loadImage(const QString& id);
+ bool loadImage(const TQString& id);
bool loadAllImagesNow() const;
bool allImagesOnDisk() const { return m_allImagesOnDisk; }
int imageCount() const;
@@ -160,7 +161,7 @@ public:
*/
EntryVec sortEntries(EntryVec entries) const;
- void renameCollection(const QString& newTitle);
+ void renameCollection(const TQString& newTitle);
void checkInEntry(EntryPtr entry);
void checkOutEntry(EntryPtr entry);
@@ -191,7 +192,7 @@ signals:
*
* @param str The message
*/
- void signalStatusMsg(const QString& str);
+ void signalStatusMsg(const TQString& str);
/**
* Signals that all images in the loaded file have been loaded
* into memory or onto the disk
@@ -226,7 +227,7 @@ private:
bool m_loadAllImages : 1;
KURL m_url;
bool m_validFile : 1;
- QGuardedPtr<Import::TellicoImporter> m_importer;
+ TQGuardedPtr<Import::TellicoImporter> m_importer;
bool m_cancelImageWriting : 1;
int m_fileFormat;
bool m_allImagesOnDisk : 1;
diff --git a/src/entry.cpp b/src/entry.cpp
index a558ba2..db16e0a 100644
--- a/src/entry.cpp
+++ b/src/entry.cpp
@@ -25,13 +25,13 @@
#include <klocale.h>
-#include <qregexp.h>
+#include <tqregexp.h>
using Tellico::Data::Entry;
using Tellico::Data::EntryGroup;
-EntryGroup::EntryGroup(const QString& group, const QString& field)
- : QObject(), EntryVec(), m_group(Tellico::shareString(group)), m_field(Tellico::shareString(field)) {
+EntryGroup::EntryGroup(const TQString& group, const TQString& field)
+ : TQObject(), EntryVec(), m_group(Tellico::shareString(group)), m_field(Tellico::shareString(field)) {
}
EntryGroup::~EntryGroup() {
@@ -48,16 +48,16 @@ bool Entry::operator==(const Entry& e1) {
e1.m_coll && e1.m_coll->type() == Collection::File) {
// don't forget case where both could have empty urls
// but different values for other fields
- QString u = field(QString::fromLatin1("url"));
+ TQString u = field(TQString::tqfromLatin1("url"));
if(!u.isEmpty()) {
// versions before 1.2.7 could have saved the url without the protocol
- bool b = KURL::fromPathOrURL(u) == KURL::fromPathOrURL(e1.field(QString::fromLatin1("url")));
+ bool b = KURL::fromPathOrURL(u) == KURL::fromPathOrURL(e1.field(TQString::tqfromLatin1("url")));
if(b) {
return true;
} else {
- Data::FieldPtr f = m_coll->fieldByName(QString::fromLatin1("url"));
- if(f && f->property(QString::fromLatin1("relative")) == Latin1Literal("true")) {
- return KURL(Document::self()->URL(), u) == KURL::fromPathOrURL(e1.field(QString::fromLatin1("url")));
+ Data::FieldPtr f = m_coll->fieldByName(TQString::tqfromLatin1("url"));
+ if(f && f->property(TQString::tqfromLatin1("relative")) == Latin1Literal("true")) {
+ return KURL(Document::self()->URL(), u) == KURL::fromPathOrURL(e1.field(TQString::tqfromLatin1("url")));
}
}
}
@@ -66,7 +66,7 @@ bool Entry::operator==(const Entry& e1) {
return false;
}
for(StringMap::ConstIterator it = e1.m_fields.begin(); it != e1.m_fields.end(); ++it) {
- if(!m_fields.contains(it.key()) || m_fields[it.key()] != it.data()) {
+ if(!m_fields.tqcontains(it.key()) || m_fields[it.key()] != it.data()) {
return false;
}
}
@@ -125,50 +125,50 @@ void Entry::setCollection(CollPtr coll_) {
// it would be better to do this in a real OOO way, but this should work
const bool addEntryType = m_coll->type() == Collection::Book &&
coll_->type() == Collection::Bibtex &&
- !m_coll->hasField(QString::fromLatin1("entry-type"));
+ !m_coll->hasField(TQString::tqfromLatin1("entry-type"));
m_coll = coll_;
m_id = -1;
// set this after changing the m_coll pointer since setField() checks field validity
if(addEntryType) {
- setField(QString::fromLatin1("entry-type"), QString::fromLatin1("book"));
+ setField(TQString::tqfromLatin1("entry-type"), TQString::tqfromLatin1("book"));
}
}
-QString Entry::title() const {
- return formattedField(QString::fromLatin1("title"));
+TQString Entry::title() const {
+ return formattedField(TQString::tqfromLatin1("title"));
}
-QString Entry::field(Data::FieldPtr field_, bool formatted_/*=false*/) const {
+TQString Entry::field(Data::FieldPtr field_, bool formatted_/*=false*/) const {
return field(field_->name(), formatted_);
}
-QString Entry::field(const QString& fieldName_, bool formatted_/*=false*/) const {
+TQString Entry::field(const TQString& fieldName_, bool formatted_/*=false*/) const {
if(formatted_) {
return formattedField(fieldName_);
}
FieldPtr f = m_coll->fieldByName(fieldName_);
if(!f) {
- return QString::null;
+ return TQString();
}
if(f->type() == Field::Dependent) {
return dependentValue(this, f->description(), false);
}
- if(!m_fields.isEmpty() && m_fields.contains(fieldName_)) {
+ if(!m_fields.isEmpty() && m_fields.tqcontains(fieldName_)) {
return m_fields[fieldName_];
}
- return QString::null;
+ return TQString();
}
-QString Entry::formattedField(Data::FieldPtr field_) const {
+TQString Entry::formattedField(Data::FieldPtr field_) const {
return formattedField(field_->name());
}
-QString Entry::formattedField(const QString& fieldName_) const {
+TQString Entry::formattedField(const TQString& fieldName_) const {
FieldPtr f = m_coll->fieldByName(fieldName_);
if(!f) {
- return QString::null;
+ return TQString();
}
Field::FormatFlag flag = f->formatFlag();
@@ -186,8 +186,8 @@ QString Entry::formattedField(const QString& fieldName_) const {
return field(fieldName_);
}
- if(m_formattedFields.isEmpty() || !m_formattedFields.contains(fieldName_)) {
- QString value = field(fieldName_);
+ if(m_formattedFields.isEmpty() || !m_formattedFields.tqcontains(fieldName_)) {
+ TQString value = field(fieldName_);
if(!value.isEmpty()) {
// special for Bibtex collections
if(m_coll->type() == Collection::Bibtex) {
@@ -202,33 +202,33 @@ QString Entry::formattedField(const QString& fieldName_) const {
return m_formattedFields[fieldName_];
}
-QStringList Entry::fields(Data::FieldPtr field_, bool formatted_) const {
+TQStringList Entry::fields(Data::FieldPtr field_, bool formatted_) const {
return fields(field_->name(), formatted_);
}
-QStringList Entry::fields(const QString& field_, bool formatted_) const {
- QString s = formatted_ ? formattedField(field_) : field(field_);
+TQStringList Entry::fields(const TQString& field_, bool formatted_) const {
+ TQString s = formatted_ ? formattedField(field_) : field(field_);
if(s.isEmpty()) {
- return QStringList();
+ return TQStringList();
}
return Field::split(s, true);
}
-bool Entry::setField(Data::FieldPtr field_, const QString& value_) {
+bool Entry::setField(Data::FieldPtr field_, const TQString& value_) {
return setField(field_->name(), value_);
}
-bool Entry::setField(const QString& name_, const QString& value_) {
+bool Entry::setField(const TQString& name_, const TQString& value_) {
if(name_.isEmpty()) {
kdWarning() << "Entry::setField() - empty field name for value: " << value_ << endl;
return false;
}
// an empty value means remove the field
if(value_.isEmpty()) {
- if(!m_fields.isEmpty() && m_fields.contains(name_)) {
+ if(!m_fields.isEmpty() && m_fields.tqcontains(name_)) {
m_fields.remove(name_);
}
- invalidateFormattedFieldValue(name_);
+ tqinvalidateFormattedFieldValue(name_);
return true;
}
@@ -259,12 +259,12 @@ bool Entry::setField(const QString& name_, const QString& value_) {
} else {
m_fields.insert(Tellico::shareString(name_), value_);
}
- invalidateFormattedFieldValue(name_);
+ tqinvalidateFormattedFieldValue(name_);
return true;
}
bool Entry::addToGroup(EntryGroup* group_) {
- if(!group_ || m_groups.contains(group_)) {
+ if(!group_ || m_groups.tqcontains(group_)) {
return false;
}
@@ -295,13 +295,13 @@ void Entry::clearGroups() {
// this function gets called before m_groups is updated. In fact, it is used to
// update that list. This is the function that actually parses the field values
// and returns the list of the group names.
-QStringList Entry::groupNamesByFieldName(const QString& fieldName_) const {
+TQStringList Entry::groupNamesByFieldName(const TQString& fieldName_) const {
// myDebug() << "Entry::groupsByfieldName() - " << fieldName_ << endl;
FieldPtr f = m_coll->fieldByName(fieldName_);
// easy if not allowing multiple values
if(!(f->flags() & Field::AllowMultiple)) {
- QString value = formattedField(fieldName_);
+ TQString value = formattedField(fieldName_);
if(value.isEmpty()) {
return i18n(Collection::s_emptyGroupTitle);
} else {
@@ -309,15 +309,15 @@ QStringList Entry::groupNamesByFieldName(const QString& fieldName_) const {
}
}
- QStringList groups = fields(fieldName_, true);
+ TQStringList groups = fields(fieldName_, true);
if(groups.isEmpty()) {
return i18n(Collection::s_emptyGroupTitle);
} else if(f->type() == Field::Table) {
// quick hack for tables, how often will a user have "::" in their value?
// only use first column for group
- QStringList::Iterator it = groups.begin();
+ TQStringList::Iterator it = groups.begin();
while(it != groups.end()) {
- (*it) = (*it).section(QString::fromLatin1("::"), 0, 0);
+ (*it) = (*it).section(TQString::tqfromLatin1("::"), 0, 0);
if((*it).isEmpty()) {
it = groups.remove(it); // points to next in list
} else {
@@ -329,33 +329,33 @@ QStringList Entry::groupNamesByFieldName(const QString& fieldName_) const {
}
bool Entry::isOwned() {
- return (m_coll && m_id > -1 && m_coll->entryCount() > 0 && m_coll->entries().contains(this));
+ return (m_coll && m_id > -1 && m_coll->entryCount() > 0 && m_coll->entries().tqcontains(this));
}
-// a null string means invalidate all
-void Entry::invalidateFormattedFieldValue(const QString& name_) {
+// a null string means tqinvalidate all
+void Entry::tqinvalidateFormattedFieldValue(const TQString& name_) {
if(name_.isNull()) {
m_formattedFields.clear();
- } else if(!m_formattedFields.isEmpty() && m_formattedFields.contains(name_)) {
+ } else if(!m_formattedFields.isEmpty() && m_formattedFields.tqcontains(name_)) {
m_formattedFields.remove(name_);
}
}
// format is something like "%{year} %{author}"
-QString Entry::dependentValue(ConstEntryPtr entry_, const QString& format_, bool formatted_) {
+TQString Entry::dependentValue(ConstEntryPtr entry_, const TQString& format_, bool formatted_) {
if(!entry_) {
return format_;
}
- QString result, fieldName;
+ TQString result, fieldName;
FieldPtr field;
int endPos;
int curPos = 0;
- int pctPos = format_.find('%', curPos);
+ int pctPos = format_.tqfind('%', curPos);
while(pctPos != -1 && pctPos+1 < static_cast<int>(format_.length())) {
if(format_[pctPos+1] == '{') {
- endPos = format_.find('}', pctPos+2);
+ endPos = format_.tqfind('}', pctPos+2);
if(endPos > -1) {
result += format_.mid(curPos, pctPos-curPos);
fieldName = format_.mid(pctPos+2, endPos-pctPos-2);
@@ -368,7 +368,7 @@ QString Entry::dependentValue(ConstEntryPtr entry_, const QString& format_, bool
// don't format, just capitalize
result += entry_->field(field, formatted_);
} else if(fieldName == Latin1Literal("id")) {
- result += QString::number(entry_->id());
+ result += TQString::number(entry_->id());
} else {
result += format_.mid(pctPos, endPos-pctPos+1);
}
@@ -380,7 +380,7 @@ QString Entry::dependentValue(ConstEntryPtr entry_, const QString& format_, bool
result += format_.mid(curPos, pctPos-curPos+1);
curPos = pctPos+1;
}
- pctPos = format_.find('%', curPos);
+ pctPos = format_.tqfind('%', curPos);
}
result += format_.mid(curPos, format_.length()-curPos);
// myDebug() << "Entry::dependentValue() - " << format_ << " = " << result << endl;
@@ -389,7 +389,7 @@ QString Entry::dependentValue(ConstEntryPtr entry_, const QString& format_, bool
return result.simplifyWhiteSpace();
}
-int Entry::compareValues(EntryPtr e1, EntryPtr e2, const QString& f, ConstCollPtr c) {
+int Entry::compareValues(EntryPtr e1, EntryPtr e2, const TQString& f, ConstCollPtr c) {
return compareValues(e1, e2, c->fieldByName(f));
}
@@ -397,8 +397,8 @@ int Entry::compareValues(EntryPtr e1, EntryPtr e2, FieldPtr f) {
if(!e1 || !e2 || !f) {
return 0;
}
- QString s1 = e1->field(f).lower();
- QString s2 = e2->field(f).lower();
+ TQString s1 = e1->field(f).lower();
+ TQString s2 = e2->field(f).lower();
if(s1.isEmpty() || s2.isEmpty()) {
return 0;
}
@@ -423,9 +423,9 @@ int Entry::compareValues(EntryPtr e1, EntryPtr e2, FieldPtr f) {
}
}
// try removing punctuation
- QRegExp notAlphaNum(QString::fromLatin1("[^\\s\\w]"));
- QString s1a = s1; s1a.remove(notAlphaNum);
- QString s2a = s2; s2a.remove(notAlphaNum);
+ TQRegExp notAlphaNum(TQString::tqfromLatin1("[^\\s\\w]"));
+ TQString s1a = s1; s1a.remove(notAlphaNum);
+ TQString s2a = s2; s2a.remove(notAlphaNum);
if(!s1a.isEmpty() && s1a == s2a) {
// myDebug() << "match without punctuation" << endl;
return 5;
@@ -436,26 +436,26 @@ int Entry::compareValues(EntryPtr e1, EntryPtr e2, FieldPtr f) {
// myDebug() << "match without articles" << endl;
return 3;
}
- // try removing everything between parentheses
- QRegExp rx(QString::fromLatin1("\\s*\\(.*\\)\\s*"));
+ // try removing everything between tqparentheses
+ TQRegExp rx(TQString::tqfromLatin1("\\s*\\(.*\\)\\s*"));
s1.remove(rx);
s2.remove(rx);
if(!s1.isEmpty() && s1 == s2) {
-// myDebug() << "match without parentheses" << endl;
+// myDebug() << "match without tqparentheses" << endl;
return 2;
}
if(f->flags() & Field::AllowMultiple) {
- QStringList sl1 = e1->fields(f, false);
- QStringList sl2 = e2->fields(f, false);
+ TQStringList sl1 = e1->fields(f, false);
+ TQStringList sl2 = e2->fields(f, false);
int matches = 0;
- for(QStringList::ConstIterator it = sl1.begin(); it != sl1.end(); ++it) {
- matches += sl2.contains(*it);
+ for(TQStringList::ConstIterator it = sl1.begin(); it != sl1.end(); ++it) {
+ matches += sl2.tqcontains(*it);
}
if(matches == 0 && f->formatFlag() == Field::FormatName) {
sl1 = e1->fields(f, true);
sl2 = e2->fields(f, true);
- for(QStringList::ConstIterator it = sl1.begin(); it != sl1.end(); ++it) {
- matches += sl2.contains(*it);
+ for(TQStringList::ConstIterator it = sl1.begin(); it != sl1.end(); ++it) {
+ matches += sl2.tqcontains(*it);
}
}
return matches;
diff --git a/src/entry.h b/src/entry.h
index bff3d7d..c589411 100644
--- a/src/entry.h
+++ b/src/entry.h
@@ -16,9 +16,9 @@
#include "datavectors.h"
-#include <qstringlist.h>
-#include <qstring.h>
-#include <qobject.h>
+#include <tqstringlist.h>
+#include <tqstring.h>
+#include <tqobject.h>
#include <functional>
@@ -34,23 +34,24 @@ namespace Tellico {
* David Weber. The @ref groupName() would be "Weber, David" and the
* @ref fieldName() would be "author".
*
- * It's a QObject because EntryGroupItem holds a QGuardedPtr
+ * It's a TQObject because EntryGroupItem holds a TQGuardedPtr
*
* @author Robby Stephenson
*/
-class EntryGroup : public QObject, public EntryVec {
+class EntryGroup : public TQObject, public EntryVec {
Q_OBJECT
+ TQ_OBJECT
public:
- EntryGroup(const QString& group, const QString& field);
+ EntryGroup(const TQString& group, const TQString& field);
~EntryGroup();
- const QString& groupName() const { return m_group; }
- const QString& fieldName() const { return m_field; }
+ const TQString& groupName() const { return m_group; }
+ const TQString& fieldName() const { return m_field; }
private:
- QString m_group;
- QString m_field;
+ TQString m_group;
+ TQString m_field;
};
/**
@@ -71,7 +72,7 @@ public:
* The constructor, which automatically sets the id to the current number
* of entries in the collection.
*
- * @param coll A pointer to the parent collection object
+ * @param coll A pointer to the tqparent collection object
*/
Entry(CollPtr coll);
Entry(CollPtr coll, int id);
@@ -96,28 +97,28 @@ public:
*
* @return The entry title
*/
- QString title() const;
+ TQString title() const;
/**
* Returns the value of the field with a given key name. If the key doesn't
- * exist, the method returns @ref QString::null.
+ * exist, the method returns @ref TQString().
*
* @param fieldName The field name
* @param formatted Whether to format the field or not.
* @return The value of the field
*/
- QString field(const QString& fieldName, bool formatted=false) const;
- QString field(Data::FieldPtr field, bool formatted=false) const;
+ TQString field(const TQString& fieldName, bool formatted=false) const;
+ TQString field(Data::FieldPtr field, bool formatted=false) const;
/**
* Returns the formatted value of the field with a given key name. If the
- * key doesn't exist, the method returns @ref QString::null. The value is cached,
+ * key doesn't exist, the method returns @ref TQString(). The value is cached,
* so the first time the value is requested, @ref Field::format is called.
* The second time, that lookup isn't necessary.
*
* @param fieldName The field name
* @return The formatted value of the field
*/
- QString formattedField(const QString& fieldName) const;
- QString formattedField(Data::FieldPtr field) const;
+ TQString formattedField(const TQString& fieldName) const;
+ TQString formattedField(Data::FieldPtr field) const;
/**
* Splits a field value. This is faster than calling Data::Field::split() since
* a regexp is not used, only a string.
@@ -126,8 +127,8 @@ public:
* @param format Whether to format the values or not
* @return The list of field values
*/
- QStringList fields(const QString& fieldName, bool formatted) const;
- QStringList fields(Data::FieldPtr field, bool formatted) const;
+ TQStringList fields(const TQString& fieldName, bool formatted) const;
+ TQStringList fields(Data::FieldPtr field, bool formatted) const;
/**
* Sets the value of an field for the entry. The method first verifies that
* the value is allowed for that particular key.
@@ -136,10 +137,10 @@ public:
* @param value The value of the field
* @return A boolean indicating whether or not the field was successfully set
*/
- bool setField(const QString& fieldName, const QString& value);
- bool setField(Data::FieldPtr field, const QString& value);
+ bool setField(const TQString& fieldName, const TQString& value);
+ bool setField(Data::FieldPtr field, const TQString& value);
/**
- * Returns a pointer to the parent collection of the entry.
+ * Returns a pointer to the tqparent collection of the entry.
*
* @return The collection pointer
*/
@@ -186,22 +187,22 @@ public:
* @param fieldName The name of the field
* @return The list of names
*/
- QStringList groupNamesByFieldName(const QString& fieldName) const;
+ TQStringList groupNamesByFieldName(const TQString& fieldName) const;
/**
* Returns a list of all the field values contained in the entry.
*
* @return The list of field values
*/
- QStringList fieldValues() const { return m_fields.values(); }
+ TQStringList fieldValues() const { return m_fields.values(); }
/**
* Returns a list of all the formatted field values contained in the entry.
*
* @return The list of field values
*/
- QStringList formattedFieldValues() const { return m_formattedFields.values(); }
+ TQStringList formattedFieldValues() const { return m_formattedFields.values(); }
/**
- * Returns a boolean indicating if the entry's parent collection recognizes
- * it existence, that is, the parent collection has this entry in its list.
+ * Returns a boolean indicating if the entry's tqparent collection recognizes
+ * it existence, that is, the tqparent collection has this entry in its list.
*
* @return Whether the entry is owned or not
*/
@@ -210,12 +211,12 @@ public:
* Removes the formatted value of the field from the map. This should be used when
* the field's format flag has changed.
*
- * @param name The name of the field that changed. QString::null means invalidate all fields.
+ * @param name The name of the field that changed. TQString() means tqinvalidate all fields.
*/
- void invalidateFormattedFieldValue(const QString& name=QString::null);
+ void tqinvalidateFormattedFieldValue(const TQString& name=TQString());
static int compareValues(EntryPtr entry1, EntryPtr entry2, FieldPtr field);
- static int compareValues(EntryPtr entry1, EntryPtr entry2, const QString& field, ConstCollPtr coll);
+ static int compareValues(EntryPtr entry1, EntryPtr entry2, const TQString& field, ConstCollPtr coll);
/**
* Construct the derived valued for an field. The format string should be
@@ -227,7 +228,7 @@ public:
* @param formatted Whether the inserted values should be formatted.
* @return The constructed field value
*/
- static QString dependentValue(ConstEntryPtr e, const QString& formatString, bool formatted);
+ static TQString dependentValue(ConstEntryPtr e, const TQString& formatString, bool formatted);
private:
CollPtr m_coll;
@@ -240,14 +241,14 @@ private:
class EntryCmp : public std::binary_function<EntryPtr, EntryPtr, bool> {
public:
- EntryCmp(const QString& field) : m_field(field) {}
+ EntryCmp(const TQString& field) : m_field(field) {}
bool operator()(EntryPtr e1, EntryPtr e2) const {
return e1->field(m_field) < e2->field(m_field);
}
private:
- QString m_field;
+ TQString m_field;
};
} // end namespace
diff --git a/src/entryeditdialog.cpp b/src/entryeditdialog.cpp
index db99d7f..bccfef7 100644
--- a/src/entryeditdialog.cpp
+++ b/src/entryeditdialog.cpp
@@ -30,15 +30,15 @@
#include <kpushbutton.h>
#include <kaccel.h>
-#include <qlayout.h>
-#include <qstringlist.h>
-#include <qpushbutton.h>
-#include <qvaluevector.h>
-#include <qvbox.h>
-#include <qobjectlist.h>
-#include <qtabbar.h>
-#include <qstyle.h>
-#include <qapplication.h>
+#include <tqlayout.h>
+#include <tqstringlist.h>
+#include <tqpushbutton.h>
+#include <tqvaluevector.h>
+#include <tqvbox.h>
+#include <tqobjectlist.h>
+#include <tqtabbar.h>
+#include <tqstyle.h>
+#include <tqapplication.h>
namespace {
// must be an even number
@@ -47,8 +47,8 @@ namespace {
using Tellico::EntryEditDialog;
-EntryEditDialog::EntryEditDialog(QWidget* parent_, const char* name_)
- : KDialogBase(parent_, name_, false, i18n("Edit Entry"), Help|User1|User2|User3|Apply|Close, User1, false,
+EntryEditDialog::EntryEditDialog(TQWidget* tqparent_, const char* name_)
+ : KDialogBase(tqparent_, name_, false, i18n("Edit Entry"), Help|User1|User2|User3|Apply|Close, User1, false,
KGuiItem(i18n("&New Entry"))),
m_currColl(0),
m_tabs(new GUI::TabControl(this)),
@@ -67,18 +67,18 @@ EntryEditDialog::EntryEditDialog(QWidget* parent_, const char* name_)
setButtonGuiItem(m_saveBtn, save);
enableButton(m_saveBtn, false);
- connect(this, SIGNAL(applyClicked()), SLOT(slotHandleSave()));
- connect(this, SIGNAL(user1Clicked()), SLOT(slotHandleNew()));
- connect(this, SIGNAL(user2Clicked()), SLOT(slotGoNextEntry()));
- connect(this, SIGNAL(user3Clicked()), SLOT(slotGoPrevEntry()));
+ connect(this, TQT_SIGNAL(applyClicked()), TQT_SLOT(slotHandleSave()));
+ connect(this, TQT_SIGNAL(user1Clicked()), TQT_SLOT(slotHandleNew()));
+ connect(this, TQT_SIGNAL(user2Clicked()), TQT_SLOT(slotGoNextEntry()));
+ connect(this, TQT_SIGNAL(user3Clicked()), TQT_SLOT(slotGoPrevEntry()));
KGuiItem prev;
- prev.setIconName(QString::fromLatin1(QApplication::reverseLayout() ? "forward" : "back"));
+ prev.setIconName(TQString::tqfromLatin1(TQApplication::reverseLayout() ? "forward" : "back"));
prev.setToolTip(i18n("Go to the previous entry in the collection"));
prev.setWhatsThis(prev.toolTip());
KGuiItem next;
- next.setIconName(QString::fromLatin1(QApplication::reverseLayout() ? "back" : "forward"));
+ next.setIconName(TQString::tqfromLatin1(TQApplication::reverseLayout() ? "back" : "forward"));
next.setToolTip(i18n("Go to the next entry in the collection"));
next.setWhatsThis(next.toolTip());
@@ -86,14 +86,14 @@ EntryEditDialog::EntryEditDialog(QWidget* parent_, const char* name_)
setButtonGuiItem(m_prevBtn, prev);
KAccel* accel = new KAccel(this);
- accel->insert(QString::fromLatin1("Go Prev"), QString(), prev.toolTip(), Qt::Key_PageUp,
- Controller::self(), SLOT(slotGoPrevEntry()));
- accel->insert(QString::fromLatin1("Go Next"), QString(), next.toolTip(), Qt::Key_PageDown,
- Controller::self(), SLOT(slotGoNextEntry()));
+ accel->insert(TQString::tqfromLatin1("Go Prev"), TQString(), prev.toolTip(), TQt::Key_PageUp,
+ Controller::self(), TQT_SLOT(slotGoPrevEntry()));
+ accel->insert(TQString::tqfromLatin1("Go Next"), TQString(), next.toolTip(), TQt::Key_PageDown,
+ Controller::self(), TQT_SLOT(slotGoNextEntry()));
- setHelp(QString::fromLatin1("entry-editor"));
+ setHelp(TQString::tqfromLatin1("entry-editor"));
- resize(configDialogSize(QString::fromLatin1("Edit Dialog Options")));
+ resize(configDialogSize(TQString::tqfromLatin1("Edit Dialog Options")));
}
void EntryEditDialog::slotClose() {
@@ -142,31 +142,31 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) {
m_currColl = coll_;
int maxHeight = 0;
- QPtrList<QWidget> gridList;
+ TQPtrList<TQWidget> gridList;
bool noChoices = true;
bool focusedFirst = false;
- QStringList catList = m_currColl->fieldCategories();
- for(QStringList::ConstIterator catIt = catList.begin(); catIt != catList.end(); ++catIt) {
+ TQStringList catList = m_currColl->fieldCategories();
+ for(TQStringList::ConstIterator catIt = catList.begin(); catIt != catList.end(); ++catIt) {
Data::FieldVec fields = m_currColl->fieldsByCategory(*catIt);
if(fields.isEmpty()) { // sanity check
continue;
}
- // if this layout model is changed, be sure to check slotUpdateField()
- QWidget* page = new QWidget(m_tabs);
- // (parent, margin, spacing)
- QVBoxLayout* boxLayout = new QVBoxLayout(page, 0, 0);
+ // if this tqlayout model is changed, be sure to check slotUpdateField()
+ TQWidget* page = new TQWidget(m_tabs);
+ // (tqparent, margin, spacing)
+ TQVBoxLayout* boxLayout = new TQVBoxLayout(page, 0, 0);
- QWidget* grid = new QWidget(page);
+ TQWidget* grid = new TQWidget(page);
gridList.append(grid);
- // (parent, nrows, ncols, margin, spacing)
+ // (tqparent, nrows, ncols, margin, spacing)
// spacing gets a bit weird, if there are absolutely no Choice fields,
// then spacing should be 5, which is set later
- QGridLayout* layout = new QGridLayout(grid, 0, NCOLS, 8, 2);
+ TQGridLayout* tqlayout = new TQGridLayout(grid, 0, NCOLS, 8, 2);
// keramik styles make big widget, cut down the spacing a bit
- if(QCString(style().name()).lower().find("keramik", 0, false) > -1) {
- layout->setSpacing(0);
+ if(TQCString(tqstyle().name()).lower().tqfind("keramik", 0, false) > -1) {
+ tqlayout->setSpacing(0);
}
boxLayout->addWidget(grid, 0);
@@ -176,8 +176,8 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) {
}
// keep track of which should expand
- QValueVector<bool> expands(NCOLS, false);
- QValueVector<int> maxWidth(NCOLS, 0);
+ TQValueVector<bool> expands(NCOLS, false);
+ TQValueVector<int> maxWidth(NCOLS, 0);
Data::FieldVec::Iterator it = fields.begin(); // needed later
for(int count = 0; it != fields.end(); ++it) {
@@ -194,7 +194,7 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) {
if(!widget) {
continue;
}
- connect(widget, SIGNAL(modified()), SLOT(slotSetModified()));
+ connect(widget, TQT_SIGNAL(modified()), TQT_SLOT(slotSetModified()));
if(!focusedFirst && widget->isFocusEnabled()) {
widget->setFocus();
focusedFirst = true;
@@ -202,18 +202,18 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) {
int r = count/NCOLS;
int c = count%NCOLS;
- layout->addWidget(widget, r, c);
- layout->setRowStretch(r, 1);
+ tqlayout->addWidget(widget, r, c);
+ tqlayout->setRowStretch(r, 1);
- m_widgetDict.insert(QString::number(m_currColl->id()) + field->name(), widget);
+ m_widgetDict.insert(TQString::number(m_currColl->id()) + field->name(), widget);
- maxWidth[count%NCOLS] = QMAX(maxWidth[count%NCOLS], widget->labelWidth());
+ maxWidth[count%NCOLS] = TQMAX(maxWidth[count%NCOLS], widget->labelWidth());
if(widget->expands()) {
expands[count%NCOLS] = true;
}
widget->updateGeometry();
if(!field->isSingleCategory()) {
- maxHeight = QMAX(maxHeight, widget->minimumSizeHint().height());
+ maxHeight = TQMAX(maxHeight, widget->tqminimumSizeHint().height());
}
++count;
}
@@ -221,7 +221,7 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) {
// now, the labels in a column should all be the same width
it = fields.begin();
for(int count = 0; it != fields.end(); ++it) {
- GUI::FieldWidget* widget = m_widgetDict.find(QString::number(m_currColl->id()) + it->name());
+ GUI::FieldWidget* widget = m_widgetDict.tqfind(TQString::number(m_currColl->id()) + it->name());
if(widget) {
widget->setLabelWidth(maxWidth[count%NCOLS]);
++count;
@@ -231,7 +231,7 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) {
// update stretch factors for columns with a line edit
for(int col = 0; col < NCOLS; ++col) {
if(expands[col]) {
- layout->setColStretch(col, 1);
+ tqlayout->setColStretch(col, 1);
}
}
@@ -239,28 +239,28 @@ void EntryEditDialog::setLayout(Data::CollPtr coll_) {
}
// Now, go through and set all the field widgets to the same height
- for(QPtrListIterator<QWidget> it(gridList); it.current(); ++it) {
- QGridLayout* l = static_cast<QGridLayout*>(it.current()->layout());
+ for(TQPtrListIterator<TQWidget> it(gridList); it.current(); ++it) {
+ TQGridLayout* l = static_cast<TQGridLayout*>(it.current()->tqlayout());
if(noChoices) {
l->setSpacing(5);
}
- for(int row = 0; row < l->numRows() && it.current()->children()->count() > 1; ++row) {
+ for(int row = 0; row < l->numRows() && it.current()->childrenListObject().count() > 1; ++row) {
l->addRowSpacing(row, maxHeight);
}
// I don't want anything to be hidden, Keramik has a bug if I don't do this
- it.current()->setMinimumHeight(it.current()->sizeHint().height());
- // the parent of the grid is the page that got added to the tabs
- it.current()->parentWidget()->layout()->invalidate();
- it.current()->parentWidget()->setMinimumHeight(it.current()->parentWidget()->sizeHint().height());
+ it.current()->setMinimumHeight(it.current()->tqsizeHint().height());
+ // the tqparent of the grid is the page that got added to the tabs
+ it.current()->tqparentWidget()->tqlayout()->tqinvalidate();
+ it.current()->tqparentWidget()->setMinimumHeight(it.current()->tqparentWidget()->tqsizeHint().height());
}
setUpdatesEnabled(true);
// this doesn't seem to work
-// setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
+// tqsetSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum);
// so do this instead
- layout()->invalidate(); // needed so the sizeHint() gets recalculated
- m_tabs->setMinimumHeight(m_tabs->minimumSizeHint().height());
- m_tabs->setMinimumWidth(m_tabs->sizeHint().width());
+ tqlayout()->tqinvalidate(); // needed so the tqsizeHint() gets recalculated
+ m_tabs->setMinimumHeight(m_tabs->tqminimumSizeHint().height());
+ m_tabs->setMinimumWidth(m_tabs->tqsizeHint().width());
// update keyboard accels
// only want to manage tabBar()
@@ -308,12 +308,12 @@ void EntryEditDialog::slotHandleSave() {
// add a message box if multiple items are selected
if(m_currEntries.count() > 1) {
- QStringList names;
+ TQStringList names;
for(Data::EntryVec::ConstIterator entry = m_currEntries.constBegin(); entry != m_currEntries.constEnd(); ++entry) {
names += entry->title();
}
- QString str(i18n("Do you really want to modify these entries?"));
- QString dontAsk = QString::fromLatin1("SaveMultipleBooks"); // don't change 'books', invisible anyway
+ TQString str(i18n("Do you really want to modify these entries?"));
+ TQString dontAsk = TQString::tqfromLatin1("SaveMultipleBooks"); // don't change 'books', invisible anyway
int ret = KMessageBox::questionYesNoList(this, str, names, i18n("Modify Multiple Entries"),
KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk);
if(ret != KMessageBox::Yes) {
@@ -335,17 +335,17 @@ void EntryEditDialog::slotHandleSave() {
oldEntries.append(new Data::Entry(*entry));
}
for(Data::FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) {
- QString key = QString::number(m_currColl->id()) + fIt->name();
- GUI::FieldWidget* widget = m_widgetDict.find(key);
+ TQString key = TQString::number(m_currColl->id()) + fIt->name();
+ GUI::FieldWidget* widget = m_widgetDict.tqfind(key);
if(widget && widget->isEnabled()) {
- QString temp = widget->text();
+ TQString temp = widget->text();
// ok to set field empty string, just not all of them
if(modified == false && entry->field(fIt) != temp) {
modified = true;
}
entry->setField(fIt, temp);
if(temp.isEmpty()) {
- QString prop = fIt->property(QString::fromLatin1("required")).lower();
+ TQString prop = fIt->property(TQString::tqfromLatin1("required")).lower();
if(prop == Latin1Literal("1") || prop == Latin1Literal("true")) {
fieldsRequiringValues.append(fIt.data());
}
@@ -355,13 +355,13 @@ void EntryEditDialog::slotHandleSave() {
}
if(!fieldsRequiringValues.isEmpty()) {
- GUI::CursorSaver cs2(Qt::arrowCursor);
- QString str = i18n("A value is required for the following fields. Do you want to continue?");
- QStringList titles;
+ GUI::CursorSaver cs2(TQt::arrowCursor);
+ TQString str = i18n("A value is required for the following fields. Do you want to continue?");
+ TQStringList titles;
for(Data::FieldVecIt it = fieldsRequiringValues.begin(); it != fieldsRequiringValues.end(); ++it) {
titles << it->title();
}
- QString dontAsk = QString::fromLatin1("SaveWithoutRequired");
+ TQString dontAsk = TQString::tqfromLatin1("SaveWithoutRequired");
int ret = KMessageBox::questionYesNoList(this, str, titles, i18n("Modify Entries"),
KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk);
if(ret != KMessageBox::Yes) {
@@ -379,7 +379,7 @@ void EntryEditDialog::slotHandleSave() {
Kernel::self()->modifyEntries(oldEntries, m_currEntries);
}
if(!m_currEntries.isEmpty() && !m_currEntries[0]->title().isEmpty()) {
- setCaption(i18n("Edit Entry") + QString::fromLatin1(" - ") + m_currEntries[0]->title());
+ setCaption(i18n("Edit Entry") + TQString::tqfromLatin1(" - ") + m_currEntries[0]->title());
}
}
@@ -397,7 +397,7 @@ void EntryEditDialog::clear() {
m_isWorking = true;
// clear the widgets
- for(QDictIterator<GUI::FieldWidget> it(m_widgetDict); it.current(); ++it) {
+ for(TQDictIterator<GUI::FieldWidget> it(m_widgetDict); it.current(); ++it) {
it.current()->setEnabled(true);
it.current()->clear();
it.current()->insertDefault();
@@ -462,14 +462,14 @@ void EntryEditDialog::setContents(Data::EntryVec entries_) {
Data::EntryVec::ConstIterator entry;
Data::FieldVec fields = m_currColl->fields();
for(Data::FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) {
- QString key = QString::number(m_currColl->id()) + fIt->name();
- GUI::FieldWidget* widget = m_widgetDict.find(key);
+ TQString key = TQString::number(m_currColl->id()) + fIt->name();
+ GUI::FieldWidget* widget = m_widgetDict.tqfind(key);
if(!widget) { // probably read-only
continue;
}
widget->editMultiple(true);
- QString value = entries_[0]->field(fIt);
+ TQString value = entries_[0]->field(fIt);
entry = entries_.constBegin();
for(++entry; entry != entries_.constEnd(); ++entry) { // skip checking the first one
if(entry->field(fIt) != value) {
@@ -509,7 +509,7 @@ void EntryEditDialog::setContents(Data::EntryPtr entry_) {
m_currEntries.append(entry_);
if(!entry_->title().isEmpty()) {
- setCaption(i18n("Edit Entry") + QString::fromLatin1(" - ") + entry_->title());
+ setCaption(i18n("Edit Entry") + TQString::tqfromLatin1(" - ") + entry_->title());
}
if(m_currColl != entry_->collection()) {
@@ -523,8 +523,8 @@ void EntryEditDialog::setContents(Data::EntryPtr entry_) {
Data::FieldVec fields = m_currColl->fields();
for(Data::FieldVec::Iterator field = fields.begin(); field != fields.end(); ++field) {
- QString key = QString::number(m_currColl->id()) + field->name();
- GUI::FieldWidget* widget = m_widgetDict.find(key);
+ TQString key = TQString::number(m_currColl->id()) + field->name();
+ GUI::FieldWidget* widget = m_widgetDict.tqfind(key);
if(!widget) { // is probably read-only
continue;
}
@@ -551,36 +551,36 @@ void EntryEditDialog::removeField(Data::CollPtr, Data::FieldPtr field_) {
}
// myDebug() << "EntryEditDialog::removeField - name = " << field_->name() << endl;
- QString key = QString::number(m_currColl->id()) + field_->name();
- GUI::FieldWidget* widget = m_widgetDict.find(key);
+ TQString key = TQString::number(m_currColl->id()) + field_->name();
+ GUI::FieldWidget* widget = m_widgetDict.tqfind(key);
if(widget) {
m_widgetDict.remove(key);
// if this is the last field in the category, need to remove the tab page
// this function is called after the field has been removed from the collection,
// so the category should be gone from the category list
- if(m_currColl->fieldCategories().findIndex(field_->category()) == -1) {
+ if(m_currColl->fieldCategories().tqfindIndex(field_->category()) == -1) {
// myDebug() << "last field in the category" << endl;
- // fragile, widget's parent is the grid, whose parent is the tab page
- QWidget* w = widget->parentWidget()->parentWidget();
+ // fragile, widget's tqparent is the grid, whose tqparent is the tab page
+ TQWidget* w = widget->tqparentWidget()->tqparentWidget();
m_tabs->removePage(w);
delete w; // automatically deletes child widget
} else {
// much of this replicates code in setLayout()
- QGridLayout* layout = static_cast<QGridLayout*>(widget->parentWidget()->layout());
- delete widget; // automatically removes from layout
+ TQGridLayout* tqlayout = static_cast<TQGridLayout*>(widget->tqparentWidget()->tqlayout());
+ delete widget; // automatically removes from tqlayout
- QValueVector<bool> expands(NCOLS, false);
- QValueVector<int> maxWidth(NCOLS, 0);
+ TQValueVector<bool> expands(NCOLS, false);
+ TQValueVector<int> maxWidth(NCOLS, 0);
Data::FieldVec vec = m_currColl->fieldsByCategory(field_->category());
Data::FieldVec::Iterator it = vec.begin();
for(int count = 0; it != vec.end(); ++it) {
- GUI::FieldWidget* widget = m_widgetDict.find(QString::number(m_currColl->id()) + it->name());
+ GUI::FieldWidget* widget = m_widgetDict.tqfind(TQString::number(m_currColl->id()) + it->name());
if(widget) {
- layout->remove(widget);
- layout->addWidget(widget, count/NCOLS, count%NCOLS);
+ tqlayout->remove(widget);
+ tqlayout->addWidget(widget, count/NCOLS, count%NCOLS);
- maxWidth[count%NCOLS] = QMAX(maxWidth[count%NCOLS], widget->labelWidth());
+ maxWidth[count%NCOLS] = TQMAX(maxWidth[count%NCOLS], widget->labelWidth());
if(widget->expands()) {
expands[count%NCOLS] = true;
}
@@ -592,7 +592,7 @@ void EntryEditDialog::removeField(Data::CollPtr, Data::FieldPtr field_) {
// now, the labels in a column should all be the same width
it = vec.begin();
for(int count = 0; it != vec.end(); ++it) {
- GUI::FieldWidget* widget = m_widgetDict.find(QString::number(m_currColl->id()) + it->name());
+ GUI::FieldWidget* widget = m_widgetDict.tqfind(TQString::number(m_currColl->id()) + it->name());
if(widget) {
widget->setLabelWidth(maxWidth[count%NCOLS]);
++count;
@@ -602,7 +602,7 @@ void EntryEditDialog::removeField(Data::CollPtr, Data::FieldPtr field_) {
// update stretch factors for columns with a line edit
for(int col = 0; col < NCOLS; ++col) {
if(expands[col]) {
- layout->setColStretch(col, 1);
+ tqlayout->setColStretch(col, 1);
}
}
}
@@ -624,14 +624,14 @@ void EntryEditDialog::updateCompletions(Data::EntryPtr entry_) {
continue;
}
- QString key = QString::number(m_currColl->id()) + it->name();
- GUI::FieldWidget* widget = m_widgetDict.find(key);
+ TQString key = TQString::number(m_currColl->id()) + it->name();
+ GUI::FieldWidget* widget = m_widgetDict.tqfind(key);
if(!widget) {
continue;
}
if(it->flags() & Data::Field::AllowMultiple) {
- QStringList items = entry_->fields(it, false);
- for(QStringList::ConstIterator it = items.begin(); it != items.end(); ++it) {
+ TQStringList items = entry_->fields(it, false);
+ for(TQStringList::ConstIterator it = items.begin(); it != items.end(); ++it) {
widget->addCompletionObjectItem(*it);
}
} else {
@@ -653,7 +653,7 @@ bool EntryEditDialog::queryModified() {
m_modified = false;
}
if(m_modified) {
- QString str(i18n("The current entry has been modified.\n"
+ TQString str(i18n("The current entry has been modified.\n"
"Do you want to enter the changes?"));
KGuiItem item = KStdGuiItem::save();
item.setText(i18n("Save Entry"));
@@ -687,7 +687,7 @@ void EntryEditDialog::modifyField(Data::CollPtr coll_, Data::FieldPtr oldField_,
m_currColl = coll_;
}
- // if the field type changed, go ahead and redo the whole layout
+ // if the field type changed, go ahead and redo the whole tqlayout
// also if the category changed for a non-single field, since a new tab must be created
if(oldField_->type() != newField_->type()
|| (oldField_->category() != newField_->category() && !newField_->isSingleCategory())) {
@@ -698,28 +698,28 @@ void EntryEditDialog::modifyField(Data::CollPtr coll_, Data::FieldPtr oldField_,
return;
}
- QString key = QString::number(coll_->id()) + oldField_->name();
+ TQString key = TQString::number(coll_->id()) + oldField_->name();
GUI::FieldWidget* widget = m_widgetDict[key];
if(widget) {
widget->updateField(oldField_, newField_);
// need to update label widths
if(newField_->title() != oldField_->title()) {
int maxWidth = 0;
- QObjectList* childList = widget->parentWidget()->queryList("Tellico::GUI::FieldWidget", 0, false, false);
- QObjectListIt it(*childList);
+ TQObjectList* childList = widget->tqparentWidget()->queryList("Tellico::GUI::FieldWidget", 0, false, false);
+ TQObjectListIt it(*childList);
for(it.toFirst(); it.current(); ++it) {
- maxWidth = QMAX(maxWidth, static_cast<GUI::FieldWidget*>(it.current())->labelWidth());
+ maxWidth = TQMAX(maxWidth, static_cast<GUI::FieldWidget*>(TQT_TQWIDGET(it.current()))->labelWidth());
}
for(it.toFirst(); it.current(); ++it) {
- static_cast<GUI::FieldWidget*>(it.current())->setLabelWidth(maxWidth);
+ static_cast<GUI::FieldWidget*>(TQT_TQWIDGET(it.current()))->setLabelWidth(maxWidth);
}
delete childList;
}
// this is very fragile!
- // field widgets's parent is the grid, whose parent is the tab page
+ // field widgets's tqparent is the grid, whose tqparent is the tab page
// this is for singleCategory fields
if(newField_->category() != oldField_->category()) {
- m_tabs->setTabLabel(widget->parentWidget()->parentWidget(), newField_->category());
+ m_tabs->setTabLabel(widget->tqparentWidget()->tqparentWidget(), newField_->category());
}
}
}
@@ -734,7 +734,7 @@ void EntryEditDialog::modifyEntries(Data::EntryVec entries_) {
bool updateContents = false;
for(Data::EntryVecIt entry = entries_.begin(); entry != entries_.end(); ++entry) {
updateCompletions(entry);
- if(!updateContents && m_currEntries.contains(entry)) {
+ if(!updateContents && m_currEntries.tqcontains(entry)) {
updateContents = true;
}
}
diff --git a/src/entryeditdialog.h b/src/entryeditdialog.h
index 2d71b63..7dafffd 100644
--- a/src/entryeditdialog.h
+++ b/src/entryeditdialog.h
@@ -21,7 +21,7 @@ class KPushButton;
#include <kdialogbase.h>
-#include <qdict.h>
+#include <tqdict.h>
namespace Tellico {
namespace GUI {
@@ -33,12 +33,13 @@ namespace Tellico {
*/
class EntryEditDialog : public KDialogBase, public Observer {
Q_OBJECT
+ TQ_OBJECT
// needed for completion object support
friend class GUI::FieldWidget;
public:
- EntryEditDialog(QWidget* parent, const char* name);
+ EntryEditDialog(TQWidget* tqparent, const char* name);
/**
* Checks to see if any data needs to be saved. Returns @p true if it's ok to continue with
@@ -48,9 +49,9 @@ public:
*/
bool queryModified();
/**
- * Deletes and resets the layout of the tabs.
+ * Deletes and resets the tqlayout of the tabs.
*
- * @param coll A pointer to the collection whose fields should be used for setting up the layout
+ * @param coll A pointer to the collection whose fields should be used for setting up the tqlayout
*/
void setLayout(Data::CollPtr coll);
/**
@@ -74,7 +75,7 @@ public:
* Updates a widget when its field has been modified. The category may have changed, completions may have
* been added or removed, or what-have-you.
*
- * @param coll A pointer to the parent collection
+ * @param coll A pointer to the tqparent collection
* @param oldField A pointer to the old field, which should have the same name as the new one
* @param newField A pointer to the new field
*/
@@ -135,7 +136,7 @@ private:
Data::CollPtr m_currColl;
Data::EntryVec m_currEntries;
GUI::TabControl* m_tabs;
- QDict<GUI::FieldWidget> m_widgetDict;
+ TQDict<GUI::FieldWidget> m_widgetDict;
ButtonCode m_saveBtn, m_newBtn, m_nextBtn, m_prevBtn;
diff --git a/src/entrygroupitem.cpp b/src/entrygroupitem.cpp
index f2de60d..14b1573 100644
--- a/src/entrygroupitem.cpp
+++ b/src/entrygroupitem.cpp
@@ -22,30 +22,30 @@
#include <kiconloader.h>
#include <klocale.h>
-#include <qpixmap.h>
-#include <qpainter.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
using Tellico::EntryGroupItem;
-EntryGroupItem::EntryGroupItem(GUI::ListView* parent_, Data::EntryGroup* group_, int fieldType_)
- : GUI::CountedItem(parent_), m_group(group_), m_fieldType(fieldType_) {
+EntryGroupItem::EntryGroupItem(GUI::ListView* tqparent_, Data::EntryGroup* group_, int fieldType_)
+ : GUI::CountedItem(tqparent_), m_group(group_), m_fieldType(fieldType_) {
setText(0, group_->groupName());
m_emptyGroup = group_->groupName() == i18n(Data::Collection::s_emptyGroupTitle);
}
-QPixmap EntryGroupItem::ratingPixmap() {
+TQPixmap EntryGroupItem::ratingPixmap() {
if(!m_group) {
- return QPixmap();
+ return TQPixmap();
}
- QPixmap stars = GUI::RatingWidget::pixmap(m_group->groupName());
+ TQPixmap stars = GUI::RatingWidget::pixmap(m_group->groupName());
if(m_pix.isNull() && stars.isNull()) {
m_emptyGroup = true;
- return QPixmap();
+ return TQPixmap();
}
- QPixmap newPix(m_pix.width() + 4 + stars.width(), QMAX(m_pix.height(), stars.height()));
- newPix.fill(isSelected() ? listView()->colorGroup().highlight() : backgroundColor(0));
- QPainter p(&newPix);
+ TQPixmap newPix(m_pix.width() + 4 + stars.width(), TQMAX(m_pix.height(), stars.height()));
+ newPix.fill(isSelected() ? listView()->tqcolorGroup().highlight() : backgroundColor(0));
+ TQPainter p(&newPix);
if(!m_pix.isNull()) {
p.drawPixmap(0, 0, m_pix);
}
@@ -56,25 +56,25 @@ QPixmap EntryGroupItem::ratingPixmap() {
return newPix;
}
-void EntryGroupItem::setPixmap(int col, const QPixmap& pix) {
+void EntryGroupItem::setPixmap(int col, const TQPixmap& pix) {
m_pix = pix;
GUI::CountedItem::setPixmap(col, m_pix);
}
-void EntryGroupItem::paintCell(QPainter* p_, const QColorGroup& cg_,
+void EntryGroupItem::paintCell(TQPainter* p_, const TQColorGroup& cg_,
int column_, int width_, int align_) {
if(column_> 0 || m_fieldType != Data::Field::Rating || m_emptyGroup) {
return GUI::CountedItem::paintCell(p_, cg_, column_, width_, align_);
}
- QString oldText = text(column_);
+ TQString oldText = text(column_);
// "\t\t" is the flag to not paint the item
// CountedItem already uses "\t"
if(oldText == Latin1Literal("\t\t")) {
return;
}
- setText(column_, QString::fromLatin1("\t\t"));
+ setText(column_, TQString::tqfromLatin1("\t\t"));
GUI::CountedItem::setPixmap(column_, ratingPixmap());
GUI::CountedItem::paintCell(p_, cg_, column_, width_, align_);
// GUI::CountedItem::setPixmap(column_, m_pix);
@@ -83,7 +83,7 @@ void EntryGroupItem::paintCell(QPainter* p_, const QColorGroup& cg_,
// prepend a tab character to always sort the empty group name first
// also check for surname prefixes
-QString EntryGroupItem::key(int col_, bool) const {
+TQString EntryGroupItem::key(int col_, bool) const {
if(col_ > 0) {
return text(col_);
}
@@ -92,31 +92,31 @@ QString EntryGroupItem::key(int col_, bool) const {
&& pixmap(col_) && !pixmap(col_)->isNull()) {
// a little weird, sort for width, too, in case of rating widget
// but sort reverse by width
- return QChar('\t') + QString::number(1000-pixmap(col_)->width());
+ return TQChar('\t') + TQString::number(1000-pixmap(col_)->width());
} else if(text(col_) == i18n(Data::Collection::s_emptyGroupTitle)) {
- return QChar('\t');
+ return TQChar('\t');
}
if(m_text.isEmpty() || m_text != text(col_)) {
m_text = text(col_);
if(Config::autoFormat()) {
- const QStringList prefixes = Config::surnamePrefixList();
+ const TQStringList prefixes = Config::surnamePrefixList();
// build a regexp to match surname prefixes
// complicated by fact that prefix could have an apostrophe
- QString tokens;
- for(QStringList::ConstIterator it = prefixes.begin();
+ TQString tokens;
+ for(TQStringList::ConstIterator it = prefixes.begin();
it != prefixes.end();
++it) {
tokens += (*it);
- if(!(*it).endsWith(QChar('\''))) {
- tokens += QString::fromLatin1("\\s");
+ if(!(*it).endsWith(TQChar('\''))) {
+ tokens += TQString::tqfromLatin1("\\s");
}
// if it's not the last item, add a pipe
if((*it) != prefixes.last()) {
- tokens += QChar('|');
+ tokens += TQChar('|');
}
}
- QRegExp rx(QString::fromLatin1("^(") + tokens + QChar(')'), false);
+ TQRegExp rx(TQString::tqfromLatin1("^(") + tokens + TQChar(')'), false);
// expensive
if(rx.search(m_text) > -1) {
m_key = m_text.mid(rx.matchedLength());
diff --git a/src/entrygroupitem.h b/src/entrygroupitem.h
index 827ce8d..e665132 100644
--- a/src/entrygroupitem.h
+++ b/src/entrygroupitem.h
@@ -16,8 +16,8 @@
#include "gui/counteditem.h"
-#include <qpixmap.h>
-#include <qguardedptr.h>
+#include <tqpixmap.h>
+#include <tqguardedptr.h>
namespace Tellico {
namespace Data {
@@ -29,16 +29,16 @@ namespace Tellico {
*/
class EntryGroupItem : public GUI::CountedItem {
public:
- EntryGroupItem(GUI::ListView* parent, Data::EntryGroup* group, int fieldType);
+ EntryGroupItem(GUI::ListView* tqparent, Data::EntryGroup* group, int fieldType);
virtual bool isEntryGroupItem() const { return true; }
Data::EntryGroup* group() const { return m_group; }
void setGroup(Data::EntryGroup* group) { m_group = group; }
- QPixmap ratingPixmap();
+ TQPixmap ratingPixmap();
- virtual void setPixmap(int col, const QPixmap& pix);
- virtual void paintCell(QPainter* p, const QColorGroup& cg,
+ virtual void setPixmap(int col, const TQPixmap& pix);
+ virtual void paintCell(TQPainter* p, const TQColorGroup& cg,
int column, int width, int align);
/**
* Returns the key for sorting the listitems. The text used for an empty
@@ -49,21 +49,21 @@ public:
* @param col The column number
* @return The key
*/
- virtual QString key(int col, bool) const;
+ virtual TQString key(int col, bool) const;
virtual int count() const;
virtual Data::EntryVec entries() const;
private:
- QGuardedPtr<Data::EntryGroup> m_group;
+ TQGuardedPtr<Data::EntryGroup> m_group;
int m_fieldType;
- QPixmap m_pix;
+ TQPixmap m_pix;
bool m_emptyGroup : 1;
// since I do an expensive RegExp match for the surname prefixes, I want to
// cache the text and the resulting key
- mutable QString m_text;
- mutable QString m_key;
+ mutable TQString m_text;
+ mutable TQString m_key;
};
}
diff --git a/src/entryiconfactory.cpp b/src/entryiconfactory.cpp
index 0f4696d..776b324 100644
--- a/src/entryiconfactory.cpp
+++ b/src/entryiconfactory.cpp
@@ -17,27 +17,27 @@
#include <kiconloader.h>
#include <kimageeffect.h>
-#include <qimage.h>
+#include <tqimage.h>
using Tellico::EntryIconFactory;
-EntryIconFactory::EntryIconFactory(int size_) : QIconFactory(), m_size(size_) {
+EntryIconFactory::EntryIconFactory(int size_) : TQIconFactory(), m_size(size_) {
setAutoDelete(true);
}
-QPixmap* EntryIconFactory::createPixmap(const QIconSet&, QIconSet::Size, QIconSet::Mode, QIconSet::State) {
- QPixmap entryPix = UserIcon(Kernel::self()->collectionTypeName());
+TQPixmap* EntryIconFactory::createPixmap(const TQIconSet&, TQIconSet::Size, TQIconSet::Mode, TQIconSet::State) {
+ TQPixmap entryPix = UserIcon(Kernel::self()->collectionTypeName());
// if we're 22x22 or smaller, just use entry icon
if(m_size < 23) {
- QImage entryImg = entryPix.convertToImage();
- entryPix.convertFromImage(entryImg.smoothScale(m_size, m_size, QImage::ScaleMin), 0);
- return new QPixmap(entryPix);
+ TQImage entryImg = entryPix.convertToImage();
+ entryPix.convertFromImage(entryImg.smoothScale(m_size, m_size, TQ_ScaleMin), 0);
+ return new TQPixmap(entryPix);
}
- QPixmap newPix = BarIcon(QString::fromLatin1("mime_empty"), m_size);
- QImage newImg = newPix.convertToImage();
-// QImage blend; Not exactly sure what the coordinates mean, but this seems to work ok.
+ TQPixmap newPix = BarIcon(TQString::tqfromLatin1("mime_empty"), m_size);
+ TQImage newImg = newPix.convertToImage();
+// TQImage blend; Not exactly sure what the coordinates mean, but this seems to work ok.
KImageEffect::blendOnLower(m_size/4, m_size/4, entryPix.convertToImage(), newImg);
newPix.convertFromImage(newImg, 0);
- return new QPixmap(newPix);
+ return new TQPixmap(newPix);
}
diff --git a/src/entryiconfactory.h b/src/entryiconfactory.h
index d5461a3..4f61916 100644
--- a/src/entryiconfactory.h
+++ b/src/entryiconfactory.h
@@ -14,18 +14,18 @@
#ifndef TELLICO_ENTRYICONFACTORY_H
#define TELLICO_ENTRYICONFACTORY_H
-#include <qiconset.h>
+#include <tqiconset.h>
namespace Tellico {
/**
* @author Robby Stephenson
*/
-class EntryIconFactory : public QIconFactory {
+class EntryIconFactory : public TQIconFactory {
public:
EntryIconFactory(int size);
- virtual QPixmap* createPixmap(const QIconSet&, QIconSet::Size, QIconSet::Mode, QIconSet::State);
+ virtual TQPixmap* createPixmap(const TQIconSet&, TQIconSet::Size, TQIconSet::Mode, TQIconSet::State);
private:
int m_size;
diff --git a/src/entryiconview.cpp b/src/entryiconview.cpp
index 2acd870..08fcc19 100644
--- a/src/entryiconview.cpp
+++ b/src/entryiconview.cpp
@@ -29,7 +29,7 @@
#include <kimageeffect.h>
#include <klocale.h>
-#include <qpainter.h>
+#include <tqpainter.h>
namespace {
static const int MIN_ENTRY_ICON_SIZE = 32;
@@ -42,25 +42,25 @@ namespace {
using Tellico::EntryIconView;
using Tellico::EntryIconViewItem;
-EntryIconView::EntryIconView(QWidget* parent_, const char* name_/*=0*/)
- : KIconView(parent_, name_), m_coll(0), m_maxAllowedIconWidth(MAX_ENTRY_ICON_SIZE),
+EntryIconView::EntryIconView(TQWidget* tqparent_, const char* name_/*=0*/)
+ : KIconView(tqparent_, name_), m_coll(0), m_maxAllowedIconWidth(MAX_ENTRY_ICON_SIZE),
m_maxIconWidth(MIN_ENTRY_ICON_SIZE), m_maxIconHeight(MIN_ENTRY_ICON_SIZE),
m_comparison(0) {
setAutoArrange(true);
setSorting(true);
setItemsMovable(false);
- setSelectionMode(QIconView::Extended);
- setResizeMode(QIconView::Adjust);
+ setSelectionMode(TQIconView::Extended);
+ setResizeMode(TQIconView::Adjust);
setMode(KIconView::Select);
setSpacing(4);
// setWordWrapIconText(false);
m_defaultPixmaps.setAutoDelete(true);
- connect(this, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()));
- connect(this, SIGNAL(doubleClicked(QIconViewItem*)), SLOT(slotDoubleClicked(QIconViewItem*)));
- connect(this, SIGNAL(contextMenuRequested(QIconViewItem*, const QPoint&)),
- SLOT(slotShowContextMenu(QIconViewItem*, const QPoint&)));
+ connect(this, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelectionChanged()));
+ connect(this, TQT_SIGNAL(doubleClicked(TQIconViewItem*)), TQT_SLOT(slotDoubleClicked(TQIconViewItem*)));
+ connect(this, TQT_SIGNAL(contextMenuRequested(TQIconViewItem*, const TQPoint&)),
+ TQT_SLOT(slotShowContextMenu(TQIconViewItem*, const TQPoint&)));
}
EntryIconView::~EntryIconView() {
@@ -84,36 +84,36 @@ void EntryIconView::findImageField() {
// myDebug() << "EntryIconView::findImageField() - image field = " << m_imageField << endl;
}
-const QString& EntryIconView::imageField() {
+const TQString& EntryIconView::imageField() {
return m_imageField;
}
-const QString& EntryIconView::sortField() {
- return m_comparison ? m_comparison->fieldName() : QString::null;
+const TQString& EntryIconView::sortField() {
+ return m_comparison ? m_comparison->fieldName() : TQString();
}
-const QPixmap& EntryIconView::defaultPixmap() {
- QPixmap* pix = m_defaultPixmaps[m_coll->type()];
+const TQPixmap& EntryIconView::defaultPixmap() {
+ TQPixmap* pix = m_defaultPixmaps[m_coll->type()];
if(pix) {
return *pix;
}
KIconLoader* loader = KGlobal::instance()->iconLoader();
- QPixmap tmp = loader->loadIcon(QString::fromLatin1("nocover_") + CollectionFactory::typeName(m_coll->type()),
+ TQPixmap tmp = loader->loadIcon(TQString::tqfromLatin1("nocover_") + CollectionFactory::typeName(m_coll->type()),
KIcon::User, 0, KIcon::DefaultState, 0, true /*canReturnNull */);
if(tmp.isNull()) {
myLog() << "EntryIconView::defaultPixmap() - null nocover image, loading tellico.png" << endl;
- tmp = UserIcon(QString::fromLatin1("tellico"));
+ tmp = UserIcon(TQString::tqfromLatin1("tellico"));
}
- if(QMAX(tmp.width(), tmp.height()) > static_cast<int>(MIN_ENTRY_ICON_SIZE)) {
- tmp.convertFromImage(tmp.convertToImage().smoothScale(m_maxIconWidth, m_maxIconHeight, QImage::ScaleMin));
+ if(TQMAX(tmp.width(), tmp.height()) > static_cast<int>(MIN_ENTRY_ICON_SIZE)) {
+ tmp.convertFromImage(tmp.convertToImage().smoothScale(m_maxIconWidth, m_maxIconHeight, TQ_ScaleMin));
}
- pix = new QPixmap(tmp);
+ pix = new TQPixmap(tmp);
m_defaultPixmaps.insert(m_coll->type(), pix);
return *pix;
}
void EntryIconView::setMaxAllowedIconWidth(int width_) {
- m_maxAllowedIconWidth = QMAX(MIN_ENTRY_ICON_SIZE, QMIN(MAX_ENTRY_ICON_SIZE, width_));
+ m_maxAllowedIconWidth = TQMAX(MIN_ENTRY_ICON_SIZE, TQMIN(MAX_ENTRY_ICON_SIZE, width_));
setMaxItemWidth(m_maxAllowedIconWidth + 2*ENTRY_ICON_SIZE_PAD);
m_defaultPixmaps.clear();
refresh();
@@ -123,16 +123,16 @@ void EntryIconView::fillView() {
setSorting(false);
setGridX(m_maxAllowedIconWidth + 2*ENTRY_ICON_SIZE_PAD); // set default spacing initially
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
bool allDefaultImages = true;
- m_maxIconWidth = QMAX(MIN_ENTRY_ICON_SIZE, m_maxIconWidth);
- m_maxIconHeight = QMAX(MIN_ENTRY_ICON_SIZE, m_maxIconHeight);
+ m_maxIconWidth = TQMAX(MIN_ENTRY_ICON_SIZE, m_maxIconWidth);
+ m_maxIconHeight = TQMAX(MIN_ENTRY_ICON_SIZE, m_maxIconHeight);
EntryIconViewItem* item;
for(Data::EntryVecIt it = m_entries.begin(); it != m_entries.end(); ++it) {
item = new EntryIconViewItem(this, it);
- m_maxIconWidth = QMAX(m_maxIconWidth, item->width());
- m_maxIconHeight = QMAX(m_maxIconHeight, item->pixmapRect().height());
+ m_maxIconWidth = TQMAX(m_maxIconWidth, item->width());
+ m_maxIconHeight = TQMAX(m_maxIconHeight, item->pixmapRect().height());
if(item->usesImage()) {
allDefaultImages = false;
}
@@ -199,8 +199,8 @@ void EntryIconView::addEntries(Data::EntryVec entries_) {
for(Data::EntryVecIt entry = entries_.begin(); entry != entries_.end(); ++entry) {
m_entries.append(entry);
EntryIconViewItem* item = new EntryIconViewItem(this, entry);
- w = QMAX(w, item->width());
- h = QMAX(h, item->pixmapRect().height());
+ w = TQMAX(w, item->width());
+ h = TQMAX(h, item->pixmapRect().height());
}
if(w > m_maxIconWidth || h > m_maxIconHeight) {
refresh();
@@ -230,7 +230,7 @@ void EntryIconView::removeEntries(Data::EntryVec entries_) {
bool found = false;
EntryIconViewItem* item = firstItem();
while(item) {
- if(entries_.contains(item->entry())) {
+ if(entries_.tqcontains(item->entry())) {
EntryIconViewItem* prev = item;
item = item->nextItem();
delete prev;
@@ -246,14 +246,14 @@ void EntryIconView::removeEntries(Data::EntryVec entries_) {
void EntryIconView::slotSelectionChanged() {
Data::EntryVec entries;
- const QPtrList<EntryIconViewItem>& items = selectedItems();
- for(QPtrListIterator<EntryIconViewItem> it(items); it.current(); ++it) {
+ const TQPtrList<EntryIconViewItem>& items = selectedItems();
+ for(TQPtrListIterator<EntryIconViewItem> it(items); it.current(); ++it) {
entries.append(it.current()->entry());
}
Controller::self()->slotUpdateSelection(this, entries);
}
-void EntryIconView::slotDoubleClicked(QIconViewItem* item_) {
+void EntryIconView::slotDoubleClicked(TQIconViewItem* item_) {
EntryIconViewItem* i = static_cast<EntryIconViewItem*>(item_);
if(i) {
Controller::self()->editEntry(i->entry());
@@ -268,7 +268,7 @@ void EntryIconView::updateSelected(EntryIconViewItem* item_, bool s_) const {
}
}
-void EntryIconView::slotShowContextMenu(QIconViewItem* item_, const QPoint& point_) {
+void EntryIconView::slotShowContextMenu(TQIconViewItem* item_, const TQPoint& point_) {
KPopupMenu menu(this);
// only insert entry items if one is selected
@@ -278,20 +278,20 @@ void EntryIconView::slotShowContextMenu(QIconViewItem* item_, const QPoint& poin
}
KPopupMenu sortMenu(&menu);
- const QStringList titles = m_coll->fieldTitles();
- for(QStringList::ConstIterator it = titles.begin(); it != titles.end(); ++it) {
+ const TQStringList titles = m_coll->fieldTitles();
+ for(TQStringList::ConstIterator it = titles.begin(); it != titles.end(); ++it) {
sortMenu.insertItem(*it);
}
- connect(&sortMenu, SIGNAL(activated(int)), SLOT(slotSortMenuActivated(int)));
+ connect(&sortMenu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSortMenuActivated(int)));
menu.insertItem(i18n("&Sort By"), &sortMenu);
menu.exec(point_);
}
void EntryIconView::slotSortMenuActivated(int id_) {
- const KPopupMenu* menu = ::qt_cast<KPopupMenu*>(sender());
+ const KPopupMenu* menu = ::tqqt_cast<KPopupMenu*>(sender());
if(menu) {
- QString title = menu->text(id_);
+ TQString title = menu->text(id_);
Data::FieldPtr f = m_coll->fieldByTitle(title);
if(f) {
delete m_comparison;
@@ -310,14 +310,14 @@ int EntryIconView::compare(const EntryIconViewItem* item1, EntryIconViewItem* it
/* *********************************************************** */
-EntryIconViewItem::EntryIconViewItem(EntryIconView* parent_, Data::EntryPtr entry_)
- : KIconViewItem(parent_, entry_->title()), m_entry(entry_), m_usesImage(false) {
+EntryIconViewItem::EntryIconViewItem(EntryIconView* tqparent_, Data::EntryPtr entry_)
+ : KIconViewItem(tqparent_, entry_->title()), m_entry(entry_), m_usesImage(false) {
setDragEnabled(false);
- const QString& imageField = parent_->imageField();
+ const TQString& imageField = tqparent_->imageField();
if(!imageField.isEmpty()) {
- QPixmap p = ImageFactory::pixmap(m_entry->field(imageField),
- parent_->maxAllowedIconWidth(),
- parent_->maxAllowedIconWidth());
+ TQPixmap p = ImageFactory::pixmap(m_entry->field(imageField),
+ tqparent_->maxAllowedIconWidth(),
+ tqparent_->maxAllowedIconWidth());
if(!p.isNull()) {
setPixmap(p);
m_usesImage = true;
@@ -350,12 +350,12 @@ void EntryIconViewItem::setSelected(bool s_, bool cb_) {
void EntryIconViewItem::updatePixmap() {
EntryIconView* view = iconView();
- const QString& imageField = view->imageField();
+ const TQString& imageField = view->imageField();
m_usesImage = false;
if(imageField.isEmpty()) {
setPixmap(view->defaultPixmap());
} else {
- QPixmap p = ImageFactory::pixmap(m_entry->field(imageField),
+ TQPixmap p = ImageFactory::pixmap(m_entry->field(imageField),
view->maxAllowedIconWidth(),
view->maxAllowedIconWidth());
if(p.isNull()) {
@@ -374,69 +374,69 @@ void EntryIconViewItem::update() {
iconView()->arrangeItemsInGrid();
}
-void EntryIconViewItem::calcRect(const QString& text_) {
+void EntryIconViewItem::calcRect(const TQString& text_) {
KIconViewItem::calcRect(text_);
- QRect r = pixmapRect();
+ TQRect r = pixmapRect();
r.rRight() += ENTRY_ICON_SHADOW_RIGHT;
r.rBottom() += ENTRY_ICON_SHADOW_BOTTOM;
setPixmapRect(r);
}
-void EntryIconViewItem::paintItem(QPainter* p_, const QColorGroup &cg_) {
+void EntryIconViewItem::paintItem(TQPainter* p_, const TQColorGroup &cg_) {
p_->save();
paintPixmap(p_, cg_);
paintText(p_, cg_);
p_->restore();
}
-void EntryIconViewItem::paintFocus(QPainter*, const QColorGroup&) {
+void EntryIconViewItem::paintFocus(TQPainter*, const TQColorGroup&) {
// don't draw anything
}
-void EntryIconViewItem::paintPixmap(QPainter* p_, const QColorGroup& cg_) {
+void EntryIconViewItem::paintPixmap(TQPainter* p_, const TQColorGroup& cg_) {
// only draw the shadow if there's an image
// oh, and don't draw it if it's a file catalog, it doesn't look right
if(m_usesImage && !isSelected() && m_entry->collection()->type() != Data::Collection::File) {
// pixmapRect() already includes shadow size, so shift the rect by that amount
- QRect r = pixmapRect(false);
+ TQRect r = pixmapRect(false);
r.setLeft(r.left() + ENTRY_ICON_SHADOW_RIGHT);
r.setTop(r.top() + ENTRY_ICON_SHADOW_BOTTOM);
- QColor c = Tellico::blendColors(iconView()->backgroundColor(), Qt::black, 10);
+ TQColor c = Tellico::blendColors(iconView()->backgroundColor(), TQt::black, 10);
p_->fillRect(r, c);
}
KIconViewItem::paintPixmap(p_, cg_);
}
-void EntryIconViewItem::paintText(QPainter* p_, const QColorGroup &cg_) {
- QRect tr = textRect(false);
+void EntryIconViewItem::paintText(TQPainter* p_, const TQColorGroup &cg_) {
+ TQRect tr = textRect(false);
int textX = tr.x() + 2;
int textY = tr.y();
if(isSelected()) {
- p_->setBrush(QBrush(cg_.highlight()));
- p_->setPen(QPen(cg_.highlight()));
+ p_->setBrush(TQBrush(cg_.highlight()));
+ p_->setPen(TQPen(cg_.highlight()));
p_->drawRoundRect(tr, 1000/tr.width(), 1000/tr.height());
- p_->setPen(QPen(cg_.highlightedText()));
+ p_->setPen(TQPen(cg_.highlightedText()));
} else {
- if(iconView()->itemTextBackground() != NoBrush) {
+ if(iconView()->itemTextBackground() != Qt::NoBrush) {
p_->fillRect(tr, iconView()->itemTextBackground());
}
p_->setPen(cg_.text());
}
- int align = iconView()->itemTextPos() == QIconView::Bottom ? AlignHCenter : AlignAuto;
+ int align = iconView()->itemTextPos() == TQIconView::Bottom ? AlignHCenter : AlignAuto;
wordWrap()->drawText(p_, textX, textY, align | KWordWrap::Truncate);
}
-QString EntryIconViewItem::key() const {
- const QString& sortField = iconView()->sortField();
+TQString EntryIconViewItem::key() const {
+ const TQString& sortField = iconView()->sortField();
if(sortField.isEmpty()) {
return KIconViewItem::key();
}
return m_entry->field(sortField);
}
-int EntryIconViewItem::compare(QIconViewItem* item_) const {
+int EntryIconViewItem::compare(TQIconViewItem* item_) const {
int res = iconView()->compare(this, static_cast<EntryIconViewItem*>(item_));
return res == 0 ? KIconViewItem::compare(item_) : res;
}
diff --git a/src/entryiconview.h b/src/entryiconview.h
index 335818c..f7ac00b 100644
--- a/src/entryiconview.h
+++ b/src/entryiconview.h
@@ -19,7 +19,7 @@
#include <kiconview.h>
-#include <qintdict.h>
+#include <tqintdict.h>
namespace Tellico {
class EntryIconViewItem;
@@ -33,11 +33,12 @@ namespace Tellico {
*/
class EntryIconView : public KIconView, public Observer {
Q_OBJECT
+ TQ_OBJECT
friend class EntryIconViewItem;
public:
- EntryIconView(QWidget* parent, const char* name = 0);
+ EntryIconView(TQWidget* tqparent, const char* name = 0);
~EntryIconView();
EntryIconViewItem* firstItem() const;
@@ -54,25 +55,25 @@ public:
virtual void modifyEntries(Data::EntryVec entries);
virtual void removeEntries(Data::EntryVec entries);
- const QString& imageField();
- const QString& sortField();
+ const TQString& imageField();
+ const TQString& sortField();
void setMaxAllowedIconWidth(int width);
int maxAllowedIconWidth() const { return m_maxAllowedIconWidth; }
- const QPixmap& defaultPixmap();
+ const TQPixmap& defaultPixmap();
/**
* Returns a list of the currently selected items;
*
* @return The list of selected items
*/
- const QPtrList<EntryIconViewItem>& selectedItems() const { return m_selectedItems; }
+ const TQPtrList<EntryIconViewItem>& selectedItems() const { return m_selectedItems; }
int compare(const EntryIconViewItem* item1, EntryIconViewItem* item2);
private slots:
void slotSelectionChanged();
- void slotDoubleClicked(QIconViewItem* item);
- void slotShowContextMenu(QIconViewItem* item, const QPoint& point);
+ void slotDoubleClicked(TQIconViewItem* item);
+ void slotShowContextMenu(TQIconViewItem* item, const TQPoint& point);
void slotSortMenuActivated(int id);
private:
@@ -83,15 +84,15 @@ private:
* @param s Selected or not
*/
void updateSelected(EntryIconViewItem* item, bool s) const;
- mutable QPtrList<EntryIconViewItem> m_selectedItems;
+ mutable TQPtrList<EntryIconViewItem> m_selectedItems;
void findImageField();
void fillView();
Data::CollPtr m_coll;
Data::EntryVec m_entries;
- QString m_imageField;
- QIntDict<QPixmap> m_defaultPixmaps;
+ TQString m_imageField;
+ TQIntDict<TQPixmap> m_defaultPixmaps;
int m_maxAllowedIconWidth;
int m_maxIconWidth;
int m_maxIconHeight;
@@ -100,7 +101,7 @@ private:
class EntryIconViewItem : public KIconViewItem {
public:
- EntryIconViewItem(EntryIconView* parent, Data::EntryPtr entry);
+ EntryIconViewItem(EntryIconView* tqparent, Data::EntryPtr entry);
~EntryIconViewItem();
EntryIconView* iconView() const { return static_cast<EntryIconView*>(KIconViewItem::iconView()); }
@@ -109,8 +110,8 @@ public:
Data::EntryPtr entry() const { return m_entry; }
virtual void setSelected(bool s, bool cb);
virtual void setSelected(bool s);
- virtual QString key() const;
- virtual int compare(QIconViewItem* item_) const;
+ virtual TQString key() const;
+ virtual int compare(TQIconViewItem* item_) const;
bool usesImage() const { return m_usesImage; }
void updatePixmap();
@@ -118,11 +119,11 @@ public:
void update();
protected:
- virtual void calcRect(const QString& text = QString::null);
- virtual void paintItem(QPainter* p, const QColorGroup& cg);
- virtual void paintFocus(QPainter* p, const QColorGroup& cg);
- void paintPixmap(QPainter* p, const QColorGroup& cg);
- void paintText(QPainter* p, const QColorGroup& cg);
+ virtual void calcRect(const TQString& text = TQString());
+ virtual void paintItem(TQPainter* p, const TQColorGroup& cg);
+ virtual void paintFocus(TQPainter* p, const TQColorGroup& cg);
+ void paintPixmap(TQPainter* p, const TQColorGroup& cg);
+ void paintText(TQPainter* p, const TQColorGroup& cg);
private:
Data::EntryPtr m_entry;
diff --git a/src/entryitem.cpp b/src/entryitem.cpp
index 0079d44..b2f4f14 100644
--- a/src/entryitem.cpp
+++ b/src/entryitem.cpp
@@ -21,12 +21,12 @@
using Tellico::EntryItem;
-EntryItem::EntryItem(GUI::ListView* parent, Data::EntryPtr entry)
- : GUI::ListViewItem(parent), m_entry(entry), m_isDetailedList(true) {
+EntryItem::EntryItem(GUI::ListView* tqparent, Data::EntryPtr entry)
+ : GUI::ListViewItem(tqparent), m_entry(entry), m_isDetailedList(true) {
}
-EntryItem::EntryItem(GUI::CountedItem* parent_, Data::EntryPtr entry_)
- : GUI::ListViewItem(parent_), m_entry(entry_), m_isDetailedList(false) {
+EntryItem::EntryItem(GUI::CountedItem* tqparent_, Data::EntryPtr entry_)
+ : GUI::ListViewItem(tqparent_), m_entry(entry_), m_isDetailedList(false) {
setText(0, m_entry->title());
setPixmap(0, UserIcon(entry_->collection()->typeName()));
}
@@ -35,15 +35,15 @@ Tellico::Data::EntryPtr const EntryItem::entry() const {
return m_entry;
}
-QString EntryItem::key(int col_, bool) const {
+TQString EntryItem::key(int col_, bool) const {
// first column is always title unless it's a detailed list
// detailed list takes care of things on its own
bool checkArticles = (!m_isDetailedList && col_ == 0);
// there's some sort of painting bug if the key is identical for multiple entries
// probably a null string in the group view. TODO
// don't add the entry id if it's a detailed view cause that messes up secondary sorting
- QString key = (checkArticles ? Data::Field::sortKeyTitle(text(col_)) : text(col_));
- return (m_isDetailedList ? key : key + QString::number(m_entry->id()));
+ TQString key = (checkArticles ? Data::Field::sortKeyTitle(text(col_)) : text(col_));
+ return (m_isDetailedList ? key : key + TQString::number(m_entry->id()));
}
void EntryItem::doubleClicked() {
diff --git a/src/entryitem.h b/src/entryitem.h
index 4e529c8..d0063c9 100644
--- a/src/entryitem.h
+++ b/src/entryitem.h
@@ -34,22 +34,22 @@ namespace Tellico {
class EntryItem : public GUI::ListViewItem {
public:
/**
- * This constructor is for items which are direct children of a ListView object,
+ * This constructor is for items which are direct tqchildren of a ListView object,
* which is just the @ref DetailedListView.
*
- * @param parent A pointer to the parent
+ * @param tqparent A pointer to the tqparent
* @param entry A pointer to the entry to which the item refers
*/
- EntryItem(GUI::ListView* parent, Data::EntryPtr entry);
+ EntryItem(GUI::ListView* tqparent, Data::EntryPtr entry);
/**
- * This constructor is for items which have other KListViewItems as parents. It
+ * This constructor is for items which have other KListViewItems as tqparents. It
* initializes the text in the first column, as well.
*
- * @param parent A pointer to the parent
+ * @param tqparent A pointer to the tqparent
* @param text The text in the first column
* @param entry A pointer to the entry to which the item refers
*/
- EntryItem(GUI::CountedItem* parent, Data::EntryPtr entry);
+ EntryItem(GUI::CountedItem* tqparent, Data::EntryPtr entry);
virtual bool isEntryItem() const { return true; }
@@ -60,7 +60,7 @@ public:
* @param col Column to compare
* @return The key string
*/
- virtual QString key(int col, bool) const;
+ virtual TQString key(int col, bool) const;
/**
* Returns a const pointer to the entry to which the item refers
*
@@ -73,7 +73,7 @@ public:
private:
Data::EntryPtr m_entry;
- // if the parent is a DetailedListView
+ // if the tqparent is a DetailedListView
// this way, I don't have to call listView()->isA("Tellico::DetailedListView") every time
// when I want to do funky comparisons
bool m_isDetailedList : 1;
diff --git a/src/entrymerger.cpp b/src/entrymerger.cpp
index 4767026..61ed0f8 100644
--- a/src/entrymerger.cpp
+++ b/src/entrymerger.cpp
@@ -22,34 +22,34 @@
#include <klocale.h>
-#include <qtimer.h>
+#include <tqtimer.h>
using Tellico::EntryMerger;
-EntryMerger::EntryMerger(Data::EntryVec entries_, QObject* parent_)
- : QObject(parent_), m_entriesToCheck(entries_), m_origCount(entries_.count()), m_cancelled(false) {
+EntryMerger::EntryMerger(Data::EntryVec entries_, TQObject* tqparent_)
+ : TQObject(tqparent_), m_entriesToCheck(entries_), m_origCount(entries_.count()), m_cancelled(false) {
m_entriesLeft = m_entriesToCheck;
Kernel::self()->beginCommandGroup(i18n("Merge Entries"));
- QString label = i18n("Merging entries...");
+ TQString label = i18n("Merging entries...");
ProgressItem& item = ProgressManager::self()->newProgressItem(this, label, true /*canCancel*/);
item.setTotalSteps(m_origCount);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
// done if no entries to merge
if(m_origCount < 2) {
- QTimer::singleShot(500, this, SLOT(slotCleanup()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotCleanup()));
} else {
slotStartNext(); // starts fetching
}
}
void EntryMerger::slotStartNext() {
- QString statusMsg = i18n("Total merged/scanned entries: %1/%2")
- .arg(m_entriesToRemove.count())
- .arg(m_origCount - m_entriesToCheck.count());
- StatusBar::self()->setStatus(statusMsg);
+ TQString statusMsg = i18n("Total merged/scanned entries: %1/%2")
+ .tqarg(m_entriesToRemove.count())
+ .tqarg(m_origCount - m_entriesToCheck.count());
+ StatusBar::self()->settqStatus(statusMsg);
ProgressManager::self()->setProgress(this, m_origCount - m_entriesToCheck.count());
Data::EntryPtr baseEntry = m_entriesToCheck.front();
@@ -72,9 +72,9 @@ void EntryMerger::slotStartNext() {
m_entriesToCheck.remove(baseEntry);
if(m_cancelled || m_entriesToCheck.count() < 2) {
- QTimer::singleShot(0, this, SLOT(slotCleanup()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotCleanup()));
} else {
- QTimer::singleShot(0, this, SLOT(slotStartNext()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotStartNext()));
}
}
@@ -85,7 +85,7 @@ void EntryMerger::slotCancel() {
void EntryMerger::slotCleanup() {
Kernel::self()->removeEntries(m_entriesToRemove);
Controller::self()->slotUpdateSelection(0, m_entriesLeft);
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
ProgressManager::self()->setDone(this);
Kernel::self()->endCommandGroup();
deleteLater();
@@ -95,8 +95,8 @@ bool EntryMerger::cleanMerge(Data::EntryPtr e1, Data::EntryPtr e2) const {
// figure out if there's a clean merge possible
Data::FieldVec fields = e1->collection()->fields();
for(Data::FieldVecIt it = fields.begin(); it != fields.end(); ++it) {
- QString val1 = e1->field(it);
- QString val2 = e2->field(it);
+ TQString val1 = e1->field(it);
+ TQString val2 = e2->field(it);
if(val1 != val2 && !val1.isEmpty() && !val2.isEmpty()) {
return false;
}
diff --git a/src/entrymerger.h b/src/entrymerger.h
index 46e23ca..795c668 100644
--- a/src/entrymerger.h
+++ b/src/entrymerger.h
@@ -16,17 +16,18 @@
#include "datavectors.h"
-#include <qobject.h>
+#include <tqobject.h>
namespace Tellico {
/**
* @author Robby Stephenson
*/
-class EntryMerger : public QObject {
+class EntryMerger : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
- EntryMerger(Data::EntryVec entries, QObject* parent);
+ EntryMerger(Data::EntryVec entries, TQObject* tqparent);
public slots:
void slotCancel();
diff --git a/src/entryupdater.cpp b/src/entryupdater.cpp
index 5c3ba2d..f95ad11 100644
--- a/src/entryupdater.cpp
+++ b/src/entryupdater.cpp
@@ -26,8 +26,8 @@
#include <klistview.h>
#include <kiconloader.h>
-#include <qvbox.h>
-#include <qtimer.h>
+#include <tqvbox.h>
+#include <tqtimer.h>
namespace {
static const int CHECK_COLLECTION_IMAGES_STEP_SIZE = 10;
@@ -37,21 +37,21 @@ using Tellico::EntryUpdater;
// for each entry, we loop over all available fetchers
// then we loop over all entries
-EntryUpdater::EntryUpdater(Data::CollPtr coll_, Data::EntryVec entries_, QObject* parent_)
- : QObject(parent_), m_coll(coll_), m_entriesToUpdate(entries_), m_cancelled(false) {
+EntryUpdater::EntryUpdater(Data::CollPtr coll_, Data::EntryVec entries_, TQObject* tqparent_)
+ : TQObject(tqparent_), m_coll(coll_), m_entriesToUpdate(entries_), m_cancelled(false) {
// for now, we're assuming all entries are same collection type
m_fetchers = Fetch::Manager::self()->createUpdateFetchers(m_coll->type());
for(Fetch::FetcherVec::Iterator it = m_fetchers.begin(); it != m_fetchers.end(); ++it) {
- connect(it.data(), SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
- SLOT(slotResult(Tellico::Fetch::SearchResult*)));
- connect(it.data(), SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
- SLOT(slotDone()));
+ connect(it.data(), TQT_SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
+ TQT_SLOT(slotResult(Tellico::Fetch::SearchResult*)));
+ connect(it.data(), TQT_SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
+ TQT_SLOT(slotDone()));
}
init();
}
-EntryUpdater::EntryUpdater(const QString& source_, Data::CollPtr coll_, Data::EntryVec entries_, QObject* parent_)
- : QObject(parent_)
+EntryUpdater::EntryUpdater(const TQString& source_, Data::CollPtr coll_, Data::EntryVec entries_, TQObject* tqparent_)
+ : TQObject(tqparent_)
, m_coll(coll_)
, m_entriesToUpdate(entries_)
, m_cancelled(false) {
@@ -59,10 +59,10 @@ EntryUpdater::EntryUpdater(const QString& source_, Data::CollPtr coll_, Data::En
Fetch::Fetcher::Ptr f = Fetch::Manager::self()->createUpdateFetcher(m_coll->type(), source_);
if(f) {
m_fetchers.append(f);
- connect(f, SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
- SLOT(slotResult(Tellico::Fetch::SearchResult*)));
- connect(f, SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
- SLOT(slotDone()));
+ connect(f, TQT_SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
+ TQT_SLOT(slotResult(Tellico::Fetch::SearchResult*)));
+ connect(f, TQT_SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
+ TQT_SLOT(slotDone()));
}
init();
}
@@ -76,27 +76,27 @@ EntryUpdater::~EntryUpdater() {
void EntryUpdater::init() {
m_fetchIndex = 0;
m_origEntryCount = m_entriesToUpdate.count();
- QString label;
+ TQString label;
if(m_entriesToUpdate.count() == 1) {
- label = i18n("Updating %1...").arg(m_entriesToUpdate.front()->title());
+ label = i18n("Updating %1...").tqarg(m_entriesToUpdate.front()->title());
} else {
label = i18n("Updating entries...");
}
Kernel::self()->beginCommandGroup(i18n("Update Entries"));
ProgressItem& item = ProgressManager::self()->newProgressItem(this, label, true /*canCancel*/);
item.setTotalSteps(m_fetchers.count() * m_origEntryCount);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
// done if no fetchers available
if(m_fetchers.isEmpty()) {
- QTimer::singleShot(500, this, SLOT(slotCleanup()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotCleanup()));
} else {
slotStartNext(); // starts fetching
}
}
void EntryUpdater::slotStartNext() {
- StatusBar::self()->setStatus(i18n("Updating <b>%1</b>...").arg(m_entriesToUpdate.front()->title()));
+ StatusBar::self()->settqStatus(i18n("Updating <b>%1</b>...").tqarg(m_entriesToUpdate.front()->title()));
ProgressManager::self()->setProgress(this, m_fetchers.count() * (m_origEntryCount - m_entriesToUpdate.count()) + m_fetchIndex);
Fetch::Fetcher::Ptr f = m_fetchers[m_fetchIndex];
@@ -107,7 +107,7 @@ void EntryUpdater::slotStartNext() {
void EntryUpdater::slotDone() {
if(m_cancelled) {
myLog() << "EntryUpdater::slotDone() - cancelled" << endl;
- QTimer::singleShot(500, this, SLOT(slotCleanup()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotCleanup()));
return;
}
@@ -125,13 +125,13 @@ void EntryUpdater::slotDone() {
m_entriesToUpdate.remove(m_entriesToUpdate.begin());
// if there are no more entries, and this is the last fetcher, time to delete
if(m_entriesToUpdate.isEmpty()) {
- QTimer::singleShot(500, this, SLOT(slotCleanup()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotCleanup()));
return;
}
}
kapp->processEvents();
// so the entry updater can clean up a bit
- QTimer::singleShot(500, this, SLOT(slotStartNext()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotStartNext()));
}
void EntryUpdater::slotResult(Fetch::SearchResult* result_) {
@@ -207,34 +207,34 @@ void EntryUpdater::handleResults() {
Tellico::EntryUpdater::UpdateResult EntryUpdater::askUser(ResultList results) {
KDialogBase dlg(Kernel::self()->widget(), "entry updater dialog",
true, i18n("Select Match"), KDialogBase::Ok|KDialogBase::Cancel);
- QVBox* box = new QVBox(&dlg);
+ TQVBox* box = new TQVBox(&dlg);
box->setSpacing(10);
- QHBox* hbox = new QHBox(box);
+ TQHBox* hbox = new TQHBox(box);
hbox->setSpacing(10);
- QLabel* icon = new QLabel(hbox);
- icon->setPixmap(KGlobal::iconLoader()->loadIcon(QString::fromLatin1("network"), KIcon::Panel, 64));
- QString s = i18n("<qt><b>%1</b> returned multiple results which could match <b>%2</b>, "
+ TQLabel* icon = new TQLabel(hbox);
+ icon->setPixmap(KGlobal::iconLoader()->loadIcon(TQString::tqfromLatin1("network"), KIcon::Panel, 64));
+ TQString s = i18n("<qt><b>%1</b> returned multiple results which could match <b>%2</b>, "
"the entry currently in the collection. Please select the correct match.</qt>")
- .arg(m_fetchers[m_fetchIndex]->source())
- .arg(m_entriesToUpdate.front()->field(QString::fromLatin1("title")));
+ .tqarg(m_fetchers[m_fetchIndex]->source())
+ .tqarg(m_entriesToUpdate.front()->field(TQString::tqfromLatin1("title")));
GUI::RichTextLabel* l = new GUI::RichTextLabel(s, hbox);
hbox->setStretchFactor(l, 100);
KListView* view = new KListView(box);
view->setShowSortIndicator(true);
view->setAllColumnsShowFocus(true);
- view->setResizeMode(QListView::AllColumns);
+ view->setResizeMode(TQListView::AllColumns);
view->setMinimumWidth(640);
view->addColumn(i18n("Title"));
view->addColumn(i18n("Description"));
- QMap<KListViewItem*, UpdateResult> map;
+ TQMap<KListViewItem*, UpdateResult> map;
for(ResultList::Iterator res = results.begin(); res != results.end(); ++res) {
map.insert(new KListViewItem(view, (*res).first->fetchEntry()->title(), (*res).first->desc), *res);
}
dlg.setMainWidget(box);
- if(dlg.exec() != QDialog::Accepted) {
+ if(dlg.exec() != TQDialog::Accepted) {
return UpdateResult(0, false);
}
KListViewItem* item = static_cast<KListViewItem*>(view->selectedItem());
@@ -264,7 +264,7 @@ void EntryUpdater::mergeCurrent(Data::EntryPtr entry_, bool overWrite_) {
}
void EntryUpdater::slotCleanup() {
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
ProgressManager::self()->setDone(this);
Kernel::self()->endCommandGroup();
deleteLater();
diff --git a/src/entryupdater.h b/src/entryupdater.h
index ddf4aa4..faced3b 100644
--- a/src/entryupdater.h
+++ b/src/entryupdater.h
@@ -17,19 +17,20 @@
#include "datavectors.h"
#include "fetch/fetchmanager.h"
-#include <qpair.h>
-#include <qvaluelist.h>
+#include <tqpair.h>
+#include <tqvaluelist.h>
namespace Tellico {
/**
* @author Robby Stephenson
*/
-class EntryUpdater : public QObject {
+class EntryUpdater : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
- EntryUpdater(Data::CollPtr coll, Data::EntryVec entries, QObject* parent);
- EntryUpdater(const QString& fetcher, Data::CollPtr coll, Data::EntryVec entries, QObject* parent);
+ EntryUpdater(Data::CollPtr coll, Data::EntryVec entries, TQObject* tqparent);
+ EntryUpdater(const TQString& fetcher, Data::CollPtr coll, Data::EntryVec entries, TQObject* tqparent);
~EntryUpdater();
public slots:
@@ -42,8 +43,8 @@ private slots:
void slotCleanup();
private:
- typedef QPair<Fetch::SearchResult*, bool> UpdateResult;
- typedef QValueList<UpdateResult> ResultList;
+ typedef TQPair<Fetch::SearchResult*, bool> UpdateResult;
+ typedef TQValueList<UpdateResult> ResultList;
void init();
void handleResults();
diff --git a/src/entryview.cpp b/src/entryview.cpp
index c4b0d38..9019d18 100644
--- a/src/entryview.cpp
+++ b/src/entryview.cpp
@@ -36,25 +36,25 @@
#include <ktempfile.h>
#include <klocale.h>
-#include <qfile.h>
+#include <tqfile.h>
using Tellico::EntryView;
-EntryView::EntryView(QWidget* parent_, const char* name_) : KHTMLPart(parent_, name_),
+EntryView::EntryView(TQWidget* tqparent_, const char* name_) : KHTMLPart(tqparent_, name_),
m_entry(0), m_handler(0), m_run(0), m_tempFile(0), m_useGradientImages(true), m_checkCommonFile(true) {
setJScriptEnabled(false);
setJavaEnabled(false);
setMetaRefreshEnabled(false);
setPluginsEnabled(false);
- clear(); // needed for initial layout
+ clear(); // needed for initial tqlayout
view()->setAcceptDrops(true);
DropHandler* drophandler = new DropHandler(this);
view()->installEventFilter(drophandler);
- connect(browserExtension(), SIGNAL(openURLRequest(const KURL&, const KParts::URLArgs&)),
- SLOT(slotOpenURL(const KURL&)));
- connect(kapp, SIGNAL(kdisplayPaletteChanged()), SLOT(slotResetColors()));
+ connect(browserExtension(), TQT_SIGNAL(openURLRequest(const KURL&, const KParts::URLArgs&)),
+ TQT_SLOT(slotOpenURL(const KURL&)));
+ connect(kapp, TQT_SIGNAL(kdisplayPaletteChanged()), TQT_SLOT(slotResetColors()));
}
EntryView::~EntryView() {
@@ -76,7 +76,7 @@ void EntryView::clear() {
write(m_textToShow);
}
end();
- view()->layout(); // I need this because some of the margins and widths may get messed up
+ view()->tqlayout(); // I need this because some of the margins and widths may get messed up
}
void EntryView::showEntry(Data::EntryPtr entry_) {
@@ -85,7 +85,7 @@ void EntryView::showEntry(Data::EntryPtr entry_) {
return;
}
- m_textToShow = QString();
+ m_textToShow = TQString();
#if 0
kdWarning() << "EntryView::showEntry() - turn me off!" << endl;
m_entry = 0;
@@ -116,24 +116,24 @@ void EntryView::showEntry(Data::EntryPtr entry_) {
opt |= Export::ExportClean;
}
exporter.setOptions(opt);
- QDomDocument dom = exporter.exportXML();
+ TQDomDocument dom = exporter.exportXML();
// myDebug() << dom.toString() << endl;
#if 0
kdWarning() << "EntryView::showEntry() - turn me off!" << endl;
- QFile f1(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f1(TQString::tqfromLatin1("/tmp/test.xml"));
if(f1.open(IO_WriteOnly)) {
- QTextStream t(&f1);
+ TQTextStream t(&f1);
t << dom.toString();
}
f1.close();
#endif
- QString html = m_handler->applyStylesheet(dom.toString());
+ TQString html = m_handler->applyStylesheet(dom.toString());
// write out image files
Data::FieldVec fields = entry_->collection()->imageFields();
for(Data::FieldVec::Iterator field = fields.begin(); field != fields.end(); ++field) {
- QString id = entry_->field(field);
+ TQString id = entry_->field(field);
if(id.isEmpty()) {
continue;
}
@@ -146,9 +146,9 @@ void EntryView::showEntry(Data::EntryPtr entry_) {
#if 0
kdWarning() << "EntryView::showEntry() - turn me off!" << endl;
- QFile f2(QString::fromLatin1("/tmp/test.html"));
+ TQFile f2(TQString::tqfromLatin1("/tmp/test.html"));
if(f2.open(IO_WriteOnly)) {
- QTextStream t(&f2);
+ TQTextStream t(&f2);
t << html;
}
f2.close();
@@ -158,35 +158,35 @@ void EntryView::showEntry(Data::EntryPtr entry_) {
write(html);
end();
// not need anymore?
- view()->layout(); // I need this because some of the margins and widths may get messed up
+ view()->tqlayout(); // I need this because some of the margins and widths may get messed up
}
-void EntryView::showText(const QString& text_) {
+void EntryView::showText(const TQString& text_) {
m_textToShow = text_;
begin();
write(text_);
end();
}
-void EntryView::setXSLTFile(const QString& file_) {
- QString oldFile = m_xsltFile;
+void EntryView::setXSLTFile(const TQString& file_) {
+ TQString oldFile = m_xsltFile;
// if starts with slash, then absolute path
if(file_.at(0) == '/') {
m_xsltFile = file_;
} else {
- const QString templateDir = QString::fromLatin1("entry-templates/");
+ const TQString templateDir = TQString::tqfromLatin1("entry-templates/");
m_xsltFile = locate("appdata", templateDir + file_);
if(m_xsltFile.isEmpty()) {
if(!file_.isEmpty()) {
kdWarning() << "EntryView::setXSLTFile() - can't locate " << file_ << endl;
}
- m_xsltFile = locate("appdata", templateDir + QString::fromLatin1("Fancy.xsl"));
+ m_xsltFile = locate("appdata", templateDir + TQString::tqfromLatin1("Fancy.xsl"));
if(m_xsltFile.isEmpty()) {
- QString str = QString::fromLatin1("<qt>");
+ TQString str = TQString::tqfromLatin1("<qt>");
str += i18n("Tellico is unable to locate the default entry stylesheet.");
- str += QChar(' ');
+ str += TQChar(' ');
str += i18n("Please check your installation.");
- str += QString::fromLatin1("</qt>");
+ str += TQString::tqfromLatin1("</qt>");
KMessageBox::error(view(), str);
clear();
return;
@@ -204,22 +204,22 @@ void EntryView::setXSLTFile(const QString& file_) {
if(m_handler && reloadImages) {
// the only two colors that matter for the gradients are the base color
// and highlight base color
- const QCString& oldBase = m_handler->param("bgcolor");
- const QCString& oldHigh = m_handler->param("color2");
+ const TQCString& oldBase = m_handler->param("bgcolor");
+ const TQCString& oldHigh = m_handler->param("color2");
// remember the string params have apostrophes on either side, so we can start search at pos == 1
- reloadImages = oldBase.find(Config::templateBaseColor(type).name().latin1(), 1) == -1
- || oldHigh.find(Config::templateHighlightedBaseColor(type).name().latin1(), 1) == -1;
+ reloadImages = oldBase.tqfind(TQString(Config::templateBaseColor(type).name()).latin1(), 1) == -1
+ || oldHigh.tqfind(TQString(Config::templateHighlightedBaseColor(type).name()).latin1(), 1) == -1;
}
if(!m_handler || m_xsltFile != oldFile) {
delete m_handler;
// must read the file name to get proper context
- m_handler = new XSLTHandler(QFile::encodeName(m_xsltFile));
+ m_handler = new XSLTHandler(TQFile::encodeName(m_xsltFile));
if(m_checkCommonFile && !m_handler->isValid()) {
NewStuff::Manager::checkCommonFile();
m_checkCommonFile = false;
delete m_handler;
- m_handler = new XSLTHandler(QFile::encodeName(m_xsltFile));
+ m_handler = new XSLTHandler(TQFile::encodeName(m_xsltFile));
}
if(!m_handler->isValid()) {
kdWarning() << "EntryView::setXSLTFile() - invalid xslt handler" << endl;
@@ -230,22 +230,22 @@ void EntryView::setXSLTFile(const QString& file_) {
}
}
- m_handler->addStringParam("font", Config::templateFont(type).family().latin1());
- m_handler->addStringParam("fontsize", QCString().setNum(Config::templateFont(type).pointSize()));
- m_handler->addStringParam("bgcolor", Config::templateBaseColor(type).name().latin1());
- m_handler->addStringParam("fgcolor", Config::templateTextColor(type).name().latin1());
- m_handler->addStringParam("color1", Config::templateHighlightedTextColor(type).name().latin1());
- m_handler->addStringParam("color2", Config::templateHighlightedBaseColor(type).name().latin1());
+ m_handler->addStringParam("font", TQString(Config::templateFont(type).family()).latin1());
+ m_handler->addStringParam("fontsize", TQCString().setNum(Config::templateFont(type).pointSize()));
+ m_handler->addStringParam("bgcolor", TQString(Config::templateBaseColor(type).name()).latin1());
+ m_handler->addStringParam("fgcolor", TQString(Config::templateTextColor(type).name()).latin1());
+ m_handler->addStringParam("color1", TQString(Config::templateHighlightedTextColor(type).name()).latin1());
+ m_handler->addStringParam("color2", TQString(Config::templateHighlightedBaseColor(type).name()).latin1());
if(Data::Document::self()->allImagesOnDisk()) {
- m_handler->addStringParam("imgdir", QFile::encodeName(ImageFactory::dataDir()));
+ m_handler->addStringParam("imgdir", TQFile::encodeName(ImageFactory::dataDir()));
} else {
- m_handler->addStringParam("imgdir", QFile::encodeName(ImageFactory::tempDir()));
+ m_handler->addStringParam("imgdir", TQFile::encodeName(ImageFactory::tempDir()));
}
// look for a file that gets installed to know the installation directory
- QString appdir = KGlobal::dirs()->findResourceDir("appdata", QString::fromLatin1("pics/tellico.png"));
- m_handler->addStringParam("datadir", QFile::encodeName(appdir));
+ TQString appdir = KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png"));
+ m_handler->addStringParam("datadir", TQFile::encodeName(appdir));
// if we don't have to reload the images, then just show the entry and we're done
if(!reloadImages) {
@@ -260,13 +260,13 @@ void EntryView::setXSLTFile(const QString& file_) {
void EntryView::slotRefresh() {
setXSLTFile(m_xsltFile);
showEntry(m_entry);
- view()->repaint();
+ view()->tqrepaint();
}
// do some contortions in case the url is relative
// need to interpret it relative to document URL instead of xslt file
// the current node under the mouse vould be the text node inside
-// the anchor node, so iterate up the parents
+// the anchor node, so iterate up the tqparents
void EntryView::slotOpenURL(const KURL& url_) {
if(url_.protocol() == Latin1Literal("tc")) {
// handle this internally
@@ -277,7 +277,7 @@ void EntryView::slotOpenURL(const KURL& url_) {
KURL u = url_;
for(DOM::Node node = nodeUnderMouse(); !node.isNull(); node = node.parentNode()) {
if(node.nodeType() == DOM::Node::ELEMENT_NODE && static_cast<DOM::Element>(node).tagName() == "a") {
- QString href = static_cast<DOM::Element>(node).getAttribute("href").string();
+ TQString href = static_cast<DOM::Element>(node).getAttribute("href").string();
if(!href.isEmpty() && KURL::isRelativeURL(href)) {
// interpet url relative to document url
u = KURL(Kernel::self()->URL(), href);
@@ -292,7 +292,7 @@ void EntryView::slotOpenURL(const KURL& url_) {
void EntryView::slotReloadEntry() {
// this slot should only be connected in setXSLTFile()
// must disconnect the signal first, otherwise, get an infinite loop
- disconnect(SIGNAL(completed()));
+ disconnect(TQT_SIGNAL(completed()));
closeURL(); // this is needed to stop everything, for some reason
view()->setUpdatesEnabled(true);
@@ -309,12 +309,12 @@ void EntryView::slotReloadEntry() {
void EntryView::setXSLTOptions(const StyleOptions& opt_) {
m_handler->addStringParam("font", opt_.fontFamily.latin1());
- m_handler->addStringParam("fontsize", QCString().setNum(opt_.fontSize));
- m_handler->addStringParam("bgcolor", opt_.baseColor.name().latin1());
- m_handler->addStringParam("fgcolor", opt_.textColor.name().latin1());
- m_handler->addStringParam("color1", opt_.highlightedTextColor.name().latin1());
- m_handler->addStringParam("color2", opt_.highlightedBaseColor.name().latin1());
- m_handler->addStringParam("imgdir", QFile::encodeName(opt_.imgDir));
+ m_handler->addStringParam("fontsize", TQCString().setNum(opt_.fontSize));
+ m_handler->addStringParam("bgcolor", TQString(opt_.baseColor.name()).latin1());
+ m_handler->addStringParam("fgcolor", TQString(opt_.textColor.name()).latin1());
+ m_handler->addStringParam("color1", TQString(opt_.highlightedTextColor.name()).latin1());
+ m_handler->addStringParam("color2", TQString(opt_.highlightedBaseColor.name()).latin1());
+ m_handler->addStringParam("imgdir", TQFile::encodeName(opt_.imgDir));
}
@@ -329,7 +329,7 @@ void EntryView::slotResetColors() {
void EntryView::resetColors() {
ImageFactory::createStyleImages(); // recreate gradients
- QString dir = m_handler ? m_handler->param("imgdir") : QString();
+ TQString dir = m_handler ? m_handler->param("imgdir") : TQString();
if(dir.isEmpty()) {
dir = Data::Document::self()->allImagesOnDisk() ? ImageFactory::dataDir() : ImageFactory::tempDir();
} else {
@@ -340,10 +340,10 @@ void EntryView::resetColors() {
// this is a rather bad hack to get around the fact that the image cache is not reloaded when
// the gradient files are changed on disk. Setting the URLArgs for write() calls doesn't seem to
- // work. So force a reload with a temp file, then catch the completed signal and repaint
- QString s = QString::fromLatin1("<html><body><img src=\"%1\"><img src=\"%2\"></body></html>")
- .arg(dir + QString::fromLatin1("gradient_bg.png"))
- .arg(dir + QString::fromLatin1("gradient_header.png"));
+ // work. So force a reload with a temp file, then catch the completed signal and tqrepaint
+ TQString s = TQString::tqfromLatin1("<html><body><img src=\"%1\"><img src=\"%2\"></body></html>")
+ .tqarg(dir + TQString::tqfromLatin1("gradient_bg.png"))
+ .tqarg(dir + TQString::tqfromLatin1("gradient_header.png"));
delete m_tempFile;
m_tempFile = new KTempFile;
@@ -358,7 +358,7 @@ void EntryView::resetColors() {
// don't flicker
view()->setUpdatesEnabled(false);
openURL(m_tempFile->name());
- connect(this, SIGNAL(completed()), SLOT(slotReloadEntry()));
+ connect(this, TQT_SIGNAL(completed()), TQT_SLOT(slotReloadEntry()));
}
#include "entryview.moc"
diff --git a/src/entryview.h b/src/entryview.h
index ddca518..f6d4744 100644
--- a/src/entryview.h
+++ b/src/entryview.h
@@ -21,7 +21,7 @@ class KTempFile;
#include <khtml_part.h>
-#include <qguardedptr.h>
+#include <tqguardedptr.h>
namespace Tellico {
class XSLTHandler;
@@ -33,15 +33,16 @@ namespace Tellico {
*/
class EntryView : public KHTMLPart {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* The EntryView shows a HTML representation of the data in the entry.
*
- * @param parent QWidget parent
- * @param name QObject name
+ * @param tqparent TQWidget tqparent
+ * @param name TQObject name
*/
- EntryView(QWidget* parent, const char* name=0);
+ EntryView(TQWidget* tqparent, const char* name=0);
/**
*/
virtual ~EntryView();
@@ -52,7 +53,7 @@ public:
* @param entry The entry to show
*/
void showEntry(Data::EntryPtr entry);
- void showText(const QString& text);
+ void showText(const TQString& text);
/**
* Clear the widget and set Entry pointer to NULL
@@ -64,7 +65,7 @@ public:
*
* @param file The XSLT file name
*/
- void setXSLTFile(const QString& file);
+ void setXSLTFile(const TQString& file);
void setXSLTOptions(const StyleOptions& options);
void setUseGradientImages(bool b) { m_useGradientImages = b; }
@@ -92,11 +93,11 @@ private:
Data::EntryPtr m_entry;
XSLTHandler* m_handler;
- QString m_xsltFile;
- QString m_textToShow;
+ TQString m_xsltFile;
+ TQString m_textToShow;
// to run any clicked processes
- QGuardedPtr<KRun> m_run;
+ TQGuardedPtr<KRun> m_run;
KTempFile* m_tempFile;
bool m_useGradientImages : 1;
bool m_checkCommonFile : 1;
diff --git a/src/exportdialog.cpp b/src/exportdialog.cpp
index 7ef61a0..f82eede 100644
--- a/src/exportdialog.cpp
+++ b/src/exportdialog.cpp
@@ -35,43 +35,43 @@
#include <kglobal.h>
#include <kconfig.h>
-#include <qlayout.h>
-#include <qcheckbox.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qwhatsthis.h>
-#include <qtextcodec.h>
+#include <tqlayout.h>
+#include <tqcheckbox.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqwhatsthis.h>
+#include <tqtextcodec.h>
using Tellico::ExportDialog;
-ExportDialog::ExportDialog(Export::Format format_, Data::CollPtr coll_, QWidget* parent_, const char* name_)
- : KDialogBase(parent_, name_, true /*modal*/, i18n("Export Options"), Ok|Cancel),
+ExportDialog::ExportDialog(Export::Format format_, Data::CollPtr coll_, TQWidget* tqparent_, const char* name_)
+ : KDialogBase(tqparent_, name_, true /*modal*/, i18n("Export Options"), Ok|Cancel),
m_format(format_), m_coll(coll_), m_exporter(exporter(format_)) {
- QWidget* widget = new QWidget(this);
- QVBoxLayout* topLayout = new QVBoxLayout(widget, 0, spacingHint());
+ TQWidget* widget = new TQWidget(this);
+ TQVBoxLayout* topLayout = new TQVBoxLayout(widget, 0, spacingHint());
- QGroupBox* group1 = new QGroupBox(1, Qt::Horizontal, i18n("Formatting"), widget);
+ TQGroupBox* group1 = new TQGroupBox(1, Qt::Horizontal, i18n("Formatting"), widget);
topLayout->addWidget(group1, 0);
- m_formatFields = new QCheckBox(i18n("Format all fields"), group1);
+ m_formatFields = new TQCheckBox(i18n("Format all fields"), group1);
m_formatFields->setChecked(false);
- QWhatsThis::add(m_formatFields, i18n("If checked, the values of the fields will be "
+ TQWhatsThis::add(m_formatFields, i18n("If checked, the values of the fields will be "
"automatically formatted according to their format type."));
- m_exportSelected = new QCheckBox(i18n("Export selected entries only"), group1);
+ m_exportSelected = new TQCheckBox(i18n("Export selected entries only"), group1);
m_exportSelected->setChecked(false);
- QWhatsThis::add(m_exportSelected, i18n("If checked, only the currently selected entries will "
+ TQWhatsThis::add(m_exportSelected, i18n("If checked, only the currently selected entries will "
"be exported."));
- QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, i18n("Encoding"), widget);
+ TQButtonGroup* bg = new TQButtonGroup(1, Qt::Horizontal, i18n("Encoding"), widget);
topLayout->addWidget(bg, 0);
- m_encodeUTF8 = new QRadioButton(i18n("Encode in Unicode (UTF-8)"), bg);
+ m_encodeUTF8 = new TQRadioButton(i18n("Encode in Unicode (UTF-8)"), bg);
m_encodeUTF8->setChecked(true);
- QWhatsThis::add(m_encodeUTF8, i18n("Encode the exported file in Unicode (UTF-8)."));
- QString localStr = i18n("Encode in user locale (%1)").arg(
- QString::fromLatin1(QTextCodec::codecForLocale()->name()));
- m_encodeLocale = new QRadioButton(localStr, bg);
- QWhatsThis::add(m_encodeLocale, i18n("Encode the exported file in the local encoding."));
+ TQWhatsThis::add(m_encodeUTF8, i18n("Encode the exported file in Unicode (UTF-8)."));
+ TQString localStr = i18n("Encode in user locale (%1)").tqarg(
+ TQString::tqfromLatin1(TQTextCodec::codecForLocale()->name()));
+ m_encodeLocale = new TQRadioButton(localStr, bg);
+ TQWhatsThis::add(m_encodeLocale, i18n("Encode the exported file in the local encoding."));
- QWidget* w = m_exporter->widget(widget, "exporter_widget");
+ TQWidget* w = m_exporter->widget(widget, "exporter_widget");
if(w) {
topLayout->addWidget(w, 0);
}
@@ -88,7 +88,7 @@ ExportDialog::ExportDialog(Export::Format format_, Data::CollPtr coll_, QWidget*
} else if(format_ == Export::Alexandria || format_ == Export::PilotDB) {
bg->setEnabled(false);
}
- connect(this, SIGNAL(okClicked()), SLOT(slotSaveOptions()));
+ connect(this, TQT_SIGNAL(okClicked()), TQT_SLOT(slotSaveOptions()));
}
ExportDialog::~ExportDialog() {
@@ -96,8 +96,8 @@ ExportDialog::~ExportDialog() {
m_exporter = 0;
}
-QString ExportDialog::fileFilter() {
- return m_exporter ? m_exporter->fileFilter() : QString::null;
+TQString ExportDialog::fileFilter() {
+ return m_exporter ? m_exporter->fileFilter() : TQString();
}
void ExportDialog::readOptions() {
diff --git a/src/exportdialog.h b/src/exportdialog.h
index 2e68ca3..19a6cbe 100644
--- a/src/exportdialog.h
+++ b/src/exportdialog.h
@@ -14,8 +14,8 @@
#ifndef EXPORTDIALOG_H
#define EXPORTDIALOG_H
-class QCheckBox;
-class QRadioButton;
+class TQCheckBox;
+class TQRadioButton;
#include "translators/translators.h"
#include "datavectors.h"
@@ -33,12 +33,13 @@ namespace Tellico {
*/
class ExportDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- ExportDialog(Export::Format format, Data::CollPtr coll, QWidget* parent, const char* name);
+ ExportDialog(Export::Format format, Data::CollPtr coll, TQWidget* tqparent, const char* name);
~ExportDialog();
- QString fileFilter();
+ TQString fileFilter();
bool exportURL(const KURL& url=KURL()) const;
static Export::Target exportTarget(Export::Format format);
@@ -55,10 +56,10 @@ private:
Export::Format m_format;
Data::CollPtr m_coll;
Export::Exporter* m_exporter;
- QCheckBox* m_formatFields;
- QCheckBox* m_exportSelected;
- QRadioButton* m_encodeUTF8;
- QRadioButton* m_encodeLocale;
+ TQCheckBox* m_formatFields;
+ TQCheckBox* m_exportSelected;
+ TQRadioButton* m_encodeUTF8;
+ TQRadioButton* m_encodeLocale;
};
} // end namespace
diff --git a/src/fetch/amazonfetcher.cpp b/src/fetch/amazonfetcher.cpp
index 36c009f..fee207a 100644
--- a/src/fetch/amazonfetcher.cpp
+++ b/src/fetch/amazonfetcher.cpp
@@ -36,13 +36,13 @@
#include <kcombobox.h>
#include <kaccelmanager.h>
-#include <qdom.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qwhatsthis.h>
-#include <qcheckbox.h>
-#include <qfile.h>
-#include <qtextcodec.h>
+#include <tqdom.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqwhatsthis.h>
+#include <tqcheckbox.h>
+#include <tqfile.h>
+#include <tqtextcodec.h>
namespace {
static const int AMAZON_RETURNS_PER_REQUEST = 10;
@@ -82,10 +82,10 @@ const AmazonFetcher::SiteData& AmazonFetcher::siteData(int site_) {
return dataVector[site_];
}
-AmazonFetcher::AmazonFetcher(Site site_, QObject* parent_, const char* name_)
- : Fetcher(parent_, name_), m_xsltHandler(0), m_site(site_), m_imageSize(MediumImage),
- m_access(QString::fromLatin1(AMAZON_ACCESS_KEY)),
- m_assoc(QString::fromLatin1(AMAZON_ASSOC_TOKEN)), m_addLinkField(true), m_limit(AMAZON_MAX_RETURNS_TOTAL),
+AmazonFetcher::AmazonFetcher(Site site_, TQObject* tqparent_, const char* name_)
+ : Fetcher(tqparent_, name_), m_xsltHandler(0), m_site(site_), m_imageSize(MediumImage),
+ m_access(TQString::tqfromLatin1(AMAZON_ACCESS_KEY)),
+ m_assoc(TQString::tqfromLatin1(AMAZON_ASSOC_TOKEN)), m_addLinkField(true), m_limit(AMAZON_MAX_RETURNS_TOTAL),
m_countOffset(0), m_page(1), m_total(-1), m_numResults(0), m_job(0), m_started(false) {
m_name = siteData(site_).title;
}
@@ -95,11 +95,11 @@ AmazonFetcher::~AmazonFetcher() {
m_xsltHandler = 0;
}
-QString AmazonFetcher::defaultName() {
+TQString AmazonFetcher::defaultName() {
return i18n("Amazon.com Web Services");
}
-QString AmazonFetcher::source() const {
+TQString AmazonFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -113,7 +113,7 @@ bool AmazonFetcher::canFetch(int type) const {
}
void AmazonFetcher::readConfigHook(const KConfigGroup& config_) {
- QString s = config_.readEntry("AccessKey");
+ TQString s = config_.readEntry("AccessKey");
if(!s.isEmpty()) {
m_access = s;
}
@@ -125,10 +125,10 @@ void AmazonFetcher::readConfigHook(const KConfigGroup& config_) {
if(imageSize > -1) {
m_imageSize = static_cast<ImageSize>(imageSize);
}
- m_fields = config_.readListEntry("Custom Fields", QString::fromLatin1("keyword"));
+ m_fields = config_.readListEntry("Custom Fields", TQString::tqfromLatin1("keyword"));
}
-void AmazonFetcher::search(FetchKey key_, const QString& value_) {
+void AmazonFetcher::search(FetchKey key_, const TQString& value_) {
m_key = key_;
m_value = value_.stripWhiteSpace();
m_started = true;
@@ -153,34 +153,34 @@ void AmazonFetcher::doSearch() {
const SiteData& data = siteData(m_site);
KURL u = data.url;
- u.addQueryItem(QString::fromLatin1("Service"), QString::fromLatin1("AWSECommerceService"));
- u.addQueryItem(QString::fromLatin1("AssociateTag"), m_assoc);
- u.addQueryItem(QString::fromLatin1("AWSAccessKeyId"), m_access);
- u.addQueryItem(QString::fromLatin1("Operation"), QString::fromLatin1("ItemSearch"));
- u.addQueryItem(QString::fromLatin1("ResponseGroup"), QString::fromLatin1("Large"));
- u.addQueryItem(QString::fromLatin1("ItemPage"), QString::number(m_page));
- u.addQueryItem(QString::fromLatin1("Version"), QString::fromLatin1("2007-10-29"));
+ u.addQueryItem(TQString::tqfromLatin1("Service"), TQString::tqfromLatin1("AWSECommerceService"));
+ u.addQueryItem(TQString::tqfromLatin1("AssociateTag"), m_assoc);
+ u.addQueryItem(TQString::tqfromLatin1("AWSAccessKeyId"), m_access);
+ u.addQueryItem(TQString::tqfromLatin1("Operation"), TQString::tqfromLatin1("ItemSearch"));
+ u.addQueryItem(TQString::tqfromLatin1("ResponseGroup"), TQString::tqfromLatin1("Large"));
+ u.addQueryItem(TQString::tqfromLatin1("ItemPage"), TQString::number(m_page));
+ u.addQueryItem(TQString::tqfromLatin1("Version"), TQString::tqfromLatin1("2007-10-29"));
const int type = Kernel::self()->collectionType();
switch(type) {
case Data::Collection::Book:
case Data::Collection::ComicBook:
case Data::Collection::Bibtex:
- u.addQueryItem(QString::fromLatin1("SearchIndex"), QString::fromLatin1("Books"));
- u.addQueryItem(QString::fromLatin1("SortIndex"), QString::fromLatin1("relevancerank"));
+ u.addQueryItem(TQString::tqfromLatin1("SearchIndex"), TQString::tqfromLatin1("Books"));
+ u.addQueryItem(TQString::tqfromLatin1("SortIndex"), TQString::tqfromLatin1("relevancerank"));
break;
case Data::Collection::Album:
- u.addQueryItem(QString::fromLatin1("SearchIndex"), QString::fromLatin1("Music"));
+ u.addQueryItem(TQString::tqfromLatin1("SearchIndex"), TQString::tqfromLatin1("Music"));
break;
case Data::Collection::Video:
- u.addQueryItem(QString::fromLatin1("SearchIndex"), QString::fromLatin1("Video"));
- u.addQueryItem(QString::fromLatin1("SortIndex"), QString::fromLatin1("relevancerank"));
+ u.addQueryItem(TQString::tqfromLatin1("SearchIndex"), TQString::tqfromLatin1("Video"));
+ u.addQueryItem(TQString::tqfromLatin1("SortIndex"), TQString::tqfromLatin1("relevancerank"));
break;
case Data::Collection::Game:
- u.addQueryItem(QString::fromLatin1("SearchIndex"), QString::fromLatin1("VideoGames"));
+ u.addQueryItem(TQString::tqfromLatin1("SearchIndex"), TQString::tqfromLatin1("VideoGames"));
break;
case Data::Collection::Coin:
@@ -189,7 +189,7 @@ void AmazonFetcher::doSearch() {
case Data::Collection::Base:
case Data::Collection::Card:
default:
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
@@ -199,48 +199,48 @@ void AmazonFetcher::doSearch() {
// that utf8 DOES NOT WORK. So I'm arbitrarily using iso-8859-1, except for JP.
// Why different for JP? Well, I've not received any bug reports from that direction yet
-// QString value = KURL::decode_string(value_, 106);
-// QString value = QString::fromLocal8Bit(value_.utf8());
- QString value = m_value;
+// TQString value = KURL::decode_string(value_, 106);
+// TQString value = TQString::fromLocal8Bit(value_.utf8());
+ TQString value = m_value;
// a mibenum of 106 is utf-8, 4 is iso-8859-1, 0 means use user's locale,
int mib = m_site == AmazonFetcher::JP ? 106 : 4;
switch(m_key) {
case Title:
- u.addQueryItem(QString::fromLatin1("Title"), value, mib);
+ u.addQueryItem(TQString::tqfromLatin1("Title"), value, mib);
break;
case Person:
if(type == Data::Collection::Video) {
- u.addQueryItem(QString::fromLatin1("Actor"), value, mib);
- u.addQueryItem(QString::fromLatin1("Director"), value, mib);
+ u.addQueryItem(TQString::tqfromLatin1("Actor"), value, mib);
+ u.addQueryItem(TQString::tqfromLatin1("Director"), value, mib);
} else if(type == Data::Collection::Album) {
- u.addQueryItem(QString::fromLatin1("Artist"), value, mib);
+ u.addQueryItem(TQString::tqfromLatin1("Artist"), value, mib);
} else if(type == Data::Collection::Game) {
- u.addQueryItem(QString::fromLatin1("Manufacturer"), value, mib);
+ u.addQueryItem(TQString::tqfromLatin1("Manufacturer"), value, mib);
} else { // books and bibtex
- QString s = QString::fromLatin1("author:%1 or publisher:%2").arg(value, value);
-// u.addQueryItem(QString::fromLatin1("Author"), value, mib);
-// u.addQueryItem(QString::fromLatin1("Publisher"), value, mib);
- u.addQueryItem(QString::fromLatin1("Power"), s, mib);
+ TQString s = TQString::tqfromLatin1("author:%1 or publisher:%2").tqarg(value, value);
+// u.addQueryItem(TQString::tqfromLatin1("Author"), value, mib);
+// u.addQueryItem(TQString::tqfromLatin1("Publisher"), value, mib);
+ u.addQueryItem(TQString::tqfromLatin1("Power"), s, mib);
}
break;
case ISBN:
{
- u.removeQueryItem(QString::fromLatin1("Operation"));
- u.addQueryItem(QString::fromLatin1("Operation"), QString::fromLatin1("ItemLookup"));
+ u.removeQueryItem(TQString::tqfromLatin1("Operation"));
+ u.addQueryItem(TQString::tqfromLatin1("Operation"), TQString::tqfromLatin1("ItemLookup"));
- QString s = m_value; // not encValue!!!
+ TQString s = m_value; // not encValue!!!
s.remove('-');
// ISBN only get digits or 'X', and multiple values are connected with "; "
- QStringList isbns = QStringList::split(QString::fromLatin1("; "), s);
+ TQStringList isbns = TQStringList::split(TQString::tqfromLatin1("; "), s);
// Amazon isbn13 search is still very flaky, so if possible, we're going to convert
// all of them to isbn10. If we run into a 979 isbn13, then we're forced to do an
// isbn13 search
bool isbn13 = false;
- for(QStringList::Iterator it = isbns.begin(); it != isbns.end(); ) {
- if(m_value.startsWith(QString::fromLatin1("979"))) {
+ for(TQStringList::Iterator it = isbns.begin(); it != isbns.end(); ) {
+ if(m_value.startsWith(TQString::tqfromLatin1("979"))) {
if(m_site == JP) { // never works for JP
kdWarning() << "AmazonFetcher:doSearch() - ISBN-13 searching not implemented for Japan" << endl;
isbns.remove(it); // automatically skips to next
@@ -253,53 +253,53 @@ void AmazonFetcher::doSearch() {
}
// if we want isbn10, then convert all
if(!isbn13) {
- for(QStringList::Iterator it = isbns.begin(); it != isbns.end(); ++it) {
+ for(TQStringList::Iterator it = isbns.begin(); it != isbns.end(); ++it) {
if((*it).length() > 12) {
(*it) = ISBNValidator::isbn10(*it);
(*it).remove('-');
}
}
// the default search is by ASIN, which prohibits SearchIndex
- u.removeQueryItem(QString::fromLatin1("SearchIndex"));
+ u.removeQueryItem(TQString::tqfromLatin1("SearchIndex"));
}
// limit to first 10
while(isbns.size() > 10) {
isbns.pop_back();
}
- u.addQueryItem(QString::fromLatin1("ItemId"), isbns.join(QString::fromLatin1(",")));
+ u.addQueryItem(TQString::tqfromLatin1("ItemId"), isbns.join(TQString::tqfromLatin1(",")));
if(isbn13) {
- u.addQueryItem(QString::fromLatin1("IdType"), QString::fromLatin1("EAN"));
+ u.addQueryItem(TQString::tqfromLatin1("IdType"), TQString::tqfromLatin1("EAN"));
}
}
break;
case UPC:
{
- u.removeQueryItem(QString::fromLatin1("Operation"));
- u.addQueryItem(QString::fromLatin1("Operation"), QString::fromLatin1("ItemLookup"));
+ u.removeQueryItem(TQString::tqfromLatin1("Operation"));
+ u.addQueryItem(TQString::tqfromLatin1("Operation"), TQString::tqfromLatin1("ItemLookup"));
// US allows UPC, all others are EAN
if(m_site == US) {
- u.addQueryItem(QString::fromLatin1("IdType"), QString::fromLatin1("UPC"));
+ u.addQueryItem(TQString::tqfromLatin1("IdType"), TQString::tqfromLatin1("UPC"));
} else {
- u.addQueryItem(QString::fromLatin1("IdType"), QString::fromLatin1("EAN"));
+ u.addQueryItem(TQString::tqfromLatin1("IdType"), TQString::tqfromLatin1("EAN"));
}
- QString s = m_value; // not encValue!!!
+ TQString s = m_value; // not encValue!!!
s.remove('-');
// limit to first 10
- s.replace(QString::fromLatin1("; "), QString::fromLatin1(","));
+ s.tqreplace(TQString::tqfromLatin1("; "), TQString::tqfromLatin1(","));
s = s.section(',', 0, 9);
- u.addQueryItem(QString::fromLatin1("ItemId"), s);
+ u.addQueryItem(TQString::tqfromLatin1("ItemId"), s);
}
break;
case Keyword:
- u.addQueryItem(QString::fromLatin1("Keywords"), m_value, mib);
+ u.addQueryItem(TQString::tqfromLatin1("Keywords"), m_value, mib);
break;
case Raw:
{
- QString key = value.section('=', 0, 0).stripWhiteSpace();
- QString str = value.section('=', 1).stripWhiteSpace();
+ TQString key = value.section('=', 0, 0).stripWhiteSpace();
+ TQString str = value.section('=', 1).stripWhiteSpace();
u.addQueryItem(key, str, mib);
}
break;
@@ -312,10 +312,10 @@ void AmazonFetcher::doSearch() {
// myDebug() << "AmazonFetcher::search() - url: " << u.url() << endl;
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void AmazonFetcher::stop() {
@@ -332,8 +332,8 @@ void AmazonFetcher::stop() {
emit signalDone(this);
}
-void AmazonFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void AmazonFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -357,18 +357,18 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from amazonfetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test%1.xml").arg(m_page));
+ TQFile f(TQString::tqfromLatin1("/tmp/test%1.xml").tqarg(m_page));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
- t << QCString(m_data, m_data.size()+1);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
+ t << TQCString(m_data, m_data.size()+1);
}
f.close();
#endif
- QStringList errors;
+ TQStringList errors;
if(m_total == -1) {
- QDomDocument dom;
+ TQDomDocument dom;
if(!dom.setContent(m_data, false)) {
kdWarning() << "AmazonFetcher::slotComplete() - server did not return valid XML." << endl;
stop();
@@ -377,31 +377,31 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) {
// find TotalResults element
// it's in the first level under the root element
//ItemSearchResponse/Items/TotalResults
- QDomNode n = dom.documentElement().namedItem(QString::fromLatin1("Items"))
- .namedItem(QString::fromLatin1("TotalResults"));
- QDomElement e = n.toElement();
+ TQDomNode n = dom.documentElement().namedItem(TQString::tqfromLatin1("Items"))
+ .namedItem(TQString::tqfromLatin1("TotalResults"));
+ TQDomElement e = n.toElement();
if(!e.isNull()) {
m_total = e.text().toInt();
}
- n = dom.documentElement().namedItem(QString::fromLatin1("Items"))
- .namedItem(QString::fromLatin1("Request"))
- .namedItem(QString::fromLatin1("Errors"));
+ n = dom.documentElement().namedItem(TQString::tqfromLatin1("Items"))
+ .namedItem(TQString::tqfromLatin1("Request"))
+ .namedItem(TQString::tqfromLatin1("Errors"));
e = n.toElement();
if(!e.isNull()) {
- QDomNodeList nodes = e.elementsByTagName(QString::fromLatin1("Error"));
+ TQDomNodeList nodes = e.elementsByTagName(TQString::tqfromLatin1("Error"));
for(uint i = 0; i < nodes.count(); ++i) {
- e = nodes.item(i).toElement().namedItem(QString::fromLatin1("Code")).toElement();
+ e = nodes.item(i).toElement().namedItem(TQString::tqfromLatin1("Code")).toElement();
if(!e.isNull() && e.text() == Latin1Literal("AWS.ECommerceService.NoExactMatches")) {
// no exact match, not a real error, so skip
continue;
}
// for some reason, Amazon will return an error simply when a valid ISBN is not found
// I really want to ignore that, so check the IsValid element in the Request element
- QDomNode isValidNode = n.parentNode().namedItem(QString::fromLatin1("IsValid"));
+ TQDomNode isValidNode = n.tqparentNode().namedItem(TQString::tqfromLatin1("IsValid"));
if(m_key == ISBN && isValidNode.toElement().text().lower() == Latin1Literal("true")) {
continue;
}
- e = nodes.item(i).toElement().namedItem(QString::fromLatin1("Message")).toElement();
+ e = nodes.item(i).toElement().namedItem(TQString::tqfromLatin1("Message")).toElement();
if(!e.isNull()) {
errors << e.text();
}
@@ -417,11 +417,11 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) {
}
}
-// QRegExp stripHTML(QString::fromLatin1("<.*>"), true);
+// TQRegExp stripHTML(TQString::tqfromLatin1("<.*>"), true);
// stripHTML.setMinimal(true);
// assume amazon is always utf-8
- QString str = m_xsltHandler->applyStylesheet(QString::fromUtf8(m_data, m_data.size()));
+ TQString str = m_xsltHandler->applyStylesheet(TQString::fromUtf8(m_data, m_data.size()));
Import::TellicoImporter imp(str);
Data::CollPtr coll = imp.collection();
if(!coll) {
@@ -432,12 +432,12 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) {
if(!m_addLinkField) {
// remove amazon field if it's not to be added
- coll->removeField(QString::fromLatin1("amazon"));
+ coll->removeField(TQString::tqfromLatin1("amazon"));
}
Data::EntryVec entries = coll->entries();
if(entries.isEmpty() && !errors.isEmpty()) {
- for(QStringList::ConstIterator it = errors.constBegin(); it != errors.constEnd(); ++it) {
+ for(TQStringList::ConstIterator it = errors.constBegin(); it != errors.constEnd(); ++it) {
myDebug() << "AmazonFetcher::" << *it << endl;
}
message(errors[0], MessageHandler::Error);
@@ -460,64 +460,64 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) {
// special case book author
// amazon is really bad about not putting spaces after periods
if(coll->type() == Data::Collection::Book) {
- QRegExp rx(QString::fromLatin1("\\.([^\\s])"));
- QStringList values = entry->fields(QString::fromLatin1("author"), false);
- for(QStringList::Iterator it = values.begin(); it != values.end(); ++it) {
- (*it).replace(rx, QString::fromLatin1(". \\1"));
+ TQRegExp rx(TQString::tqfromLatin1("\\.([^\\s])"));
+ TQStringList values = entry->fields(TQString::tqfromLatin1("author"), false);
+ for(TQStringList::Iterator it = values.begin(); it != values.end(); ++it) {
+ (*it).tqreplace(rx, TQString::tqfromLatin1(". \\1"));
}
- entry->setField(QString::fromLatin1("author"), values.join(QString::fromLatin1("; ")));
+ entry->setField(TQString::tqfromLatin1("author"), values.join(TQString::tqfromLatin1("; ")));
}
// UK puts the year in the title for some reason
if(m_site == UK && coll->type() == Data::Collection::Video) {
- QRegExp rx(QString::fromLatin1("\\[(\\d{4})\\]"));
- QString t = entry->title();
- if(t.find(rx) > -1) {
- QString y = rx.cap(1);
+ TQRegExp rx(TQString::tqfromLatin1("\\[(\\d{4})\\]"));
+ TQString t = entry->title();
+ if(t.tqfind(rx) > -1) {
+ TQString y = rx.cap(1);
t.remove(rx).simplifyWhiteSpace();
- entry->setField(QString::fromLatin1("title"), t);
- if(entry->field(QString::fromLatin1("year")).isEmpty()) {
- entry->setField(QString::fromLatin1("year"), y);
+ entry->setField(TQString::tqfromLatin1("title"), t);
+ if(entry->field(TQString::tqfromLatin1("year")).isEmpty()) {
+ entry->setField(TQString::tqfromLatin1("year"), y);
}
}
}
- QString desc;
+ TQString desc;
switch(coll->type()) {
case Data::Collection::Book:
case Data::Collection::ComicBook:
case Data::Collection::Bibtex:
- desc = entry->field(QString::fromLatin1("author"))
- + QChar('/') + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("cr_year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("cr_year"));
- } else if(!entry->field(QString::fromLatin1("pub_year")).isEmpty()){
- desc += QChar('/') + entry->field(QString::fromLatin1("pub_year"));
+ desc = entry->field(TQString::tqfromLatin1("author"))
+ + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("cr_year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("cr_year"));
+ } else if(!entry->field(TQString::tqfromLatin1("pub_year")).isEmpty()){
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("pub_year"));
}
break;
case Data::Collection::Video:
- desc = entry->field(QString::fromLatin1("studio"))
- + QChar('/')
- + entry->field(QString::fromLatin1("director"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"))
- + QChar('/')
- + entry->field(QString::fromLatin1("medium"));
+ desc = entry->field(TQString::tqfromLatin1("studio"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("director"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("medium"));
break;
case Data::Collection::Album:
- desc = entry->field(QString::fromLatin1("artist"))
- + QChar('/')
- + entry->field(QString::fromLatin1("label"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"));
+ desc = entry->field(TQString::tqfromLatin1("artist"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("label"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"));
break;
case Data::Collection::Game:
- desc = entry->field(QString::fromLatin1("platform"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"));
+ desc = entry->field(TQString::tqfromLatin1("platform"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"));
break;
default:
@@ -528,21 +528,21 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) {
// tentatively don't do this, looks like ECS 4 cleaned everything up
/*
if(coll->type() == Data::Collection::Video) {
- QString plot = entry->field(QString::fromLatin1("plot"));
+ TQString plot = entry->field(TQString::tqfromLatin1("plot"));
plot.remove(stripHTML);
- entry->setField(QString::fromLatin1("plot"), plot);
+ entry->setField(TQString::tqfromLatin1("plot"), plot);
} else if(coll->type() == Data::Collection::Game) {
- QString desc = entry->field(QString::fromLatin1("description"));
+ TQString desc = entry->field(TQString::tqfromLatin1("description"));
desc.remove(stripHTML);
- entry->setField(QString::fromLatin1("description"), desc);
+ entry->setField(TQString::tqfromLatin1("description"), desc);
} else {
- QString comments = entry->field(QString::fromLatin1("comments"));
+ TQString comments = entry->field(TQString::tqfromLatin1("comments"));
comments.remove(stripHTML);
- entry->setField(QString::fromLatin1("comments"), comments);
+ entry->setField(TQString::tqfromLatin1("comments"), comments);
}
*/
// myDebug() << "AmazonFetcher::slotComplete() - " << entry->title() << endl;
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
++m_numResults;
@@ -556,14 +556,14 @@ void AmazonFetcher::slotComplete(KIO::Job* job_) {
// are there any additional results to get?
m_hasMoreResults = m_page * AMAZON_RETURNS_PER_REQUEST < m_total;
- const int currentTotal = QMIN(m_total, m_limit);
+ const int currentTotal = TQMIN(m_total, m_limit);
if(m_page * AMAZON_RETURNS_PER_REQUEST < currentTotal) {
int foundCount = (m_page-1) * AMAZON_RETURNS_PER_REQUEST + coll->entryCount();
- message(i18n("Results from %1: %2/%3").arg(source()).arg(foundCount).arg(m_total), MessageHandler::Status);
+ message(i18n("Results from %1: %2/%3").tqarg(source()).tqarg(foundCount).tqarg(m_total), MessageHandler::tqStatus);
++m_page;
m_countOffset = 0;
doSearch();
- } else if(m_value.contains(';') > 9) {
+ } else if(m_value.tqcontains(';') > 9) {
search(m_key, m_value.section(';', 10));
} else {
m_countOffset = m_entries.count() % AMAZON_RETURNS_PER_REQUEST;
@@ -581,10 +581,10 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) {
return 0;
}
- QStringList defaultFields = customFields().keys();
- for(QStringList::Iterator it = defaultFields.begin(); it != defaultFields.end(); ++it) {
- if(!m_fields.contains(*it)) {
- entry->setField(*it, QString::null);
+ TQStringList defaultFields = customFields().keys();
+ for(TQStringList::Iterator it = defaultFields.begin(); it != defaultFields.end(); ++it) {
+ if(!m_fields.tqcontains(*it)) {
+ entry->setField(*it, TQString());
}
}
@@ -595,44 +595,44 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) {
case Data::Collection::ComicBook:
case Data::Collection::Bibtex:
{
- const QString keywords = QString::fromLatin1("keyword");
- QStringList oldWords = entry->fields(keywords, false);
+ const TQString keywords = TQString::tqfromLatin1("keyword");
+ TQStringList oldWords = entry->fields(keywords, false);
StringSet words;
- for(QStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) {
+ for(TQStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) {
// the amazon2tellico stylesheet separates keywords with '/'
- QStringList nodes = QStringList::split('/', *it);
- for(QStringList::Iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) {
+ TQStringList nodes = TQStringList::split('/', *it);
+ for(TQStringList::Iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) {
if(*it2 == Latin1Literal("General") ||
*it2 == Latin1Literal("Subjects") ||
*it2 == Latin1Literal("Par prix") || // french stuff
*it2 == Latin1Literal("Divers") || // french stuff
- (*it2).startsWith(QChar('(')) ||
- (*it2).startsWith(QString::fromLatin1("Authors"))) {
+ (*it2).startsWith(TQChar('(')) ||
+ (*it2).startsWith(TQString::tqfromLatin1("Authors"))) {
continue;
}
words.add(*it2);
}
}
- entry->setField(keywords, words.toList().join(QString::fromLatin1("; ")));
+ entry->setField(keywords, words.toList().join(TQString::tqfromLatin1("; ")));
}
- entry->setField(QString::fromLatin1("comments"), Tellico::decodeHTML(entry->field(QString::fromLatin1("comments"))));
+ entry->setField(TQString::tqfromLatin1("comments"), Tellico::decodeHTML(entry->field(TQString::tqfromLatin1("comments"))));
break;
case Data::Collection::Video:
{
- const QString genres = QString::fromLatin1("genre");
- QStringList oldWords = entry->fields(genres, false);
+ const TQString genres = TQString::tqfromLatin1("genre");
+ TQStringList oldWords = entry->fields(genres, false);
StringSet words;
// only care about genres that have "Genres" in the amazon response
// and take the first word after that
- for(QStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) {
- if((*it).find(QString::fromLatin1("Genres")) == -1) {
+ for(TQStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) {
+ if((*it).tqfind(TQString::tqfromLatin1("Genres")) == -1) {
continue;
}
// the amazon2tellico stylesheet separates words with '/'
- QStringList nodes = QStringList::split('/', *it);
- for(QStringList::Iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) {
+ TQStringList nodes = TQStringList::split('/', *it);
+ for(TQStringList::Iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) {
if(*it2 != Latin1Literal("Genres")) {
continue;
}
@@ -643,34 +643,34 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) {
break; // we're done
}
}
- entry->setField(genres, words.toList().join(QString::fromLatin1("; ")));
+ entry->setField(genres, words.toList().join(TQString::tqfromLatin1("; ")));
// language tracks get duplicated, too
- QStringList langs = entry->fields(QString::fromLatin1("language"), false);
+ TQStringList langs = entry->fields(TQString::tqfromLatin1("language"), false);
words.clear();
- for(QStringList::ConstIterator it = langs.begin(); it != langs.end(); ++it) {
+ for(TQStringList::ConstIterator it = langs.begin(); it != langs.end(); ++it) {
words.add(*it);
}
- entry->setField(QString::fromLatin1("language"), words.toList().join(QString::fromLatin1("; ")));
+ entry->setField(TQString::tqfromLatin1("language"), words.toList().join(TQString::tqfromLatin1("; ")));
}
- entry->setField(QString::fromLatin1("plot"), Tellico::decodeHTML(entry->field(QString::fromLatin1("plot"))));
+ entry->setField(TQString::tqfromLatin1("plot"), Tellico::decodeHTML(entry->field(TQString::tqfromLatin1("plot"))));
break;
case Data::Collection::Album:
{
- const QString genres = QString::fromLatin1("genre");
- QStringList oldWords = entry->fields(genres, false);
+ const TQString genres = TQString::tqfromLatin1("genre");
+ TQStringList oldWords = entry->fields(genres, false);
StringSet words;
// only care about genres that have "Styles" in the amazon response
// and take the first word after that
- for(QStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) {
- if((*it).find(QString::fromLatin1("Styles")) == -1) {
+ for(TQStringList::Iterator it = oldWords.begin(); it != oldWords.end(); ++it) {
+ if((*it).tqfind(TQString::tqfromLatin1("Styles")) == -1) {
continue;
}
// the amazon2tellico stylesheet separates words with '/'
- QStringList nodes = QStringList::split('/', *it);
+ TQStringList nodes = TQStringList::split('/', *it);
bool isStyle = false;
- for(QStringList::Iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) {
+ for(TQStringList::Iterator it2 = nodes.begin(); it2 != nodes.end(); ++it2) {
if(!isStyle) {
if(*it2 == Latin1Literal("Styles")) {
isStyle = true;
@@ -682,13 +682,13 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) {
}
}
}
- entry->setField(genres, words.toList().join(QString::fromLatin1("; ")));
+ entry->setField(genres, words.toList().join(TQString::tqfromLatin1("; ")));
}
- entry->setField(QString::fromLatin1("comments"), Tellico::decodeHTML(entry->field(QString::fromLatin1("comments"))));
+ entry->setField(TQString::tqfromLatin1("comments"), Tellico::decodeHTML(entry->field(TQString::tqfromLatin1("comments"))));
break;
case Data::Collection::Game:
- entry->setField(QString::fromLatin1("description"), Tellico::decodeHTML(entry->field(QString::fromLatin1("description"))));
+ entry->setField(TQString::tqfromLatin1("description"), Tellico::decodeHTML(entry->field(TQString::tqfromLatin1("description"))));
break;
}
@@ -697,26 +697,26 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) {
// also sometimes table fields have rows but no values
Data::FieldVec fields = entry->collection()->fields();
- QRegExp blank(QString::fromLatin1("[\\s:;]+")); // only white space, column separators and row separators
+ TQRegExp blank(TQString::tqfromLatin1("[\\s:;]+")); // only white space, column separators and row separators
for(Data::FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) {
if(fIt->type() != Data::Field::Table) {
continue;
}
if(blank.exactMatch(entry->field(fIt))) {
- entry->setField(fIt, QString::null);
+ entry->setField(fIt, TQString());
}
}
KURL imageURL;
switch(m_imageSize) {
case SmallImage:
- imageURL = entry->field(QString::fromLatin1("small-image"));
+ imageURL = entry->field(TQString::tqfromLatin1("small-image"));
break;
case MediumImage:
- imageURL = entry->field(QString::fromLatin1("medium-image"));
+ imageURL = entry->field(TQString::tqfromLatin1("medium-image"));
break;
case LargeImage:
- imageURL = entry->field(QString::fromLatin1("large-image"));
+ imageURL = entry->field(TQString::tqfromLatin1("large-image"));
break;
case NoImage:
default:
@@ -724,25 +724,25 @@ Tellico::Data::EntryPtr AmazonFetcher::fetchEntry(uint uid_) {
}
// myDebug() << "AmazonFetcher::fetchEntry() - grabbing " << imageURL.prettyURL() << endl;
if(!imageURL.isEmpty()) {
- QString id = ImageFactory::addImage(imageURL, true);
+ TQString id = ImageFactory::addImage(imageURL, true);
// FIXME: need to add cover image field to bibtex collection
if(id.isEmpty()) {
message(i18n("The cover image could not be loaded."), MessageHandler::Warning);
} else { // amazon serves up 1x1 gifs occasionally, but that's caught in the image constructor
// all relevant collection types have cover fields
- entry->setField(QString::fromLatin1("cover"), id);
+ entry->setField(TQString::tqfromLatin1("cover"), id);
}
}
// don't want to show image urls in the fetch dialog
- entry->setField(QString::fromLatin1("small-image"), QString::null);
- entry->setField(QString::fromLatin1("medium-image"), QString::null);
- entry->setField(QString::fromLatin1("large-image"), QString::null);
+ entry->setField(TQString::tqfromLatin1("small-image"), TQString());
+ entry->setField(TQString::tqfromLatin1("medium-image"), TQString());
+ entry->setField(TQString::tqfromLatin1("large-image"), TQString());
return entry;
}
void AmazonFetcher::initXSLTHandler() {
- QString xsltfile = locate("appdata", QString::fromLatin1("amazon2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("amazon2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "AmazonFetcher::initXSLTHandler() - can not locate amazon2tellico.xsl." << endl;
return;
@@ -766,14 +766,14 @@ void AmazonFetcher::updateEntry(Data::EntryPtr entry_) {
int type = entry_->collection()->type();
if(type == Data::Collection::Book || type == Data::Collection::ComicBook || type == Data::Collection::Bibtex) {
- QString isbn = entry_->field(QString::fromLatin1("isbn"));
+ TQString isbn = entry_->field(TQString::tqfromLatin1("isbn"));
if(!isbn.isEmpty()) {
m_limit = 5; // no need for more
search(Fetch::ISBN, isbn);
return;
}
} else if(type == Data::Collection::Album) {
- QString a = entry_->field(QString::fromLatin1("artist"));
+ TQString a = entry_->field(TQString::tqfromLatin1("artist"));
if(!a.isEmpty()) {
search(Fetch::Person, a);
return;
@@ -781,7 +781,7 @@ void AmazonFetcher::updateEntry(Data::EntryPtr entry_) {
}
// optimistically try searching for title and rely on Collection::sameEntry() to figure things out
- QString t = entry_->field(QString::fromLatin1("title"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
if(!t.isEmpty()) {
search(Fetch::Title, t);
return;
@@ -793,10 +793,10 @@ void AmazonFetcher::updateEntry(Data::EntryPtr entry_) {
void AmazonFetcher::parseTitle(Data::EntryPtr entry, int collType) {
Q_UNUSED(collType);
- // assume that everything in brackets or parentheses is extra
- QRegExp rx(QString::fromLatin1("[\\(\\[](.*)[\\)\\]]"));
+ // assume that everything in brackets or tqparentheses is extra
+ TQRegExp rx(TQString::tqfromLatin1("[\\(\\[](.*)[\\)\\]]"));
rx.setMinimal(true);
- QString title = entry->field(QString::fromLatin1("title"));
+ TQString title = entry->field(TQString::tqfromLatin1("title"));
int pos = rx.search(title);
while(pos > -1) {
if(parseTitleToken(entry, rx.cap(1))) {
@@ -805,47 +805,47 @@ void AmazonFetcher::parseTitle(Data::EntryPtr entry, int collType) {
}
pos = rx.search(title, pos+1);
}
- entry->setField(QString::fromLatin1("title"), title.stripWhiteSpace());
+ entry->setField(TQString::tqfromLatin1("title"), title.stripWhiteSpace());
}
-bool AmazonFetcher::parseTitleToken(Data::EntryPtr entry, const QString& token) {
+bool AmazonFetcher::parseTitleToken(Data::EntryPtr entry, const TQString& token) {
// if res = true, then the token gets removed from the title
bool res = false;
- if(token.find(QString::fromLatin1("widescreen"), 0, false /* case-insensitive*/) > -1 ||
- token.find(i18n("Widescreen"), 0, false) > -1) {
- entry->setField(QString::fromLatin1("widescreen"), QString::fromLatin1("true"));
+ if(token.tqfind(TQString::tqfromLatin1("widescreen"), 0, false /* case-insensitive*/) > -1 ||
+ token.tqfind(i18n("Widescreen"), 0, false) > -1) {
+ entry->setField(TQString::tqfromLatin1("widescreen"), TQString::tqfromLatin1("true"));
// res = true; leave it in the title
- } else if(token.find(QString::fromLatin1("full screen"), 0, false) > -1) {
+ } else if(token.tqfind(TQString::tqfromLatin1("full screen"), 0, false) > -1) {
// skip, but go ahead and remove from title
res = true;
}
- if(token.find(QString::fromLatin1("blu-ray"), 0, false) > -1) {
- entry->setField(QString::fromLatin1("medium"), i18n("Blu-ray"));
+ if(token.tqfind(TQString::tqfromLatin1("blu-ray"), 0, false) > -1) {
+ entry->setField(TQString::tqfromLatin1("medium"), i18n("Blu-ray"));
res = true;
- } else if(token.find(QString::fromLatin1("hd dvd"), 0, false) > -1) {
- entry->setField(QString::fromLatin1("medium"), i18n("HD DVD"));
+ } else if(token.tqfind(TQString::tqfromLatin1("hd dvd"), 0, false) > -1) {
+ entry->setField(TQString::tqfromLatin1("medium"), i18n("HD DVD"));
res = true;
}
- if(token.find(QString::fromLatin1("director's cut"), 0, false) > -1 ||
- token.find(i18n("Director's Cut"), 0, false) > -1) {
- entry->setField(QString::fromLatin1("directors-cut"), QString::fromLatin1("true"));
+ if(token.tqfind(TQString::tqfromLatin1("director's cut"), 0, false) > -1 ||
+ token.tqfind(i18n("Director's Cut"), 0, false) > -1) {
+ entry->setField(TQString::tqfromLatin1("directors-cut"), TQString::tqfromLatin1("true"));
// res = true; leave it in the title
}
return res;
}
-Tellico::Fetch::ConfigWidget* AmazonFetcher::configWidget(QWidget* parent_) const {
- return new AmazonFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* AmazonFetcher::configWidget(TQWidget* tqparent_) const {
+ return new AmazonFetcher::ConfigWidget(tqparent_, this);
}
-AmazonFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const AmazonFetcher* fetcher_/*=0*/)
- : Fetch::ConfigWidget(parent_) {
- QGridLayout* l = new QGridLayout(optionsWidget(), 4, 2);
+AmazonFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const AmazonFetcher* fetcher_/*=0*/)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQGridLayout* l = new TQGridLayout(optionsWidget(), 4, 2);
l->setSpacing(4);
l->setColStretch(1, 10);
int row = -1;
- QLabel* label = new QLabel(i18n("Co&untry: "), optionsWidget());
+ TQLabel* label = new TQLabel(i18n("Co&untry: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_siteCombo = new GUI::ComboBox(optionsWidget());
m_siteCombo->insertItem(i18n("United States"), US);
@@ -854,39 +854,39 @@ AmazonFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const AmazonFetcher*
m_siteCombo->insertItem(i18n("Japan"), JP);
m_siteCombo->insertItem(i18n("France"), FR);
m_siteCombo->insertItem(i18n("Canada"), CA);
- connect(m_siteCombo, SIGNAL(activated(int)), SLOT(slotSetModified()));
- connect(m_siteCombo, SIGNAL(activated(int)), SLOT(slotSiteChanged()));
+ connect(m_siteCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetModified()));
+ connect(m_siteCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSiteChanged()));
l->addWidget(m_siteCombo, row, 1);
- QString w = i18n("Amazon.com provides data from several different localized sites. Choose the one "
+ TQString w = i18n("Amazon.com provides data from several different localized sites. Choose the one "
"you wish to use for this data source.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_siteCombo, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_siteCombo, w);
label->setBuddy(m_siteCombo);
- label = new QLabel(i18n("&Image size: "), optionsWidget());
+ label = new TQLabel(i18n("&Image size: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_imageCombo = new GUI::ComboBox(optionsWidget());
m_imageCombo->insertItem(i18n("Small Image"), SmallImage);
m_imageCombo->insertItem(i18n("Medium Image"), MediumImage);
m_imageCombo->insertItem(i18n("Large Image"), LargeImage);
m_imageCombo->insertItem(i18n("No Image"), NoImage);
- connect(m_imageCombo, SIGNAL(activated(int)), SLOT(slotSetModified()));
+ connect(m_imageCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetModified()));
l->addWidget(m_imageCombo, row, 1);
w = i18n("The cover image may be downloaded as well. However, too many large images in the "
"collection may degrade performance.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_imageCombo, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_imageCombo, w);
label->setBuddy(m_imageCombo);
- label = new QLabel(i18n("&Associate's ID: "), optionsWidget());
+ label = new TQLabel(i18n("&Associate's ID: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_assocEdit = new KLineEdit(optionsWidget());
- connect(m_assocEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ connect(m_assocEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_assocEdit, row, 1);
w = i18n("The associate's id identifies the person accessing the Amazon.com Web Services, and is included "
"in any links to the Amazon.com site.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_assocEdit, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_assocEdit, w);
label->setBuddy(m_assocEdit);
l->setRowStretch(++row, 10);
@@ -896,11 +896,11 @@ AmazonFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const AmazonFetcher*
m_assocEdit->setText(fetcher_->m_assoc);
m_imageCombo->setCurrentData(fetcher_->m_imageSize);
} else { // defaults
- m_assocEdit->setText(QString::fromLatin1(AMAZON_ASSOC_TOKEN));
+ m_assocEdit->setText(TQString::tqfromLatin1(AMAZON_ASSOC_TOKEN));
m_imageCombo->setCurrentData(MediumImage);
}
- addFieldsWidget(AmazonFetcher::customFields(), fetcher_ ? fetcher_->m_fields : QStringList());
+ addFieldsWidget(AmazonFetcher::customFields(), fetcher_ ? fetcher_->m_fields : TQStringList());
KAcceleratorManager::manage(optionsWidget());
}
@@ -908,7 +908,7 @@ AmazonFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const AmazonFetcher*
void AmazonFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
int n = m_siteCombo->currentData().toInt();
config_.writeEntry("Site", n);
- QString s = m_assocEdit->text().stripWhiteSpace();
+ TQString s = m_assocEdit->text().stripWhiteSpace();
if(!s.isEmpty()) {
config_.writeEntry("AssocToken", s);
}
@@ -919,7 +919,7 @@ void AmazonFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
slotSetModified(false);
}
-QString AmazonFetcher::ConfigWidget::preferredName() const {
+TQString AmazonFetcher::ConfigWidget::preferredName() const {
return AmazonFetcher::siteData(m_siteCombo->currentData().toInt()).title;
}
@@ -930,7 +930,7 @@ void AmazonFetcher::ConfigWidget::slotSiteChanged() {
//static
Tellico::StringMap AmazonFetcher::customFields() {
StringMap map;
- map[QString::fromLatin1("keyword")] = i18n("Keywords");
+ map[TQString::tqfromLatin1("keyword")] = i18n("Keywords");
return map;
}
diff --git a/src/fetch/amazonfetcher.h b/src/fetch/amazonfetcher.h
index 05df8d7..ed7b97a 100644
--- a/src/fetch/amazonfetcher.h
+++ b/src/fetch/amazonfetcher.h
@@ -20,13 +20,13 @@
#include <kurl.h>
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
class KLineEdit;
-class QCheckBox;
-class QLabel;
+class TQCheckBox;
+class TQLabel;
namespace KIO {
class Job;
@@ -48,6 +48,7 @@ namespace Tellico {
*/
class AmazonFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
enum Site {
@@ -67,12 +68,12 @@ public:
NoImage=3
};
- AmazonFetcher(Site site, QObject* parent, const char* name = 0);
+ AmazonFetcher(Site site, TQObject* tqparent, const char* name = 0);
virtual ~AmazonFetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void continueSearch();
// amazon can search title, person, isbn, or keyword. No Raw for now.
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person || k == ISBN || k == UPC || k == Keyword; }
@@ -85,7 +86,7 @@ public:
virtual void updateEntry(Data::EntryPtr entry);
struct SiteData {
- QString title;
+ TQString title;
KURL url;
};
static const SiteData& siteData(int site);
@@ -93,56 +94,57 @@ public:
/**
* Returns a widget for modifying the fetcher's config.
*/
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const ;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const ;
static StringMap customFields();
class ConfigWidget;
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
void initXSLTHandler();
void doSearch();
void parseTitle(Data::EntryPtr entry, int collType);
- bool parseTitleToken(Data::EntryPtr entry, const QString& token);
+ bool parseTitleToken(Data::EntryPtr entry, const TQString& token);
XSLTHandler* m_xsltHandler;
Site m_site;
ImageSize m_imageSize;
- QString m_access;
- QString m_assoc;
+ TQString m_access;
+ TQString m_assoc;
bool m_addLinkField;
int m_limit;
int m_countOffset;
- QByteArray m_data;
+ TQByteArray m_data;
int m_page;
int m_total;
int m_numResults;
- QMap<int, Data::EntryPtr> m_entries; // they get modified after collection is created, so can't be const
- QGuardedPtr<KIO::Job> m_job;
+ TQMap<int, Data::EntryPtr> m_entries; // they get modified after collection is created, so can't be const
+ TQGuardedPtr<KIO::Job> m_job;
FetchKey m_key;
- QString m_value;
+ TQString m_value;
bool m_started;
- QStringList m_fields;
+ TQStringList m_fields;
};
class AmazonFetcher::ConfigWidget : public Fetch::ConfigWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- ConfigWidget(QWidget* parent_, const AmazonFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent_, const AmazonFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup& config);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
private slots:
void slotSiteChanged();
diff --git a/src/fetch/animenfofetcher.cpp b/src/fetch/animenfofetcher.cpp
index 728c583..3a93281 100644
--- a/src/fetch/animenfofetcher.cpp
+++ b/src/fetch/animenfofetcher.cpp
@@ -26,10 +26,10 @@
#include <kconfig.h>
#include <kio/job.h>
-#include <qregexp.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qfile.h>
+#include <tqregexp.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqfile.h>
//#define ANIMENFO_TEST
@@ -39,15 +39,15 @@ namespace {
using Tellico::Fetch::AnimeNfoFetcher;
-AnimeNfoFetcher::AnimeNfoFetcher(QObject* parent_, const char* name_ /*=0*/)
- : Fetcher(parent_, name_), m_started(false) {
+AnimeNfoFetcher::AnimeNfoFetcher(TQObject* tqparent_, const char* name_ /*=0*/)
+ : Fetcher(tqparent_, name_), m_started(false) {
}
-QString AnimeNfoFetcher::defaultName() {
- return QString::fromLatin1("AnimeNfo.com");
+TQString AnimeNfoFetcher::defaultName() {
+ return TQString::tqfromLatin1("AnimeNfo.com");
}
-QString AnimeNfoFetcher::source() const {
+TQString AnimeNfoFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -59,27 +59,27 @@ void AnimeNfoFetcher::readConfigHook(const KConfigGroup& config_) {
Q_UNUSED(config_);
}
-void AnimeNfoFetcher::search(FetchKey key_, const QString& value_) {
+void AnimeNfoFetcher::search(FetchKey key_, const TQString& value_) {
m_started = true;
m_matches.clear();
#ifdef ANIMENFO_TEST
- KURL u = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/animenfo.html"));
+ KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/animenfo.html"));
#else
- KURL u(QString::fromLatin1(ANIMENFO_BASE_URL));
- u.addQueryItem(QString::fromLatin1("action"), QString::fromLatin1("Go"));
- u.addQueryItem(QString::fromLatin1("option"), QString::fromLatin1("keywords"));
- u.addQueryItem(QString::fromLatin1("queryin"), QString::fromLatin1("anime_titles"));
+ KURL u(TQString::tqfromLatin1(ANIMENFO_BASE_URL));
+ u.addQueryItem(TQString::tqfromLatin1("action"), TQString::tqfromLatin1("Go"));
+ u.addQueryItem(TQString::tqfromLatin1("option"), TQString::tqfromLatin1("keywords"));
+ u.addQueryItem(TQString::tqfromLatin1("queryin"), TQString::tqfromLatin1("anime_titles"));
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
switch(key_) {
case Keyword:
- u.addQueryItem(QString::fromLatin1("query"), value_);
+ u.addQueryItem(TQString::tqfromLatin1("query"), value_);
break;
default:
@@ -91,10 +91,10 @@ void AnimeNfoFetcher::search(FetchKey key_, const QString& value_) {
// myDebug() << "AnimeNfoFetcher::search() - url: " << u.url() << endl;
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void AnimeNfoFetcher::stop() {
@@ -111,8 +111,8 @@ void AnimeNfoFetcher::stop() {
emit signalDone(this);
}
-void AnimeNfoFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void AnimeNfoFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -133,28 +133,28 @@ void AnimeNfoFetcher::slotComplete(KIO::Job* job_) {
return;
}
- QString s = Tellico::decodeHTML(QString(m_data));
+ TQString s = Tellico::decodeHTML(TQString(m_data));
- QRegExp infoRx(QString::fromLatin1("<td\\s+[^>]*class\\s*=\\s*[\"']anime_info[\"'][^>]*>(.*)</td>"), false);
+ TQRegExp infoRx(TQString::tqfromLatin1("<td\\s+[^>]*class\\s*=\\s*[\"']anime_info[\"'][^>]*>(.*)</td>"), false);
infoRx.setMinimal(true);
- QRegExp anchorRx(QString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](.*)[\"'][^>]*>(.*)</a>"), false);
+ TQRegExp anchorRx(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](.*)[\"'][^>]*>(.*)</a>"), false);
anchorRx.setMinimal(true);
- QRegExp yearRx(QString::fromLatin1("\\d{4}"), false);
+ TQRegExp yearRx(TQString::tqfromLatin1("\\d{4}"), false);
// search page comes in groups of threes
int n = 0;
- QString u, t, y;
+ TQString u, t, y;
for(int pos = infoRx.search(s); m_started && pos > -1; pos = infoRx.search(s, pos+1)) {
if(n == 0 && !u.isEmpty()) {
- SearchResult* r = new SearchResult(this, t, y, QString());
+ SearchResult* r = new SearchResult(this, t, y, TQString());
emit signalResultFound(r);
#ifdef ANIMENFO_TEST
- KURL url = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/animetitle.html"));
+ KURL url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/animetitle.html"));
#else
- KURL url(QString::fromLatin1(ANIMENFO_BASE_URL), u);
- url.setQuery(QString::null);
+ KURL url(TQString::tqfromLatin1(ANIMENFO_BASE_URL), u);
+ url.setQuery(TQString());
#endif
m_matches.insert(r->uid, url);
@@ -187,10 +187,10 @@ void AnimeNfoFetcher::slotComplete(KIO::Job* job_) {
// grab last response
#ifndef ANIMENFO_TEST
if(!u.isEmpty()) {
- SearchResult* r = new SearchResult(this, t, y, QString());
+ SearchResult* r = new SearchResult(this, t, y, TQString());
emit signalResultFound(r);
- KURL url(QString::fromLatin1(ANIMENFO_BASE_URL), u);
- url.setQuery(QString::null);
+ KURL url(TQString::tqfromLatin1(ANIMENFO_BASE_URL), u);
+ url.setQuery(TQString());
m_matches.insert(r->uid, url);
}
#endif
@@ -210,7 +210,7 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::fetchEntry(uint uid_) {
return 0;
}
- QString results = Tellico::decodeHTML(FileHandler::readTextFile(url, true));
+ TQString results = Tellico::decodeHTML(FileHandler::readTextFile(url, true));
if(results.isEmpty()) {
myDebug() << "AnimeNfoFetcher::fetchEntry() - no text results" << endl;
return 0;
@@ -218,10 +218,10 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::fetchEntry(uint uid_) {
#if 0
kdWarning() << "Remove debug from animenfofetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test.html"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.html"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
t << results;
}
f.close();
@@ -236,64 +236,64 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::fetchEntry(uint uid_) {
return entry;
}
-Tellico::Data::EntryPtr AnimeNfoFetcher::parseEntry(const QString& str_) {
+Tellico::Data::EntryPtr AnimeNfoFetcher::parseEntry(const TQString& str_) {
// myDebug() << "AnimeNfoFetcher::parseEntry()" << endl;
// class might be anime_info_top
- QRegExp infoRx(QString::fromLatin1("<td\\s+[^>]*class\\s*=\\s*[\"']anime_info[^>]*>(.*)</td>"), false);
+ TQRegExp infoRx(TQString::tqfromLatin1("<td\\s+[^>]*class\\s*=\\s*[\"']anime_info[^>]*>(.*)</td>"), false);
infoRx.setMinimal(true);
- QRegExp tagRx(QString::fromLatin1("<.*>"));
+ TQRegExp tagRx(TQString::tqfromLatin1("<.*>"));
tagRx.setMinimal(true);
- QRegExp anchorRx(QString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](.*)[\"'][^>]*>(.*)</a>"), false);
+ TQRegExp anchorRx(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](.*)[\"'][^>]*>(.*)</a>"), false);
anchorRx.setMinimal(true);
- QRegExp jsRx(QString::fromLatin1("<script.*</script>"), false);
+ TQRegExp jsRx(TQString::tqfromLatin1("<script.*</script>"), false);
jsRx.setMinimal(true);
- QString s = str_;
+ TQString s = str_;
s.remove(jsRx);
Data::CollPtr coll = new Data::VideoCollection(true);
// add new fields
- Data::FieldPtr f = new Data::Field(QString::fromLatin1("origtitle"), i18n("Original Title"));
+ Data::FieldPtr f = new Data::Field(TQString::tqfromLatin1("origtitle"), i18n("Original Title"));
coll->addField(f);
- f = new Data::Field(QString::fromLatin1("alttitle"), i18n("Alternative Titles"), Data::Field::Table);
+ f = new Data::Field(TQString::tqfromLatin1("alttitle"), i18n("Alternative Titles"), Data::Field::Table);
f->setFormatFlag(Data::Field::FormatTitle);
coll->addField(f);
- f = new Data::Field(QString::fromLatin1("distributor"), i18n("Distributor"));
+ f = new Data::Field(TQString::tqfromLatin1("distributor"), i18n("Distributor"));
f->setCategory(i18n("Other People"));
f->setFlags(Data::Field::AllowCompletion | Data::Field::AllowMultiple | Data::Field::AllowGrouped);
f->setFormatFlag(Data::Field::FormatPlain);
coll->addField(f);
- f = new Data::Field(QString::fromLatin1("episodes"), i18n("Episodes"), Data::Field::Number);
+ f = new Data::Field(TQString::tqfromLatin1("episodes"), i18n("Episodes"), Data::Field::Number);
f->setCategory(i18n("Features"));
coll->addField(f);
// map captions in HTML to field names
- QMap<QString, QString> fieldMap;
- fieldMap.insert(QString::fromLatin1("Title"), QString::fromLatin1("title"));
- fieldMap.insert(QString::fromLatin1("Japanese Title"), QString::fromLatin1("origtitle"));
- fieldMap.insert(QString::fromLatin1("Total Episodes"), QString::fromLatin1("episodes"));
- fieldMap.insert(QString::fromLatin1("Genres"), QString::fromLatin1("genre"));
- fieldMap.insert(QString::fromLatin1("Year Published"), QString::fromLatin1("year"));
- fieldMap.insert(QString::fromLatin1("Studio"), QString::fromLatin1("studio"));
- fieldMap.insert(QString::fromLatin1("US Distribution"), QString::fromLatin1("distributor"));
+ TQMap<TQString, TQString> fieldMap;
+ fieldMap.insert(TQString::tqfromLatin1("Title"), TQString::tqfromLatin1("title"));
+ fieldMap.insert(TQString::tqfromLatin1("Japanese Title"), TQString::tqfromLatin1("origtitle"));
+ fieldMap.insert(TQString::tqfromLatin1("Total Episodes"), TQString::tqfromLatin1("episodes"));
+ fieldMap.insert(TQString::tqfromLatin1("Genres"), TQString::tqfromLatin1("genre"));
+ fieldMap.insert(TQString::tqfromLatin1("Year Published"), TQString::tqfromLatin1("year"));
+ fieldMap.insert(TQString::tqfromLatin1("Studio"), TQString::tqfromLatin1("studio"));
+ fieldMap.insert(TQString::tqfromLatin1("US Distribution"), TQString::tqfromLatin1("distributor"));
Data::EntryPtr entry = new Data::Entry(coll);
int n = 0;
- QString key, value;
+ TQString key, value;
int oldpos = -1;
for(int pos = infoRx.search(s); pos > -1; pos = infoRx.search(s, pos+1)) {
if(n == 0 && !key.isEmpty()) {
- if(fieldMap.contains(key)) {
+ if(fieldMap.tqcontains(key)) {
value = value.simplifyWhiteSpace();
if(value.length() > 2) { // might be "-"
if(key == Latin1Literal("Genres")) {
- entry->setField(fieldMap[key], QStringList::split(QRegExp(QString::fromLatin1("\\s*,\\s*")),
- value).join(QString::fromLatin1("; ")));
+ entry->setField(fieldMap[key], TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s*,\\s*")),
+ value).join(TQString::tqfromLatin1("; ")));
} else {
entry->setField(fieldMap[key], value);
}
@@ -315,44 +315,44 @@ Tellico::Data::EntryPtr AnimeNfoFetcher::parseEntry(const QString& str_) {
}
// image
- QRegExp imgRx(QString::fromLatin1("<img\\s+[^>]*src\\s*=\\s*[\"']([^>]*)[\"']\\s+[^>]*alt\\s*=\\s*[\"']%1[\"']")
- .arg(entry->field(QString::fromLatin1("title"))), false);
+ TQRegExp imgRx(TQString::tqfromLatin1("<img\\s+[^>]*src\\s*=\\s*[\"']([^>]*)[\"']\\s+[^>]*alt\\s*=\\s*[\"']%1[\"']")
+ .tqarg(entry->field(TQString::tqfromLatin1("title"))), false);
imgRx.setMinimal(true);
int pos = imgRx.search(s);
if(pos > -1) {
- KURL imgURL(QString::fromLatin1(ANIMENFO_BASE_URL), imgRx.cap(1));
- QString id = ImageFactory::addImage(imgURL, true);
+ KURL imgURL(TQString::tqfromLatin1(ANIMENFO_BASE_URL), imgRx.cap(1));
+ TQString id = ImageFactory::addImage(imgURL, true);
if(!id.isEmpty()) {
- entry->setField(QString::fromLatin1("cover"), id);
+ entry->setField(TQString::tqfromLatin1("cover"), id);
}
}
// now look for alternative titles and plot
- const QString a = QString::fromLatin1("Alternative titles");
- pos = s.find(a, oldpos+1, false);
+ const TQString a = TQString::tqfromLatin1("Alternative titles");
+ pos = s.tqfind(a, oldpos+1, false);
if(pos > -1) {
pos += a.length();
}
int pos2 = -1;
if(pos > -1) {
- pos2 = s.find(QString::fromLatin1("Description"), pos+1, true);
+ pos2 = s.tqfind(TQString::tqfromLatin1("Description"), pos+1, true);
if(pos2 > -1) {
value = s.mid(pos, pos2-pos).remove(tagRx).simplifyWhiteSpace();
- entry->setField(QString::fromLatin1("alttitle"), value);
+ entry->setField(TQString::tqfromLatin1("alttitle"), value);
}
}
- QRegExp descRx(QString::fromLatin1("class\\s*=\\s*[\"']description[\"'][^>]*>(.*)<"), false);
+ TQRegExp descRx(TQString::tqfromLatin1("class\\s*=\\s*[\"']description[\"'][^>]*>(.*)<"), false);
descRx.setMinimal(true);
- pos = descRx.search(s, QMAX(pos, pos2));
+ pos = descRx.search(s, TQMAX(pos, pos2));
if(pos > -1) {
- entry->setField(QString::fromLatin1("plot"), descRx.cap(1).simplifyWhiteSpace());
+ entry->setField(TQString::tqfromLatin1("plot"), descRx.cap(1).simplifyWhiteSpace());
}
return entry;
}
void AnimeNfoFetcher::updateEntry(Data::EntryPtr entry_) {
- QString t = entry_->field(QString::fromLatin1("title"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
if(!t.isEmpty()) {
search(Fetch::Keyword, t);
return;
@@ -360,18 +360,18 @@ void AnimeNfoFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* AnimeNfoFetcher::configWidget(QWidget* parent_) const {
- return new AnimeNfoFetcher::ConfigWidget(parent_);
+Tellico::Fetch::ConfigWidget* AnimeNfoFetcher::configWidget(TQWidget* tqparent_) const {
+ return new AnimeNfoFetcher::ConfigWidget(tqparent_);
}
-AnimeNfoFetcher::ConfigWidget::ConfigWidget(QWidget* parent_)
- : Fetch::ConfigWidget(parent_) {
- QVBoxLayout* l = new QVBoxLayout(optionsWidget());
- l->addWidget(new QLabel(i18n("This source has no options."), optionsWidget()));
+AnimeNfoFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQVBoxLayout* l = new TQVBoxLayout(optionsWidget());
+ l->addWidget(new TQLabel(i18n("This source has no options."), optionsWidget()));
l->addStretch();
}
-QString AnimeNfoFetcher::ConfigWidget::preferredName() const {
+TQString AnimeNfoFetcher::ConfigWidget::preferredName() const {
return AnimeNfoFetcher::defaultName();
}
diff --git a/src/fetch/animenfofetcher.h b/src/fetch/animenfofetcher.h
index 7e4028e..df43b87 100644
--- a/src/fetch/animenfofetcher.h
+++ b/src/fetch/animenfofetcher.h
@@ -17,8 +17,8 @@
#include "fetcher.h"
#include "configwidget.h"
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
namespace KIO {
class Job;
@@ -34,14 +34,15 @@ namespace Tellico {
*/
class AnimeNfoFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- AnimeNfoFetcher(QObject* parent, const char* name = 0);
+ AnimeNfoFetcher(TQObject* tqparent, const char* name = 0);
virtual ~AnimeNfoFetcher() {}
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
// only keyword search
virtual bool canSearch(FetchKey k) const { return k == Keyword; }
virtual void stop();
@@ -52,33 +53,33 @@ public:
virtual void updateEntry(Data::EntryPtr entry);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_);
+ ConfigWidget(TQWidget* tqparent_);
virtual void saveConfig(KConfigGroup&) {}
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
- Data::EntryPtr parseEntry(const QString& str);
+ Data::EntryPtr parseEntry(const TQString& str);
- QByteArray m_data;
+ TQByteArray m_data;
int m_total;
- QMap<int, Data::EntryPtr> m_entries;
- QMap<int, KURL> m_matches;
- QGuardedPtr<KIO::Job> m_job;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQMap<int, KURL> m_matches;
+ TQGuardedPtr<KIO::Job> m_job;
bool m_started;
-// QStringList m_fields;
+// TQStringList m_fields;
};
} // end namespace
diff --git a/src/fetch/arxivfetcher.cpp b/src/fetch/arxivfetcher.cpp
index 442ef30..b176d88 100644
--- a/src/fetch/arxivfetcher.cpp
+++ b/src/fetch/arxivfetcher.cpp
@@ -27,9 +27,9 @@
#include <kstandarddirs.h>
#include <kconfig.h>
-#include <qdom.h>
-#include <qlabel.h>
-#include <qlayout.h>
+#include <tqdom.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
//#define ARXIV_TEST
@@ -40,8 +40,8 @@ namespace {
using Tellico::Fetch::ArxivFetcher;
-ArxivFetcher::ArxivFetcher(QObject* parent_)
- : Fetcher(parent_), m_xsltHandler(0), m_start(0), m_job(0), m_started(false) {
+ArxivFetcher::ArxivFetcher(TQObject* tqparent_)
+ : Fetcher(tqparent_), m_xsltHandler(0), m_start(0), m_job(0), m_started(false) {
}
ArxivFetcher::~ArxivFetcher() {
@@ -49,11 +49,11 @@ ArxivFetcher::~ArxivFetcher() {
m_xsltHandler = 0;
}
-QString ArxivFetcher::defaultName() {
+TQString ArxivFetcher::defaultName() {
return i18n("arXiv.org");
}
-QString ArxivFetcher::source() const {
+TQString ArxivFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -64,7 +64,7 @@ bool ArxivFetcher::canFetch(int type) const {
void ArxivFetcher::readConfigHook(const KConfigGroup&) {
}
-void ArxivFetcher::search(FetchKey key_, const QString& value_) {
+void ArxivFetcher::search(FetchKey key_, const TQString& value_) {
m_key = key_;
m_value = value_.stripWhiteSpace();
m_started = true;
@@ -80,7 +80,7 @@ void ArxivFetcher::continueSearch() {
void ArxivFetcher::doSearch() {
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
@@ -96,10 +96,10 @@ void ArxivFetcher::doSearch() {
}
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void ArxivFetcher::stop() {
@@ -116,8 +116,8 @@ void ArxivFetcher::stop() {
emit signalDone(this);
}
-void ArxivFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void ArxivFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -140,11 +140,11 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from arxivfetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
- t << QCString(m_data, m_data.size()+1);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
+ t << TQCString(m_data, m_data.size()+1);
}
f.close();
#endif
@@ -158,21 +158,21 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) {
}
if(m_total == -1) {
- QDomDocument dom;
+ TQDomDocument dom;
if(!dom.setContent(m_data, true /*namespace*/)) {
kdWarning() << "ArxivFetcher::slotComplete() - server did not return valid XML." << endl;
return;
}
// total is top level element, with attribute totalResultsAvailable
- QDomNodeList list = dom.elementsByTagNameNS(QString::fromLatin1("http://a9.com/-/spec/opensearch/1.1/"),
- QString::fromLatin1("totalResults"));
+ TQDomNodeList list = dom.elementsByTagNameNS(TQString::tqfromLatin1("http://a9.com/-/spec/opensearch/1.1/"),
+ TQString::tqfromLatin1("totalResults"));
if(list.count() > 0) {
m_total = list.item(0).toElement().text().toInt();
}
}
// assume result is always utf-8
- QString str = m_xsltHandler->applyStylesheet(QString::fromUtf8(m_data, m_data.size()));
+ TQString str = m_xsltHandler->applyStylesheet(TQString::fromUtf8(m_data, m_data.size()));
Import::TellicoImporter imp(str);
Data::CollPtr coll = imp.collection();
@@ -188,13 +188,13 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- QString desc = entry->field(QString::fromLatin1("author"))
- + QChar('/') + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("year"));
+ TQString desc = entry->field(TQString::tqfromLatin1("author"))
+ + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year"));
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
}
@@ -207,19 +207,19 @@ void ArxivFetcher::slotComplete(KIO::Job* job_) {
Tellico::Data::EntryPtr ArxivFetcher::fetchEntry(uint uid_) {
Data::EntryPtr entry = m_entries[uid_];
// if URL but no cover image, fetch it
- if(!entry->field(QString::fromLatin1("url")).isEmpty()) {
+ if(!entry->field(TQString::tqfromLatin1("url")).isEmpty()) {
Data::CollPtr coll = entry->collection();
- Data::FieldPtr field = coll->fieldByName(QString::fromLatin1("cover"));
+ Data::FieldPtr field = coll->fieldByName(TQString::tqfromLatin1("cover"));
if(!field && !coll->imageFields().isEmpty()) {
field = coll->imageFields().front();
} else if(!field) {
- field = new Data::Field(QString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
+ field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
coll->addField(field);
}
if(entry->field(field).isEmpty()) {
- QPixmap pix = NetAccess::filePreview(entry->field(QString::fromLatin1("url")));
+ TQPixmap pix = NetAccess::filePreview(entry->field(TQString::tqfromLatin1("url")));
if(!pix.isNull()) {
- QString id = ImageFactory::addImage(pix, QString::fromLatin1("PNG"));
+ TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG"));
if(!id.isEmpty()) {
entry->setField(field, id);
}
@@ -230,7 +230,7 @@ Tellico::Data::EntryPtr ArxivFetcher::fetchEntry(uint uid_) {
}
void ArxivFetcher::initXSLTHandler() {
- QString xsltfile = locate("appdata", QString::fromLatin1("arxiv2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("arxiv2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "ArxivFetcher::initXSLTHandler() - can not locate arxiv2tellico.xsl." << endl;
return;
@@ -249,34 +249,34 @@ void ArxivFetcher::initXSLTHandler() {
}
}
-KURL ArxivFetcher::searchURL(FetchKey key_, const QString& value_) const {
- KURL u(QString::fromLatin1(ARXIV_BASE_URL));
- u.addQueryItem(QString::fromLatin1("start"), QString::number(m_start));
- u.addQueryItem(QString::fromLatin1("max_results"), QString::number(ARXIV_RETURNS_PER_REQUEST));
+KURL ArxivFetcher::searchURL(FetchKey key_, const TQString& value_) const {
+ KURL u(TQString::tqfromLatin1(ARXIV_BASE_URL));
+ u.addQueryItem(TQString::tqfromLatin1("start"), TQString::number(m_start));
+ u.addQueryItem(TQString::tqfromLatin1("max_results"), TQString::number(ARXIV_RETURNS_PER_REQUEST));
// quotes should be used if spaces are present, just use all the time
- QString quotedValue = '"' + value_ + '"';
+ TQString quotedValue = '"' + value_ + '"';
switch(key_) {
case Title:
- u.addQueryItem(QString::fromLatin1("search_query"), QString::fromLatin1("ti:%1").arg(quotedValue));
+ u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("ti:%1").tqarg(quotedValue));
break;
case Person:
- u.addQueryItem(QString::fromLatin1("search_query"), QString::fromLatin1("au:%1").arg(quotedValue));
+ u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("au:%1").tqarg(quotedValue));
break;
case Keyword:
// keyword gets to use all the words without being quoted
- u.addQueryItem(QString::fromLatin1("search_query"), QString::fromLatin1("all:%1").arg(value_));
+ u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("all:%1").tqarg(value_));
break;
case ArxivID:
{
// remove prefix and/or version number
- QString value = value_;
- value.remove(QRegExp(QString::fromLatin1("^arxiv:"), false));
- value.remove(QRegExp(QString::fromLatin1("v\\d+$")));
- u.addQueryItem(QString::fromLatin1("search_query"), QString::fromLatin1("id:%1").arg(value));
+ TQString value = value_;
+ value.remove(TQRegExp(TQString::tqfromLatin1("^arxiv:"), false));
+ value.remove(TQRegExp(TQString::tqfromLatin1("v\\d+$")));
+ u.addQueryItem(TQString::tqfromLatin1("search_query"), TQString::tqfromLatin1("id:%1").tqarg(value));
}
break;
@@ -286,21 +286,21 @@ KURL ArxivFetcher::searchURL(FetchKey key_, const QString& value_) const {
}
#ifdef ARXIV_TEST
- u = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/arxiv.xml"));
+ u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/arxiv.xml"));
#endif
myDebug() << "ArxivFetcher::search() - url: " << u.url() << endl;
return u;
}
void ArxivFetcher::updateEntry(Data::EntryPtr entry_) {
- QString id = entry_->field(QString::fromLatin1("arxiv"));
+ TQString id = entry_->field(TQString::tqfromLatin1("arxiv"));
if(!id.isEmpty()) {
search(Fetch::ArxivID, id);
return;
}
// optimistically try searching for title and rely on Collection::sameEntry() to figure things out
- QString t = entry_->field(QString::fromLatin1("title"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
if(!t.isEmpty()) {
search(Fetch::Title, t);
return;
@@ -314,13 +314,13 @@ void ArxivFetcher::updateEntrySynchronous(Data::EntryPtr entry) {
if(!entry) {
return;
}
- QString arxiv = entry->field(QString::fromLatin1("arxiv"));
+ TQString arxiv = entry->field(TQString::tqfromLatin1("arxiv"));
if(arxiv.isEmpty()) {
return;
}
KURL u = searchURL(ArxivID, arxiv);
- QString xml = FileHandler::readTextFile(u, true, true);
+ TQString xml = FileHandler::readTextFile(u, true, true);
if(xml.isEmpty()) {
return;
}
@@ -333,33 +333,33 @@ void ArxivFetcher::updateEntrySynchronous(Data::EntryPtr entry) {
}
// assume result is always utf-8
- QString str = m_xsltHandler->applyStylesheet(xml);
+ TQString str = m_xsltHandler->applyStylesheet(xml);
Import::TellicoImporter imp(str);
Data::CollPtr coll = imp.collection();
if(coll && coll->entryCount() > 0) {
myLog() << "ArxivFetcher::updateEntrySynchronous() - found Arxiv result, merging" << endl;
Data::Collection::mergeEntry(entry, coll->entries().front(), false /*overwrite*/);
// the arxiv id might have a version#
- entry->setField(QString::fromLatin1("arxiv"),
- coll->entries().front()->field(QString::fromLatin1("arxiv")));
+ entry->setField(TQString::tqfromLatin1("arxiv"),
+ coll->entries().front()->field(TQString::tqfromLatin1("arxiv")));
}
}
-Tellico::Fetch::ConfigWidget* ArxivFetcher::configWidget(QWidget* parent_) const {
- return new ArxivFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* ArxivFetcher::configWidget(TQWidget* tqparent_) const {
+ return new ArxivFetcher::ConfigWidget(tqparent_, this);
}
-ArxivFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const ArxivFetcher*)
- : Fetch::ConfigWidget(parent_) {
- QVBoxLayout* l = new QVBoxLayout(optionsWidget());
- l->addWidget(new QLabel(i18n("This source has no options."), optionsWidget()));
+ArxivFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const ArxivFetcher*)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQVBoxLayout* l = new TQVBoxLayout(optionsWidget());
+ l->addWidget(new TQLabel(i18n("This source has no options."), optionsWidget()));
l->addStretch();
}
void ArxivFetcher::ConfigWidget::saveConfig(KConfigGroup&) {
}
-QString ArxivFetcher::ConfigWidget::preferredName() const {
+TQString ArxivFetcher::ConfigWidget::preferredName() const {
return ArxivFetcher::defaultName();
}
diff --git a/src/fetch/arxivfetcher.h b/src/fetch/arxivfetcher.h
index bce5f9d..be64c0e 100644
--- a/src/fetch/arxivfetcher.h
+++ b/src/fetch/arxivfetcher.h
@@ -20,8 +20,8 @@
#include <kio/job.h>
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
namespace Tellico {
@@ -34,14 +34,15 @@ namespace Tellico {
*/
class ArxivFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- ArxivFetcher(QObject* parent);
+ ArxivFetcher(TQObject* tqparent);
~ArxivFetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void continueSearch();
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person || k == Keyword || k == ArxivID; }
@@ -54,37 +55,37 @@ public:
virtual void updateEntry(Data::EntryPtr entry);
virtual void updateEntrySynchronous(Data::EntryPtr entry);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_, const ArxivFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent_, const ArxivFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup& config);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
void initXSLTHandler();
- KURL searchURL(FetchKey key, const QString& value) const;
+ KURL searchURL(FetchKey key, const TQString& value) const;
void doSearch();
XSLTHandler* m_xsltHandler;
int m_start;
int m_total;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries;
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQGuardedPtr<KIO::Job> m_job;
FetchKey m_key;
- QString m_value;
+ TQString m_value;
bool m_started;
};
diff --git a/src/fetch/bibsonomyfetcher.cpp b/src/fetch/bibsonomyfetcher.cpp
index faa48a4..b2e7d2e 100644
--- a/src/fetch/bibsonomyfetcher.cpp
+++ b/src/fetch/bibsonomyfetcher.cpp
@@ -24,8 +24,8 @@
#include <klocale.h>
-#include <qlabel.h>
-#include <qlayout.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
namespace {
// always bibtex
@@ -35,18 +35,18 @@ namespace {
using Tellico::Fetch::BibsonomyFetcher;
-BibsonomyFetcher::BibsonomyFetcher(QObject* parent_)
- : Fetcher(parent_), m_job(0), m_started(false) {
+BibsonomyFetcher::BibsonomyFetcher(TQObject* tqparent_)
+ : Fetcher(tqparent_), m_job(0), m_started(false) {
}
BibsonomyFetcher::~BibsonomyFetcher() {
}
-QString BibsonomyFetcher::defaultName() {
- return QString::fromLatin1("Bibsonomy");
+TQString BibsonomyFetcher::defaultName() {
+ return TQString::tqfromLatin1("Bibsonomy");
}
-QString BibsonomyFetcher::source() const {
+TQString BibsonomyFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -57,13 +57,13 @@ bool BibsonomyFetcher::canFetch(int type) const {
void BibsonomyFetcher::readConfigHook(const KConfigGroup&) {
}
-void BibsonomyFetcher::search(FetchKey key_, const QString& value_) {
+void BibsonomyFetcher::search(FetchKey key_, const TQString& value_) {
m_key = key_;
m_value = value_.stripWhiteSpace();
m_started = true;
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
@@ -79,10 +79,10 @@ void BibsonomyFetcher::search(FetchKey key_, const QString& value_) {
}
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void BibsonomyFetcher::stop() {
@@ -99,8 +99,8 @@ void BibsonomyFetcher::stop() {
emit signalDone(this);
}
-void BibsonomyFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void BibsonomyFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -121,7 +121,7 @@ void BibsonomyFetcher::slotComplete(KIO::Job* job_) {
return;
}
- Import::BibtexImporter imp(QString::fromUtf8(m_data, m_data.size()));
+ Import::BibtexImporter imp(TQString::fromUtf8(m_data, m_data.size()));
Data::CollPtr coll = imp.collection();
if(!coll) {
@@ -136,13 +136,13 @@ void BibsonomyFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- QString desc = entry->field(QString::fromLatin1("author"))
- + QChar('/') + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("year"));
+ TQString desc = entry->field(TQString::tqfromLatin1("author"))
+ + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year"));
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
}
@@ -154,17 +154,17 @@ Tellico::Data::EntryPtr BibsonomyFetcher::fetchEntry(uint uid_) {
return m_entries[uid_];
}
-KURL BibsonomyFetcher::searchURL(FetchKey key_, const QString& value_) const {
- KURL u(QString::fromLatin1(BIBSONOMY_BASE_URL));
- u.setPath(QString::fromLatin1("/bib/"));
+KURL BibsonomyFetcher::searchURL(FetchKey key_, const TQString& value_) const {
+ KURL u(TQString::tqfromLatin1(BIBSONOMY_BASE_URL));
+ u.setPath(TQString::tqfromLatin1("/bib/"));
switch(key_) {
case Person:
- u.addPath(QString::fromLatin1("author/%1").arg(value_));
+ u.addPath(TQString::tqfromLatin1("author/%1").tqarg(value_));
break;
case Keyword:
- u.addPath(QString::fromLatin1("search/%1").arg(value_));
+ u.addPath(TQString::tqfromLatin1("search/%1").tqarg(value_));
break;
default:
@@ -172,13 +172,13 @@ KURL BibsonomyFetcher::searchURL(FetchKey key_, const QString& value_) const {
return KURL();
}
- u.addQueryItem(QString::fromLatin1("items"), QString::number(BIBSONOMY_MAX_RESULTS));
+ u.addQueryItem(TQString::tqfromLatin1("items"), TQString::number(BIBSONOMY_MAX_RESULTS));
myDebug() << "BibsonomyFetcher::search() - url: " << u.url() << endl;
return u;
}
void BibsonomyFetcher::updateEntry(Data::EntryPtr entry_) {
- QString title = entry_->field(QString::fromLatin1("title"));
+ TQString title = entry_->field(TQString::tqfromLatin1("title"));
if(!title.isEmpty()) {
search(Fetch::Keyword, title);
return;
@@ -188,21 +188,21 @@ void BibsonomyFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* BibsonomyFetcher::configWidget(QWidget* parent_) const {
- return new BibsonomyFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* BibsonomyFetcher::configWidget(TQWidget* tqparent_) const {
+ return new BibsonomyFetcher::ConfigWidget(tqparent_, this);
}
-BibsonomyFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const BibsonomyFetcher*)
- : Fetch::ConfigWidget(parent_) {
- QVBoxLayout* l = new QVBoxLayout(optionsWidget());
- l->addWidget(new QLabel(i18n("This source has no options."), optionsWidget()));
+BibsonomyFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const BibsonomyFetcher*)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQVBoxLayout* l = new TQVBoxLayout(optionsWidget());
+ l->addWidget(new TQLabel(i18n("This source has no options."), optionsWidget()));
l->addStretch();
}
void BibsonomyFetcher::ConfigWidget::saveConfig(KConfigGroup&) {
}
-QString BibsonomyFetcher::ConfigWidget::preferredName() const {
+TQString BibsonomyFetcher::ConfigWidget::preferredName() const {
return BibsonomyFetcher::defaultName();
}
diff --git a/src/fetch/bibsonomyfetcher.h b/src/fetch/bibsonomyfetcher.h
index fc59928..530e286 100644
--- a/src/fetch/bibsonomyfetcher.h
+++ b/src/fetch/bibsonomyfetcher.h
@@ -20,8 +20,8 @@
#include <kio/job.h>
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
namespace Tellico {
namespace Fetch {
@@ -31,14 +31,15 @@ namespace Tellico {
*/
class BibsonomyFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- BibsonomyFetcher(QObject* parent);
+ BibsonomyFetcher(TQObject* tqparent);
~BibsonomyFetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual bool canSearch(FetchKey k) const { return k == Person || k == Keyword; }
virtual void stop();
@@ -49,31 +50,31 @@ public:
virtual void updateEntry(Data::EntryPtr entry);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_, const BibsonomyFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent_, const BibsonomyFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup& config);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
- KURL searchURL(FetchKey key, const QString& value) const;
+ KURL searchURL(FetchKey key, const TQString& value) const;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries;
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQGuardedPtr<KIO::Job> m_job;
FetchKey m_key;
- QString m_value;
+ TQString m_value;
bool m_started;
};
diff --git a/src/fetch/citebasefetcher.cpp b/src/fetch/citebasefetcher.cpp
index 798d690..177530c 100644
--- a/src/fetch/citebasefetcher.cpp
+++ b/src/fetch/citebasefetcher.cpp
@@ -24,8 +24,8 @@
#include <klocale.h>
-#include <qlabel.h>
-#include <qlayout.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
// #define CITEBASE_TEST
@@ -36,18 +36,18 @@ namespace {
using Tellico::Fetch::CitebaseFetcher;
-CitebaseFetcher::CitebaseFetcher(QObject* parent_)
- : Fetcher(parent_), m_job(0), m_started(false) {
+CitebaseFetcher::CitebaseFetcher(TQObject* tqparent_)
+ : Fetcher(tqparent_), m_job(0), m_started(false) {
}
CitebaseFetcher::~CitebaseFetcher() {
}
-QString CitebaseFetcher::defaultName() {
- return QString::fromLatin1("Citebase");
+TQString CitebaseFetcher::defaultName() {
+ return TQString::tqfromLatin1("Citebase");
}
-QString CitebaseFetcher::source() const {
+TQString CitebaseFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -58,13 +58,13 @@ bool CitebaseFetcher::canFetch(int type) const {
void CitebaseFetcher::readConfigHook(const KConfigGroup&) {
}
-void CitebaseFetcher::search(FetchKey key_, const QString& value_) {
+void CitebaseFetcher::search(FetchKey key_, const TQString& value_) {
m_key = key_;
m_value = value_.stripWhiteSpace();
m_started = true;
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
@@ -80,10 +80,10 @@ void CitebaseFetcher::search(FetchKey key_, const QString& value_) {
}
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void CitebaseFetcher::stop() {
@@ -100,8 +100,8 @@ void CitebaseFetcher::stop() {
emit signalDone(this);
}
-void CitebaseFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void CitebaseFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -124,16 +124,16 @@ void CitebaseFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from citebasefetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test.bib"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.bib"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
- t << QCString(m_data, m_data.size()+1);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
+ t << TQCString(m_data, m_data.size()+1);
}
f.close();
#endif
- Import::BibtexImporter imp(QString::fromUtf8(m_data, m_data.size()));
+ Import::BibtexImporter imp(TQString::fromUtf8(m_data, m_data.size()));
Data::CollPtr coll = imp.collection();
if(!coll) {
@@ -148,13 +148,13 @@ void CitebaseFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- QString desc = entry->field(QString::fromLatin1("author"))
- + QChar('/') + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("year"));
+ TQString desc = entry->field(TQString::tqfromLatin1("author"))
+ + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year"));
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
}
@@ -166,17 +166,17 @@ Tellico::Data::EntryPtr CitebaseFetcher::fetchEntry(uint uid_) {
return m_entries[uid_];
}
-KURL CitebaseFetcher::searchURL(FetchKey key_, const QString& value_) const {
- KURL u(QString::fromLatin1(CITEBASE_BASE_URL));
+KURL CitebaseFetcher::searchURL(FetchKey key_, const TQString& value_) const {
+ KURL u(TQString::tqfromLatin1(CITEBASE_BASE_URL));
switch(key_) {
case ArxivID:
{
// remove prefix and/or version number
- QString value = value_;
- value.remove(QRegExp(QString::fromLatin1("^arxiv:"), false));
- value.remove(QRegExp(QString::fromLatin1("v\\d+$")));
- u.addQueryItem(QString::fromLatin1("rft_id"), QString::fromLatin1("oai:arXiv.org:%1").arg(value));
+ TQString value = value_;
+ value.remove(TQRegExp(TQString::tqfromLatin1("^arxiv:"), false));
+ value.remove(TQRegExp(TQString::tqfromLatin1("v\\d+$")));
+ u.addQueryItem(TQString::tqfromLatin1("rft_id"), TQString::tqfromLatin1("oai:arXiv.org:%1").tqarg(value));
}
break;
@@ -186,14 +186,14 @@ KURL CitebaseFetcher::searchURL(FetchKey key_, const QString& value_) const {
}
#ifdef CITEBASE_TEST
- u = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/citebase.bib"));
+ u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/citebase.bib"));
#endif
myDebug() << "CitebaseFetcher::search() - url: " << u.url() << endl;
return u;
}
void CitebaseFetcher::updateEntry(Data::EntryPtr entry_) {
- QString arxiv = entry_->field(QString::fromLatin1("arxiv"));
+ TQString arxiv = entry_->field(TQString::tqfromLatin1("arxiv"));
if(!arxiv.isEmpty()) {
search(Fetch::ArxivID, arxiv);
return;
@@ -207,13 +207,13 @@ void CitebaseFetcher::updateEntrySynchronous(Data::EntryPtr entry) {
if(!entry) {
return;
}
- QString arxiv = entry->field(QString::fromLatin1("arxiv"));
+ TQString arxiv = entry->field(TQString::tqfromLatin1("arxiv"));
if(arxiv.isEmpty()) {
return;
}
KURL u = searchURL(ArxivID, arxiv);
- QString bibtex = FileHandler::readTextFile(u, true);
+ TQString bibtex = FileHandler::readTextFile(u, true);
if(bibtex.isEmpty()) {
return;
}
@@ -227,21 +227,21 @@ void CitebaseFetcher::updateEntrySynchronous(Data::EntryPtr entry) {
}
}
-Tellico::Fetch::ConfigWidget* CitebaseFetcher::configWidget(QWidget* parent_) const {
- return new CitebaseFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* CitebaseFetcher::configWidget(TQWidget* tqparent_) const {
+ return new CitebaseFetcher::ConfigWidget(tqparent_, this);
}
-CitebaseFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const CitebaseFetcher*)
- : Fetch::ConfigWidget(parent_) {
- QVBoxLayout* l = new QVBoxLayout(optionsWidget());
- l->addWidget(new QLabel(i18n("This source has no options."), optionsWidget()));
+CitebaseFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const CitebaseFetcher*)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQVBoxLayout* l = new TQVBoxLayout(optionsWidget());
+ l->addWidget(new TQLabel(i18n("This source has no options."), optionsWidget()));
l->addStretch();
}
void CitebaseFetcher::ConfigWidget::saveConfig(KConfigGroup&) {
}
-QString CitebaseFetcher::ConfigWidget::preferredName() const {
+TQString CitebaseFetcher::ConfigWidget::preferredName() const {
return CitebaseFetcher::defaultName();
}
diff --git a/src/fetch/citebasefetcher.h b/src/fetch/citebasefetcher.h
index a292107..b91433b 100644
--- a/src/fetch/citebasefetcher.h
+++ b/src/fetch/citebasefetcher.h
@@ -20,8 +20,8 @@
#include <kio/job.h>
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
namespace Tellico {
namespace Fetch {
@@ -31,14 +31,15 @@ namespace Tellico {
*/
class CitebaseFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- CitebaseFetcher(QObject* parent);
+ CitebaseFetcher(TQObject* tqparent);
~CitebaseFetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual bool canSearch(FetchKey k) const { return k == ArxivID; }
virtual void stop();
@@ -50,31 +51,31 @@ public:
virtual void updateEntry(Data::EntryPtr entry);
virtual void updateEntrySynchronous(Data::EntryPtr entry);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_, const CitebaseFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent_, const CitebaseFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup& config);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
- KURL searchURL(FetchKey key, const QString& value) const;
+ KURL searchURL(FetchKey key, const TQString& value) const;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries;
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQGuardedPtr<KIO::Job> m_job;
FetchKey m_key;
- QString m_value;
+ TQString m_value;
bool m_started;
};
diff --git a/src/fetch/configwidget.cpp b/src/fetch/configwidget.cpp
index c7b3b59..3ceeea3 100644
--- a/src/fetch/configwidget.cpp
+++ b/src/fetch/configwidget.cpp
@@ -17,35 +17,35 @@
#include <klocale.h>
#include <kaccelmanager.h>
-#include <qvgroupbox.h>
-#include <qlayout.h>
+#include <tqvgroupbox.h>
+#include <tqlayout.h>
using Tellico::Fetch::ConfigWidget;
-ConfigWidget::ConfigWidget(QWidget* parent_) : QWidget(parent_), m_modified(false), m_accepted(false) {
- QHBoxLayout* boxLayout = new QHBoxLayout(this);
+ConfigWidget::ConfigWidget(TQWidget* tqparent_) : TQWidget(tqparent_), m_modified(false), m_accepted(false) {
+ TQHBoxLayout* boxLayout = new TQHBoxLayout(this);
boxLayout->setSpacing(10);
- QGroupBox* vbox = new QVGroupBox(i18n("Source Options"), this);
+ TQGroupBox* vbox = new TQVGroupBox(i18n("Source Options"), this);
boxLayout->addWidget(vbox, 10 /*stretch*/);
- m_optionsWidget = new QWidget(vbox);
+ m_optionsWidget = new TQWidget(vbox);
}
-void ConfigWidget::addFieldsWidget(const StringMap& customFields_, const QStringList& fieldsToAdd_) {
+void ConfigWidget::addFieldsWidget(const StringMap& customFields_, const TQStringList& fieldsToAdd_) {
if(customFields_.isEmpty()) {
return;
}
- QVGroupBox* box = new QVGroupBox(i18n("Available Fields"), this);
- static_cast<QBoxLayout*>(layout())->addWidget(box);
+ TQVGroupBox* box = new TQVGroupBox(i18n("Available Fields"), this);
+ static_cast<TQBoxLayout*>(tqlayout())->addWidget(box);
for(StringMap::ConstIterator it = customFields_.begin(); it != customFields_.end(); ++it) {
- QCheckBox* cb = new QCheckBox(it.data(), box);
+ TQCheckBox* cb = new TQCheckBox(it.data(), box);
m_fields.insert(it.key(), cb);
- if(fieldsToAdd_.contains(it.key())) {
+ if(fieldsToAdd_.tqcontains(it.key())) {
cb->setChecked(true);
}
- connect(cb, SIGNAL(clicked()), SLOT(slotSetModified()));
+ connect(cb, TQT_SIGNAL(clicked()), TQT_SLOT(slotSetModified()));
}
KAcceleratorManager::manage(this);
@@ -54,13 +54,13 @@ void ConfigWidget::addFieldsWidget(const StringMap& customFields_, const QString
}
void ConfigWidget::saveFieldsConfig(KConfigGroup& config_) const {
- QStringList fields;
- for(QDictIterator<QCheckBox> it(m_fields); it.current(); ++it) {
+ TQStringList fields;
+ for(TQDictIterator<TQCheckBox> it(m_fields); it.current(); ++it) {
if(it.current()->isChecked()) {
fields << it.currentKey();
}
}
- config_.writeEntry(QString::fromLatin1("Custom Fields"), fields);
+ config_.writeEntry(TQString::tqfromLatin1("Custom Fields"), fields);
}
#include "configwidget.moc"
diff --git a/src/fetch/configwidget.h b/src/fetch/configwidget.h
index 9f18f83..f0a981c 100644
--- a/src/fetch/configwidget.h
+++ b/src/fetch/configwidget.h
@@ -16,12 +16,12 @@
#include "../datavectors.h"
-#include <qwidget.h>
-#include <qdict.h>
-#include <qcheckbox.h>
+#include <tqwidget.h>
+#include <tqdict.h>
+#include <tqcheckbox.h>
class KConfigGroup;
-class QStringList;
+class TQStringList;
namespace Tellico {
namespace Fetch {
@@ -29,11 +29,12 @@ namespace Tellico {
/**
* @author Robby Stephenson
*/
-class ConfigWidget : public QWidget {
+class ConfigWidget : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- ConfigWidget(QWidget* parent);
+ ConfigWidget(TQWidget* tqparent);
virtual ~ConfigWidget() {}
void setAccepted(bool accepted_) { m_accepted = accepted_; }
@@ -52,24 +53,24 @@ public:
* class than in the Fetcher class itself
*/
virtual void removed() {}
- virtual QString preferredName() const = 0;
+ virtual TQString preferredName() const = 0;
signals:
- void signalName(const QString& name);
+ void signalName(const TQString& name);
public slots:
void slotSetModified(bool modified_ = true) { m_modified = modified_; }
protected:
- QWidget* optionsWidget() { return m_optionsWidget; }
- void addFieldsWidget(const StringMap& customFields, const QStringList& fieldsToAdd);
+ TQWidget* optionsWidget() { return m_optionsWidget; }
+ void addFieldsWidget(const StringMap& customFields, const TQStringList& fieldsToAdd);
void saveFieldsConfig(KConfigGroup& config) const;
private:
bool m_modified;
bool m_accepted;
- QWidget* m_optionsWidget;
- QDict<QCheckBox> m_fields;
+ TQWidget* m_optionsWidget;
+ TQDict<TQCheckBox> m_fields;
};
}
diff --git a/src/fetch/crossreffetcher.cpp b/src/fetch/crossreffetcher.cpp
index 8c5d303..6840e6d 100644
--- a/src/fetch/crossreffetcher.cpp
+++ b/src/fetch/crossreffetcher.cpp
@@ -29,10 +29,10 @@
#include <klineedit.h>
#include <kactivelabel.h>
-#include <qlabel.h>
-#include <qwhatsthis.h>
-#include <qlayout.h>
-#include <qfile.h>
+#include <tqlabel.h>
+#include <tqwhatsthis.h>
+#include <tqlayout.h>
+#include <tqfile.h>
// #define CROSSREF_TEST
@@ -44,8 +44,8 @@ namespace {
using Tellico::Fetch::CrossRefFetcher;
-CrossRefFetcher::CrossRefFetcher(QObject* parent_)
- : Fetcher(parent_), m_xsltHandler(0), m_job(0), m_started(false) {
+CrossRefFetcher::CrossRefFetcher(TQObject* tqparent_)
+ : Fetcher(tqparent_), m_xsltHandler(0), m_job(0), m_started(false) {
}
CrossRefFetcher::~CrossRefFetcher() {
@@ -53,11 +53,11 @@ CrossRefFetcher::~CrossRefFetcher() {
m_xsltHandler = 0;
}
-QString CrossRefFetcher::defaultName() {
- return QString::fromLatin1("CrossRef");
+TQString CrossRefFetcher::defaultName() {
+ return TQString::tqfromLatin1("CrossRef");
}
-QString CrossRefFetcher::source() const {
+TQString CrossRefFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -66,7 +66,7 @@ bool CrossRefFetcher::canFetch(int type) const {
}
void CrossRefFetcher::readConfigHook(const KConfigGroup& config_) {
- QString s = config_.readEntry("User");
+ TQString s = config_.readEntry("User");
if(!s.isEmpty()) {
m_user = s;
}
@@ -76,19 +76,19 @@ void CrossRefFetcher::readConfigHook(const KConfigGroup& config_) {
}
}
-void CrossRefFetcher::search(FetchKey key_, const QString& value_) {
+void CrossRefFetcher::search(FetchKey key_, const TQString& value_) {
m_key = key_;
m_value = value_.stripWhiteSpace();
m_started = true;
if(m_user.isEmpty() || m_password.isEmpty()) {
- message(i18n("%1 requires a username and password.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 requires a username and password.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
@@ -104,10 +104,10 @@ void CrossRefFetcher::search(FetchKey key_, const QString& value_) {
}
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void CrossRefFetcher::stop() {
@@ -124,8 +124,8 @@ void CrossRefFetcher::stop() {
emit signalDone(this);
}
-void CrossRefFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void CrossRefFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -148,11 +148,11 @@ void CrossRefFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from crossreffetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
- t << QCString(m_data, m_data.size()+1);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
+ t << TQCString(m_data, m_data.size()+1);
}
f.close();
#endif
@@ -166,7 +166,7 @@ void CrossRefFetcher::slotComplete(KIO::Job* job_) {
}
// assume result is always utf-8
- QString str = m_xsltHandler->applyStylesheet(QString::fromUtf8(m_data, m_data.size()));
+ TQString str = m_xsltHandler->applyStylesheet(TQString::fromUtf8(m_data, m_data.size()));
Import::TellicoImporter imp(str);
Data::CollPtr coll = imp.collection();
@@ -182,13 +182,13 @@ void CrossRefFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- QString desc = entry->field(QString::fromLatin1("author"))
- + QChar('/') + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("year"));
+ TQString desc = entry->field(TQString::tqfromLatin1("author"))
+ + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year"));
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
}
@@ -199,19 +199,19 @@ void CrossRefFetcher::slotComplete(KIO::Job* job_) {
Tellico::Data::EntryPtr CrossRefFetcher::fetchEntry(uint uid_) {
Data::EntryPtr entry = m_entries[uid_];
// if URL but no cover image, fetch it
- if(!entry->field(QString::fromLatin1("url")).isEmpty()) {
+ if(!entry->field(TQString::tqfromLatin1("url")).isEmpty()) {
Data::CollPtr coll = entry->collection();
- Data::FieldPtr field = coll->fieldByName(QString::fromLatin1("cover"));
+ Data::FieldPtr field = coll->fieldByName(TQString::tqfromLatin1("cover"));
if(!field && !coll->imageFields().isEmpty()) {
field = coll->imageFields().front();
} else if(!field) {
- field = new Data::Field(QString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
+ field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
coll->addField(field);
}
if(entry->field(field).isEmpty()) {
- QPixmap pix = NetAccess::filePreview(entry->field(QString::fromLatin1("url")));
+ TQPixmap pix = NetAccess::filePreview(entry->field(TQString::tqfromLatin1("url")));
if(!pix.isNull()) {
- QString id = ImageFactory::addImage(pix, QString::fromLatin1("PNG"));
+ TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG"));
if(!id.isEmpty()) {
entry->setField(field, id);
}
@@ -223,9 +223,9 @@ Tellico::Data::EntryPtr CrossRefFetcher::fetchEntry(uint uid_) {
void CrossRefFetcher::initXSLTHandler() {
#ifdef CROSSREF_USE_UNIXREF
- QString xsltfile = locate("appdata", QString::fromLatin1("unixref2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("unixref2tellico.xsl"));
#else
- QString xsltfile = locate("appdata", QString::fromLatin1("crossref2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("crossref2tellico.xsl"));
#endif
if(xsltfile.isEmpty()) {
kdWarning() << "CrossRefFetcher::initXSLTHandler() - can not locate xslt file." << endl;
@@ -245,16 +245,16 @@ void CrossRefFetcher::initXSLTHandler() {
}
}
-KURL CrossRefFetcher::searchURL(FetchKey key_, const QString& value_) const {
- KURL u(QString::fromLatin1(CROSSREF_BASE_URL));
+KURL CrossRefFetcher::searchURL(FetchKey key_, const TQString& value_) const {
+ KURL u(TQString::tqfromLatin1(CROSSREF_BASE_URL));
#ifdef CROSSREF_USE_UNIXREF
- u.addQueryItem(QString::fromLatin1("format"), QString::fromLatin1("unixref"));
+ u.addQueryItem(TQString::tqfromLatin1("format"), TQString::tqfromLatin1("unixref"));
#endif
- u.addQueryItem(QString::fromLatin1("req_dat"), QString::fromLatin1("ourl_%1:%2").arg(m_user, m_password));
+ u.addQueryItem(TQString::tqfromLatin1("req_dat"), TQString::tqfromLatin1("ourl_%1:%2").tqarg(m_user, m_password));
switch(key_) {
case DOI:
- u.addQueryItem(QString::fromLatin1("rft_id"), QString::fromLatin1("info:doi/%1").arg(value_));
+ u.addQueryItem(TQString::tqfromLatin1("rft_id"), TQString::tqfromLatin1("info:doi/%1").tqarg(value_));
break;
default:
@@ -263,14 +263,14 @@ KURL CrossRefFetcher::searchURL(FetchKey key_, const QString& value_) const {
}
#ifdef CROSSREF_TEST
- u = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/crossref.xml"));
+ u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/crossref.xml"));
#endif
myDebug() << "CrossRefFetcher::search() - url: " << u.url() << endl;
return u;
}
void CrossRefFetcher::updateEntry(Data::EntryPtr entry_) {
- QString doi = entry_->field(QString::fromLatin1("doi"));
+ TQString doi = entry_->field(TQString::tqfromLatin1("doi"));
if(!doi.isEmpty()) {
search(Fetch::DOI, doi);
return;
@@ -278,7 +278,7 @@ void CrossRefFetcher::updateEntry(Data::EntryPtr entry_) {
#if 0
// optimistically try searching for title and rely on Collection::sameEntry() to figure things out
- QString t = entry_->field(QString::fromLatin1("title"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
if(!t.isEmpty()) {
m_limit = 10; // raise limit so more possibility of match
search(Fetch::Title, t);
@@ -298,13 +298,13 @@ void CrossRefFetcher::updateEntrySynchronous(Data::EntryPtr entry) {
myDebug() << "CrossRefFetcher::updateEntrySynchronous() - username and password is required" << endl;
return;
}
- QString doi = entry->field(QString::fromLatin1("doi"));
+ TQString doi = entry->field(TQString::tqfromLatin1("doi"));
if(doi.isEmpty()) {
return;
}
KURL u = searchURL(DOI, doi);
- QString xml = FileHandler::readTextFile(u, true, true);
+ TQString xml = FileHandler::readTextFile(u, true, true);
if(xml.isEmpty()) {
return;
}
@@ -317,7 +317,7 @@ void CrossRefFetcher::updateEntrySynchronous(Data::EntryPtr entry) {
}
// assume result is always utf-8
- QString str = m_xsltHandler->applyStylesheet(xml);
+ TQString str = m_xsltHandler->applyStylesheet(xml);
Import::TellicoImporter imp(str);
Data::CollPtr coll = imp.collection();
if(coll && coll->entryCount() > 0) {
@@ -326,13 +326,13 @@ void CrossRefFetcher::updateEntrySynchronous(Data::EntryPtr entry) {
}
}
-Tellico::Fetch::ConfigWidget* CrossRefFetcher::configWidget(QWidget* parent_) const {
- return new CrossRefFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* CrossRefFetcher::configWidget(TQWidget* tqparent_) const {
+ return new CrossRefFetcher::ConfigWidget(tqparent_, this);
}
-CrossRefFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const CrossRefFetcher* fetcher_)
- : Fetch::ConfigWidget(parent_) {
- QGridLayout* l = new QGridLayout(optionsWidget(), 4, 2);
+CrossRefFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const CrossRefFetcher* fetcher_)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQGridLayout* l = new TQGridLayout(optionsWidget(), 4, 2);
l->setSpacing(4);
l->setColStretch(1, 10);
@@ -347,26 +347,26 @@ CrossRefFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const CrossRefFetc
++row;
l->addMultiCellWidget(al, row, row, 0, 1);
// richtext gets weird with size
- al->setMinimumWidth(al->sizeHint().width());
+ al->setMinimumWidth(al->tqsizeHint().width());
- QLabel* label = new QLabel(i18n("&Username: "), optionsWidget());
+ TQLabel* label = new TQLabel(i18n("&Username: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_userEdit = new KLineEdit(optionsWidget());
- connect(m_userEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ connect(m_userEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_userEdit, row, 1);
- QString w = i18n("A username and password is required to access the CrossRef service. The password is "
+ TQString w = i18n("A username and password is required to access the CrossRef service. The password is "
"stored as plain text in the Tellico configuration file.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_userEdit, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_userEdit, w);
label->setBuddy(m_userEdit);
- label = new QLabel(i18n("&Password: "), optionsWidget());
+ label = new TQLabel(i18n("&Password: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_passEdit = new KLineEdit(optionsWidget());
- connect(m_passEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ connect(m_passEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_passEdit, row, 1);
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_passEdit, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_passEdit, w);
label->setBuddy(m_passEdit);
if(fetcher_) {
@@ -376,7 +376,7 @@ CrossRefFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const CrossRefFetc
}
void CrossRefFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
- QString s = m_userEdit->text();
+ TQString s = m_userEdit->text();
config_.writeEntry("User", s);
s = m_passEdit->text();
@@ -385,7 +385,7 @@ void CrossRefFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
slotSetModified(false);
}
-QString CrossRefFetcher::ConfigWidget::preferredName() const {
+TQString CrossRefFetcher::ConfigWidget::preferredName() const {
return CrossRefFetcher::defaultName();
}
diff --git a/src/fetch/crossreffetcher.h b/src/fetch/crossreffetcher.h
index 392d46a..7b502c6 100644
--- a/src/fetch/crossreffetcher.h
+++ b/src/fetch/crossreffetcher.h
@@ -20,8 +20,8 @@
#include <kio/job.h>
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
class KLineEdit;
@@ -36,14 +36,15 @@ namespace Tellico {
*/
class CrossRefFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- CrossRefFetcher(QObject* parent);
+ CrossRefFetcher(TQObject* tqparent);
~CrossRefFetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual bool canSearch(FetchKey k) const { return k == DOI; }
virtual void stop();
@@ -55,40 +56,40 @@ public:
virtual void updateEntry(Data::EntryPtr entry);
virtual void updateEntrySynchronous(Data::EntryPtr entry);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_, const CrossRefFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent_, const CrossRefFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup& config);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
private:
KLineEdit* m_userEdit;
KLineEdit* m_passEdit;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
void initXSLTHandler();
- KURL searchURL(FetchKey key, const QString& value) const;
+ KURL searchURL(FetchKey key, const TQString& value) const;
XSLTHandler* m_xsltHandler;
- QString m_user;
- QString m_password;
+ TQString m_user;
+ TQString m_password;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries;
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQGuardedPtr<KIO::Job> m_job;
FetchKey m_key;
- QString m_value;
+ TQString m_value;
bool m_started;
};
diff --git a/src/fetch/discogsfetcher.cpp b/src/fetch/discogsfetcher.cpp
index 31a8bab..a92219a 100644
--- a/src/fetch/discogsfetcher.cpp
+++ b/src/fetch/discogsfetcher.cpp
@@ -27,10 +27,10 @@
#include <kconfig.h>
#include <kio/job.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qfile.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqfile.h>
+#include <tqwhatsthis.h>
//#define DISCOGS_TEST
@@ -42,10 +42,10 @@ namespace {
using Tellico::Fetch::DiscogsFetcher;
-DiscogsFetcher::DiscogsFetcher(QObject* parent_, const char* name_)
- : Fetcher(parent_, name_), m_xsltHandler(0),
+DiscogsFetcher::DiscogsFetcher(TQObject* tqparent_, const char* name_)
+ : Fetcher(tqparent_, name_), m_xsltHandler(0),
m_limit(DISCOGS_MAX_RETURNS_TOTAL), m_job(0), m_started(false),
- m_apiKey(QString::fromLatin1(DISCOGS_API_KEY)) {
+ m_apiKey(TQString::tqfromLatin1(DISCOGS_API_KEY)) {
}
DiscogsFetcher::~DiscogsFetcher() {
@@ -53,11 +53,11 @@ DiscogsFetcher::~DiscogsFetcher() {
m_xsltHandler = 0;
}
-QString DiscogsFetcher::defaultName() {
+TQString DiscogsFetcher::defaultName() {
return i18n("Discogs Audio Search");
}
-QString DiscogsFetcher::source() const {
+TQString DiscogsFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -66,7 +66,7 @@ bool DiscogsFetcher::canFetch(int type) const {
}
void DiscogsFetcher::readConfigHook(const KConfigGroup& config_) {
- QString k = config_.readEntry("API Key");
+ TQString k = config_.readEntry("API Key");
if(!k.isEmpty()) {
m_apiKey = k;
}
@@ -74,7 +74,7 @@ void DiscogsFetcher::readConfigHook(const KConfigGroup& config_) {
m_fields = config_.readListEntry("Custom Fields");
}
-void DiscogsFetcher::search(FetchKey key_, const QString& value_) {
+void DiscogsFetcher::search(FetchKey key_, const TQString& value_) {
m_key = key_;
m_value = value_;
m_started = true;
@@ -89,31 +89,31 @@ void DiscogsFetcher::continueSearch() {
}
void DiscogsFetcher::doSearch() {
- KURL u(QString::fromLatin1(DISCOGS_API_URL));
- u.addQueryItem(QString::fromLatin1("f"), QString::fromLatin1("xml"));
- u.addQueryItem(QString::fromLatin1("api_key"), m_apiKey);
+ KURL u(TQString::tqfromLatin1(DISCOGS_API_URL));
+ u.addQueryItem(TQString::tqfromLatin1("f"), TQString::tqfromLatin1("xml"));
+ u.addQueryItem(TQString::tqfromLatin1("api_key"), m_apiKey);
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
switch(m_key) {
case Title:
- u.setPath(QString::fromLatin1("/search"));
- u.addQueryItem(QString::fromLatin1("q"), m_value);
- u.addQueryItem(QString::fromLatin1("type"), QString::fromLatin1("release"));
+ u.setPath(TQString::tqfromLatin1("/search"));
+ u.addQueryItem(TQString::tqfromLatin1("q"), m_value);
+ u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("release"));
break;
case Person:
- u.setPath(QString::fromLatin1("/artist/%1").arg(m_value));
+ u.setPath(TQString::tqfromLatin1("/artist/%1").tqarg(m_value));
break;
case Keyword:
- u.setPath(QString::fromLatin1("/search"));
- u.addQueryItem(QString::fromLatin1("q"), m_value);
- u.addQueryItem(QString::fromLatin1("type"), QString::fromLatin1("all"));
+ u.setPath(TQString::tqfromLatin1("/search"));
+ u.addQueryItem(TQString::tqfromLatin1("q"), m_value);
+ u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("all"));
break;
default:
@@ -123,15 +123,15 @@ void DiscogsFetcher::doSearch() {
}
#ifdef DISCOGS_TEST
- u = KURL(QString::fromLatin1("/home/robby/discogs-results.xml"));
+ u = KURL(TQString::tqfromLatin1("/home/robby/discogs-results.xml"));
#endif
// myDebug() << "DiscogsFetcher::search() - url: " << u.url() << endl;
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void DiscogsFetcher::stop() {
@@ -147,8 +147,8 @@ void DiscogsFetcher::stop() {
emit signalDone(this);
}
-void DiscogsFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void DiscogsFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -168,11 +168,11 @@ void DiscogsFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from discogsfetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
- t << QCString(m_data, m_data.size()+1);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
+ t << TQCString(m_data, m_data.size()+1);
}
f.close();
#endif
@@ -186,23 +186,23 @@ void DiscogsFetcher::slotComplete(KIO::Job* job_) {
}
if(m_total == -1) {
- QDomDocument dom;
+ TQDomDocument dom;
if(!dom.setContent(m_data, false)) {
kdWarning() << "DiscogsFetcher::slotComplete() - server did not return valid XML." << endl;
return;
}
// total is /resp/searchresults/@numResults
- QDomNode n = dom.documentElement().namedItem(QString::fromLatin1("resp"))
- .namedItem(QString::fromLatin1("searchresults"));
- QDomElement e = n.toElement();
+ TQDomNode n = dom.documentElement().namedItem(TQString::tqfromLatin1("resp"))
+ .namedItem(TQString::tqfromLatin1("searchresults"));
+ TQDomElement e = n.toElement();
if(!e.isNull()) {
- m_total = e.attribute(QString::fromLatin1("numResults")).toInt();
+ m_total = e.attribute(TQString::tqfromLatin1("numResults")).toInt();
myDebug() << "total = " << m_total;
}
}
// assume discogs is always utf-8
- QString str = m_xsltHandler->applyStylesheet(QString::fromUtf8(m_data, m_data.size()));
+ TQString str = m_xsltHandler->applyStylesheet(TQString::fromUtf8(m_data, m_data.size()));
Import::TellicoImporter imp(str);
Data::CollPtr coll = imp.collection();
if(!coll) {
@@ -218,11 +218,11 @@ void DiscogsFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- QString desc = entry->field(QString::fromLatin1("artist"))
- + QChar('/')
- + entry->field(QString::fromLatin1("label"));
+ TQString desc = entry->field(TQString::tqfromLatin1("artist"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("label"));
- SearchResult* r = new SearchResult(this, entry->title(), desc, QString());
+ SearchResult* r = new SearchResult(this, entry->title(), desc, TQString());
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
}
@@ -241,35 +241,35 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) {
}
// one way we tell if this entry has been fully initialized is to
// check for a cover image
- if(!entry->field(QString::fromLatin1("cover")).isEmpty()) {
+ if(!entry->field(TQString::tqfromLatin1("cover")).isEmpty()) {
myLog() << "DiscogsFetcher::fetchEntry() - already downloaded " << entry->title() << endl;
return entry;
}
- QString release = entry->field(QString::fromLatin1("discogs-id"));
+ TQString release = entry->field(TQString::tqfromLatin1("discogs-id"));
if(release.isEmpty()) {
myDebug() << "DiscogsFetcher::fetchEntry() - no discogs release found" << endl;
return entry;
}
#ifdef DISCOGS_TEST
- KURL u(QString::fromLatin1("/home/robby/discogs-release.xml"));
+ KURL u(TQString::tqfromLatin1("/home/robby/discogs-release.xml"));
#else
- KURL u(QString::fromLatin1(DISCOGS_API_URL));
- u.setPath(QString::fromLatin1("/release/%1").arg(release));
- u.addQueryItem(QString::fromLatin1("f"), QString::fromLatin1("xml"));
- u.addQueryItem(QString::fromLatin1("api_key"), m_apiKey);
+ KURL u(TQString::tqfromLatin1(DISCOGS_API_URL));
+ u.setPath(TQString::tqfromLatin1("/release/%1").tqarg(release));
+ u.addQueryItem(TQString::tqfromLatin1("f"), TQString::tqfromLatin1("xml"));
+ u.addQueryItem(TQString::tqfromLatin1("api_key"), m_apiKey);
#endif
// myDebug() << "DiscogsFetcher::fetchEntry() - url: " << u << endl;
// quiet, utf8, allowCompressed
- QString output = FileHandler::readTextFile(u, true, true, true);
+ TQString output = FileHandler::readTextFile(u, true, true, true);
#if 0
kdWarning() << "Remove output debug from discogsfetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
t << output;
}
f.close();
@@ -289,21 +289,21 @@ Tellico::Data::EntryPtr DiscogsFetcher::fetchEntry(uint uid_) {
const StringMap customFields = this->customFields();
for(StringMap::ConstIterator it = customFields.begin(); it != customFields.end(); ++it) {
- if(!m_fields.contains(it.key())) {
+ if(!m_fields.tqcontains(it.key())) {
coll->removeField(it.key());
}
}
// don't want to include id
- coll->removeField(QString::fromLatin1("discogs-id"));
+ coll->removeField(TQString::tqfromLatin1("discogs-id"));
entry = coll->entries().front();
- m_entries.replace(uid_, entry);
+ m_entries.tqreplace(uid_, entry);
return entry;
}
void DiscogsFetcher::initXSLTHandler() {
- QString xsltfile = locate("appdata", QString::fromLatin1("discogs2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("discogs2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "DiscogsFetcher::initXSLTHandler() - can not locate discogs2tellico.xsl." << endl;
return;
@@ -325,14 +325,14 @@ void DiscogsFetcher::initXSLTHandler() {
void DiscogsFetcher::updateEntry(Data::EntryPtr entry_) {
// myDebug() << "DiscogsFetcher::updateEntry()" << endl;
- QString value;
- QString title = entry_->field(QString::fromLatin1("title"));
+ TQString value;
+ TQString title = entry_->field(TQString::tqfromLatin1("title"));
if(!title.isEmpty()) {
search(Title, value);
return;
}
- QString artist = entry_->field(QString::fromLatin1("artist"));
+ TQString artist = entry_->field(TQString::tqfromLatin1("artist"));
if(!artist.isEmpty()) {
search(Person, artist);
return;
@@ -342,53 +342,53 @@ void DiscogsFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* DiscogsFetcher::configWidget(QWidget* parent_) const {
- return new DiscogsFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* DiscogsFetcher::configWidget(TQWidget* tqparent_) const {
+ return new DiscogsFetcher::ConfigWidget(tqparent_, this);
}
-DiscogsFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const DiscogsFetcher* fetcher_)
- : Fetch::ConfigWidget(parent_) {
- QGridLayout* l = new QGridLayout(optionsWidget(), 2, 2);
+DiscogsFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const DiscogsFetcher* fetcher_)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQGridLayout* l = new TQGridLayout(optionsWidget(), 2, 2);
l->setSpacing(4);
l->setColStretch(1, 10);
int row = -1;
- QLabel* label = new QLabel(i18n("API &key: "), optionsWidget());
+ TQLabel* label = new TQLabel(i18n("API &key: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_apiKeyEdit = new KLineEdit(optionsWidget());
- connect(m_apiKeyEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ connect(m_apiKeyEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_apiKeyEdit, row, 1);
- QString w = i18n("With your discogs.com account you receive an API key for the usage of their XML-based interface "
+ TQString w = i18n("With your discogs.com account you receive an API key for the usage of their XML-based interface "
"(See http://www.discogs.com/help/api).");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_apiKeyEdit, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_apiKeyEdit, w);
label->setBuddy(m_apiKeyEdit);
- m_fetchImageCheck = new QCheckBox(i18n("Download cover &image"), optionsWidget());
- connect(m_fetchImageCheck, SIGNAL(clicked()), SLOT(slotSetModified()));
+ m_fetchImageCheck = new TQCheckBox(i18n("Download cover &image"), optionsWidget());
+ connect(m_fetchImageCheck, TQT_SIGNAL(clicked()), TQT_SLOT(slotSetModified()));
++row;
l->addMultiCellWidget(m_fetchImageCheck, row, row, 0, 1);
w = i18n("The cover image may be downloaded as well. However, too many large images in the "
"collection may degrade performance.");
- QWhatsThis::add(m_fetchImageCheck, w);
+ TQWhatsThis::add(m_fetchImageCheck, w);
l->setRowStretch(++row, 10);
// now add additional fields widget
- addFieldsWidget(DiscogsFetcher::customFields(), fetcher_ ? fetcher_->m_fields : QStringList());
+ addFieldsWidget(DiscogsFetcher::customFields(), fetcher_ ? fetcher_->m_fields : TQStringList());
if(fetcher_) {
m_apiKeyEdit->setText(fetcher_->m_apiKey);
m_fetchImageCheck->setChecked(fetcher_->m_fetchImages);
} else {
- m_apiKeyEdit->setText(QString::fromLatin1(DISCOGS_API_KEY));
+ m_apiKeyEdit->setText(TQString::tqfromLatin1(DISCOGS_API_KEY));
m_fetchImageCheck->setChecked(true);
}
}
void DiscogsFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
- QString apiKey = m_apiKeyEdit->text().stripWhiteSpace();
+ TQString apiKey = m_apiKeyEdit->text().stripWhiteSpace();
if(!apiKey.isEmpty()) {
config_.writeEntry("API Key", apiKey);
}
@@ -398,15 +398,15 @@ void DiscogsFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
slotSetModified(false);
}
-QString DiscogsFetcher::ConfigWidget::preferredName() const {
+TQString DiscogsFetcher::ConfigWidget::preferredName() const {
return DiscogsFetcher::defaultName();
}
Tellico::StringMap DiscogsFetcher::customFields() {
StringMap map;
- map[QString::fromLatin1("producer")] = i18n("Producer");
- map[QString::fromLatin1("nationality")] = i18n("Nationality");
- map[QString::fromLatin1("discogs")] = i18n("Discogs Link");
+ map[TQString::tqfromLatin1("producer")] = i18n("Producer");
+ map[TQString::tqfromLatin1("nationality")] = i18n("Nationality");
+ map[TQString::tqfromLatin1("discogs")] = i18n("Discogs Link");
return map;
}
diff --git a/src/fetch/discogsfetcher.h b/src/fetch/discogsfetcher.h
index ac8c1b8..cddb0b1 100644
--- a/src/fetch/discogsfetcher.h
+++ b/src/fetch/discogsfetcher.h
@@ -23,9 +23,9 @@ namespace Tellico {
#include "../datavectors.h"
#include <klineedit.h>
-#include <qdom.h>
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqdom.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
namespace KIO {
class Job;
@@ -41,20 +41,21 @@ namespace Tellico {
*/
class DiscogsFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
/**
*/
- DiscogsFetcher(QObject* parent, const char* name = 0);
+ DiscogsFetcher(TQObject* tqparent, const char* name = 0);
/**
*/
virtual ~DiscogsFetcher();
/**
*/
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void continueSearch();
// amazon can search title or person
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person || k == Keyword; }
@@ -69,25 +70,25 @@ public:
/**
* Returns a widget for modifying the fetcher's config.
*/
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
static StringMap customFields();
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_, const DiscogsFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent_, const DiscogsFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup&);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
private:
KLineEdit *m_apiKeyEdit;
- QCheckBox* m_fetchImageCheck;
+ TQCheckBox* m_fetchImageCheck;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
@@ -99,17 +100,17 @@ private:
int m_start;
int m_total;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries;
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQGuardedPtr<KIO::Job> m_job;
FetchKey m_key;
- QString m_value;
+ TQString m_value;
bool m_started;
bool m_fetchImages;
- QString m_apiKey;
- QStringList m_fields;
+ TQString m_apiKey;
+ TQStringList m_fields;
};
} // end namespace
diff --git a/src/fetch/entrezfetcher.cpp b/src/fetch/entrezfetcher.cpp
index 14b9e20..83fee42 100644
--- a/src/fetch/entrezfetcher.cpp
+++ b/src/fetch/entrezfetcher.cpp
@@ -26,10 +26,10 @@
#include <kstandarddirs.h>
#include <kio/job.h>
-#include <qdom.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qfile.h>
+#include <tqdom.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqfile.h>
//#define ENTREZ_TEST
@@ -45,18 +45,18 @@ namespace {
using Tellico::Fetch::EntrezFetcher;
-EntrezFetcher::EntrezFetcher(QObject* parent_, const char* name_) : Fetcher(parent_, name_), m_xsltHandler(0),
+EntrezFetcher::EntrezFetcher(TQObject* tqparent_, const char* name_) : Fetcher(tqparent_, name_), m_xsltHandler(0),
m_step(Begin), m_started(false) {
}
EntrezFetcher::~EntrezFetcher() {
}
-QString EntrezFetcher::defaultName() {
+TQString EntrezFetcher::defaultName() {
return i18n("Entrez Database");
}
-QString EntrezFetcher::source() const {
+TQString EntrezFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -65,14 +65,14 @@ bool EntrezFetcher::canFetch(int type) const {
}
void EntrezFetcher::readConfigHook(const KConfigGroup& config_) {
- QString s = config_.readEntry("Database", QString::fromLatin1(ENTREZ_DEFAULT_DATABASE)); // default to pubmed
+ TQString s = config_.readEntry("Database", TQString::tqfromLatin1(ENTREZ_DEFAULT_DATABASE)); // default to pubmed
if(!s.isEmpty()) {
m_dbname = s;
}
m_fields = config_.readListEntry("Custom Fields");
}
-void EntrezFetcher::search(FetchKey key_, const QString& value_) {
+void EntrezFetcher::search(FetchKey key_, const TQString& value_) {
m_started = true;
m_start = 1;
m_total = -1;
@@ -84,36 +84,36 @@ void EntrezFetcher::search(FetchKey key_, const QString& value_) {
return;
}
if(m_dbname.isEmpty()) {
- m_dbname = QString::fromLatin1(ENTREZ_DEFAULT_DATABASE);
+ m_dbname = TQString::tqfromLatin1(ENTREZ_DEFAULT_DATABASE);
}
#ifdef ENTREZ_TEST
- KURL u = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/esearch.xml"));
+ KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/esearch.xml"));
#else
- KURL u(QString::fromLatin1(ENTREZ_BASE_URL));
- u.addPath(QString::fromLatin1(ENTREZ_SEARCH_CGI));
- u.addQueryItem(QString::fromLatin1("tool"), QString::fromLatin1("Tellico"));
- u.addQueryItem(QString::fromLatin1("retmode"), QString::fromLatin1("xml"));
- u.addQueryItem(QString::fromLatin1("usehistory"), QString::fromLatin1("y"));
- u.addQueryItem(QString::fromLatin1("retmax"), QString::fromLatin1("1")); // we're just getting the count
- u.addQueryItem(QString::fromLatin1("db"), m_dbname);
- u.addQueryItem(QString::fromLatin1("term"), value_);
+ KURL u(TQString::tqfromLatin1(ENTREZ_BASE_URL));
+ u.addPath(TQString::tqfromLatin1(ENTREZ_SEARCH_CGI));
+ u.addQueryItem(TQString::tqfromLatin1("tool"), TQString::tqfromLatin1("Tellico"));
+ u.addQueryItem(TQString::tqfromLatin1("retmode"), TQString::tqfromLatin1("xml"));
+ u.addQueryItem(TQString::tqfromLatin1("usehistory"), TQString::tqfromLatin1("y"));
+ u.addQueryItem(TQString::tqfromLatin1("retmax"), TQString::tqfromLatin1("1")); // we're just getting the count
+ u.addQueryItem(TQString::tqfromLatin1("db"), m_dbname);
+ u.addQueryItem(TQString::tqfromLatin1("term"), value_);
switch(key_) {
case Title:
- u.addQueryItem(QString::fromLatin1("field"), QString::fromLatin1("titl"));
+ u.addQueryItem(TQString::tqfromLatin1("field"), TQString::tqfromLatin1("titl"));
break;
case Person:
- u.addQueryItem(QString::fromLatin1("field"), QString::fromLatin1("auth"));
+ u.addQueryItem(TQString::tqfromLatin1("field"), TQString::tqfromLatin1("auth"));
break;
case Keyword:
// for Tellico Keyword searches basically mean search for any field matching
-// u.addQueryItem(QString::fromLatin1("field"), QString::fromLatin1("word"));
+// u.addQueryItem(TQString::tqfromLatin1("field"), TQString::tqfromLatin1("word"));
break;
case PubmedID:
- u.addQueryItem(QString::fromLatin1("field"), QString::fromLatin1("pmid"));
+ u.addQueryItem(TQString::tqfromLatin1("field"), TQString::tqfromLatin1("pmid"));
break;
case DOI:
@@ -131,10 +131,10 @@ void EntrezFetcher::search(FetchKey key_, const QString& value_) {
m_step = Search;
// myLog() << "EntrezFetcher::doSearch() - url: " << u.url() << endl;
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void EntrezFetcher::continueSearch() {
@@ -156,8 +156,8 @@ void EntrezFetcher::stop() {
emit signalDone(this);
}
-void EntrezFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void EntrezFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -179,11 +179,11 @@ void EntrezFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from entrezfetcher.cpp: " << __LINE__ << endl;
- QFile f(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
- t << QCString(m_data, m_data.size()+1);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
+ t << TQCString(m_data, m_data.size()+1);
}
f.close();
#endif
@@ -205,7 +205,7 @@ void EntrezFetcher::slotComplete(KIO::Job* job_) {
}
void EntrezFetcher::searchResults() {
- QDomDocument dom;
+ TQDomDocument dom;
if(!dom.setContent(m_data, false)) {
kdWarning() << "EntrezFetcher::searchResults() - server did not return valid XML." << endl;
stop();
@@ -213,8 +213,8 @@ void EntrezFetcher::searchResults() {
}
// find Count, QueryKey, and WebEnv elements
int count = 0;
- for(QDomNode n = dom.documentElement().firstChild(); !n.isNull(); n = n.nextSibling()) {
- QDomElement e = n.toElement();
+ for(TQDomNode n = dom.documentElement().firstChild(); !n.isNull(); n = n.nextSibling()) {
+ TQDomElement e = n.toElement();
if(e.isNull()) {
continue;
}
@@ -239,71 +239,71 @@ void EntrezFetcher::searchResults() {
void EntrezFetcher::doSummary() {
#ifdef ENTREZ_TEST
- KURL u = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/esummary.xml"));
+ KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/esummary.xml"));
#else
- KURL u(QString::fromLatin1(ENTREZ_BASE_URL));
- u.addPath(QString::fromLatin1(ENTREZ_SUMMARY_CGI));
- u.addQueryItem(QString::fromLatin1("tool"), QString::fromLatin1("Tellico"));
- u.addQueryItem(QString::fromLatin1("retmode"), QString::fromLatin1("xml"));
- u.addQueryItem(QString::fromLatin1("retstart"), QString::number(m_start));
- u.addQueryItem(QString::fromLatin1("retmax"), QString::number(QMIN(m_total-m_start-1, ENTREZ_MAX_RETURNS_TOTAL)));
- u.addQueryItem(QString::fromLatin1("usehistory"), QString::fromLatin1("y"));
- u.addQueryItem(QString::fromLatin1("db"), m_dbname);
- u.addQueryItem(QString::fromLatin1("query_key"), m_queryKey);
- u.addQueryItem(QString::fromLatin1("WebEnv"), m_webEnv);
+ KURL u(TQString::tqfromLatin1(ENTREZ_BASE_URL));
+ u.addPath(TQString::tqfromLatin1(ENTREZ_SUMMARY_CGI));
+ u.addQueryItem(TQString::tqfromLatin1("tool"), TQString::tqfromLatin1("Tellico"));
+ u.addQueryItem(TQString::tqfromLatin1("retmode"), TQString::tqfromLatin1("xml"));
+ u.addQueryItem(TQString::tqfromLatin1("retstart"), TQString::number(m_start));
+ u.addQueryItem(TQString::tqfromLatin1("retmax"), TQString::number(TQMIN(m_total-m_start-1, ENTREZ_MAX_RETURNS_TOTAL)));
+ u.addQueryItem(TQString::tqfromLatin1("usehistory"), TQString::tqfromLatin1("y"));
+ u.addQueryItem(TQString::tqfromLatin1("db"), m_dbname);
+ u.addQueryItem(TQString::tqfromLatin1("query_key"), m_queryKey);
+ u.addQueryItem(TQString::tqfromLatin1("WebEnv"), m_webEnv);
#endif
m_step = Summary;
// myLog() << "EntrezFetcher::searchResults() - url: " << u.url() << endl;
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void EntrezFetcher::summaryResults() {
- QDomDocument dom;
+ TQDomDocument dom;
if(!dom.setContent(m_data, false)) {
kdWarning() << "EntrezFetcher::summaryResults() - server did not return valid XML." << endl;
stop();
return;
}
// top child is eSummaryResult
- // all children are DocSum
- for(QDomNode n = dom.documentElement().firstChild(); !n.isNull(); n = n.nextSibling()) {
- QDomElement e = n.toElement();
+ // all tqchildren are DocSum
+ for(TQDomNode n = dom.documentElement().firstChild(); !n.isNull(); n = n.nextSibling()) {
+ TQDomElement e = n.toElement();
if(e.isNull() || e.tagName() != Latin1Literal("DocSum")) {
continue;
}
- QDomNodeList nodes = e.elementsByTagName(QString::fromLatin1("Id"));
+ TQDomNodeList nodes = e.elementsByTagName(TQString::tqfromLatin1("Id"));
if(nodes.count() == 0) {
myDebug() << "EntrezFetcher::summaryResults() - no Id elements" << endl;
continue;
}
int id = nodes.item(0).toElement().text().toInt();
- QString title, pubdate, authors;
- nodes = e.elementsByTagName(QString::fromLatin1("Item"));
+ TQString title, pubdate, authors;
+ nodes = e.elementsByTagName(TQString::tqfromLatin1("Item"));
for(uint j = 0; j < nodes.count(); ++j) {
- if(nodes.item(j).toElement().attribute(QString::fromLatin1("Name")) == Latin1Literal("Title")) {
+ if(nodes.item(j).toElement().attribute(TQString::tqfromLatin1("Name")) == Latin1Literal("Title")) {
title = nodes.item(j).toElement().text();
- } else if(nodes.item(j).toElement().attribute(QString::fromLatin1("Name")) == Latin1Literal("PubDate")) {
+ } else if(nodes.item(j).toElement().attribute(TQString::tqfromLatin1("Name")) == Latin1Literal("PubDate")) {
pubdate = nodes.item(j).toElement().text();
- } else if(nodes.item(j).toElement().attribute(QString::fromLatin1("Name")) == Latin1Literal("AuthorList")) {
- QStringList list;
- for(QDomNode aNode = nodes.item(j).firstChild(); !aNode.isNull(); aNode = aNode.nextSibling()) {
- // lazy, assume all children Items are authors
+ } else if(nodes.item(j).toElement().attribute(TQString::tqfromLatin1("Name")) == Latin1Literal("AuthorList")) {
+ TQStringList list;
+ for(TQDomNode aNode = nodes.item(j).firstChild(); !aNode.isNull(); aNode = aNode.nextSibling()) {
+ // lazy, assume all tqchildren Items are authors
if(aNode.nodeName() == Latin1Literal("Item")) {
list << aNode.toElement().text();
}
}
- authors = list.join(QString::fromLatin1("; "));
+ authors = list.join(TQString::tqfromLatin1("; "));
}
if(!title.isEmpty() && !pubdate.isEmpty() && !authors.isEmpty()) {
break; // done now
}
}
- SearchResult* r = new SearchResult(this, title, pubdate + '/' + authors, QString());
+ SearchResult* r = new SearchResult(this, title, pubdate + '/' + authors, TQString());
m_matches.insert(r->uid, id);
emit signalResultFound(r);
}
@@ -319,7 +319,7 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) {
return entry;
}
- if(!m_matches.contains(uid_)) {
+ if(!m_matches.tqcontains(uid_)) {
return 0;
}
@@ -333,33 +333,33 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) {
int id = m_matches[uid_];
#ifdef ENTREZ_TEST
- KURL u = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/pubmed.xml"));
+ KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/pubmed.xml"));
#else
- KURL u(QString::fromLatin1(ENTREZ_BASE_URL));
- u.addPath(QString::fromLatin1(ENTREZ_FETCH_CGI));
- u.addQueryItem(QString::fromLatin1("tool"), QString::fromLatin1("Tellico"));
- u.addQueryItem(QString::fromLatin1("retmode"), QString::fromLatin1("xml"));
- u.addQueryItem(QString::fromLatin1("rettype"), QString::fromLatin1("abstract"));
- u.addQueryItem(QString::fromLatin1("db"), m_dbname);
- u.addQueryItem(QString::fromLatin1("id"), QString::number(id));
+ KURL u(TQString::tqfromLatin1(ENTREZ_BASE_URL));
+ u.addPath(TQString::tqfromLatin1(ENTREZ_FETCH_CGI));
+ u.addQueryItem(TQString::tqfromLatin1("tool"), TQString::tqfromLatin1("Tellico"));
+ u.addQueryItem(TQString::tqfromLatin1("retmode"), TQString::tqfromLatin1("xml"));
+ u.addQueryItem(TQString::tqfromLatin1("rettype"), TQString::tqfromLatin1("abstract"));
+ u.addQueryItem(TQString::tqfromLatin1("db"), m_dbname);
+ u.addQueryItem(TQString::tqfromLatin1("id"), TQString::number(id));
#endif
// now it's sychronous, and we know that it's utf8
- QString xmlOutput = FileHandler::readTextFile(u, false /*quiet*/, true /*utf8*/);
+ TQString xmlOutput = FileHandler::readTextFile(u, false /*quiet*/, true /*utf8*/);
if(xmlOutput.isEmpty()) {
kdWarning() << "EntrezFetcher::fetchEntry() - unable to download " << u << endl;
return 0;
}
#if 0
kdWarning() << "EntrezFetcher::fetchEntry() - turn me off!" << endl;
- QFile f1(QString::fromLatin1("/tmp/test-entry.xml"));
+ TQFile f1(TQString::tqfromLatin1("/tmp/test-entry.xml"));
if(f1.open(IO_WriteOnly)) {
- QTextStream t(&f1);
- t.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream t(&f1);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
t << xmlOutput;
}
f1.close();
#endif
- QString str = m_xsltHandler->applyStylesheet(xmlOutput);
+ TQString str = m_xsltHandler->applyStylesheet(xmlOutput);
Import::TellicoImporter imp(str);
Data::CollPtr coll = imp.collection();
if(!coll) {
@@ -376,40 +376,40 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) {
Data::EntryPtr e = coll->entries().front();
// try to get a link, but only if necessary
- if(m_fields.contains(QString::fromLatin1("url"))) {
- KURL link(QString::fromLatin1(ENTREZ_BASE_URL));
- link.addPath(QString::fromLatin1(ENTREZ_LINK_CGI));
- link.addQueryItem(QString::fromLatin1("tool"), QString::fromLatin1("Tellico"));
- link.addQueryItem(QString::fromLatin1("cmd"), QString::fromLatin1("llinks"));
- link.addQueryItem(QString::fromLatin1("db"), m_dbname);
- link.addQueryItem(QString::fromLatin1("dbfrom"), m_dbname);
- link.addQueryItem(QString::fromLatin1("id"), QString::number(id));
-
- QDomDocument linkDom = FileHandler::readXMLFile(link, false /* namespace */, true /* quiet */);
+ if(m_fields.tqcontains(TQString::tqfromLatin1("url"))) {
+ KURL link(TQString::tqfromLatin1(ENTREZ_BASE_URL));
+ link.addPath(TQString::tqfromLatin1(ENTREZ_LINK_CGI));
+ link.addQueryItem(TQString::tqfromLatin1("tool"), TQString::tqfromLatin1("Tellico"));
+ link.addQueryItem(TQString::tqfromLatin1("cmd"), TQString::tqfromLatin1("llinks"));
+ link.addQueryItem(TQString::tqfromLatin1("db"), m_dbname);
+ link.addQueryItem(TQString::tqfromLatin1("dbfrom"), m_dbname);
+ link.addQueryItem(TQString::tqfromLatin1("id"), TQString::number(id));
+
+ TQDomDocument linkDom = FileHandler::readXMLFile(link, false /* namespace */, true /* quiet */);
// need eLinkResult/LinkSet/IdUrlList/IdUrlSet/ObjUrl/Url
- QDomNode linkNode = linkDom.namedItem(QString::fromLatin1("eLinkResult"))
- .namedItem(QString::fromLatin1("LinkSet"))
- .namedItem(QString::fromLatin1("IdUrlList"))
- .namedItem(QString::fromLatin1("IdUrlSet"))
- .namedItem(QString::fromLatin1("ObjUrl"))
- .namedItem(QString::fromLatin1("Url"));
+ TQDomNode linkNode = linkDom.namedItem(TQString::tqfromLatin1("eLinkResult"))
+ .namedItem(TQString::tqfromLatin1("LinkSet"))
+ .namedItem(TQString::tqfromLatin1("IdUrlList"))
+ .namedItem(TQString::tqfromLatin1("IdUrlSet"))
+ .namedItem(TQString::tqfromLatin1("ObjUrl"))
+ .namedItem(TQString::tqfromLatin1("Url"));
if(!linkNode.isNull()) {
- QString u = linkNode.toElement().text();
+ TQString u = linkNode.toElement().text();
// myDebug() << u << endl;
if(!u.isEmpty()) {
- if(!coll->hasField(QString::fromLatin1("url"))) {
- Data::FieldPtr field = new Data::Field(QString::fromLatin1("url"), i18n("URL"), Data::Field::URL);
+ if(!coll->hasField(TQString::tqfromLatin1("url"))) {
+ Data::FieldPtr field = new Data::Field(TQString::tqfromLatin1("url"), i18n("URL"), Data::Field::URL);
field->setCategory(i18n("Miscellaneous"));
coll->addField(field);
}
- e->setField(QString::fromLatin1("url"), u);
+ e->setField(TQString::tqfromLatin1("url"), u);
}
}
}
const StringMap customFields = EntrezFetcher::customFields();
for(StringMap::ConstIterator it = customFields.begin(); it != customFields.end(); ++it) {
- if(!m_fields.contains(it.key())) {
+ if(!m_fields.tqcontains(it.key())) {
coll->removeField(it.key());
}
}
@@ -419,7 +419,7 @@ Tellico::Data::EntryPtr EntrezFetcher::fetchEntry(uint uid_) {
}
void EntrezFetcher::initXSLTHandler() {
- QString xsltfile = locate("appdata", QString::fromLatin1("pubmed2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("pubmed2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "EntrezFetcher::initXSLTHandler() - can not locate pubmed2tellico.xsl." << endl;
return;
@@ -441,19 +441,19 @@ void EntrezFetcher::initXSLTHandler() {
void EntrezFetcher::updateEntry(Data::EntryPtr entry_) {
// myDebug() << "EntrezFetcher::updateEntry()" << endl;
- QString s = entry_->field(QString::fromLatin1("pmid"));
+ TQString s = entry_->field(TQString::tqfromLatin1("pmid"));
if(!s.isEmpty()) {
search(PubmedID, s);
return;
}
- s = entry_->field(QString::fromLatin1("doi"));
+ s = entry_->field(TQString::tqfromLatin1("doi"));
if(!s.isEmpty()) {
search(DOI, s);
return;
}
- s = entry_->field(QString::fromLatin1("title"));
+ s = entry_->field(TQString::tqfromLatin1("title"));
if(!s.isEmpty()) {
search(Title, s);
return;
@@ -463,18 +463,18 @@ void EntrezFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* EntrezFetcher::configWidget(QWidget* parent_) const {
- return new EntrezFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* EntrezFetcher::configWidget(TQWidget* tqparent_) const {
+ return new EntrezFetcher::ConfigWidget(tqparent_, this);
}
-EntrezFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const EntrezFetcher* fetcher_/*=0*/)
- : Fetch::ConfigWidget(parent_) {
- QVBoxLayout* l = new QVBoxLayout(optionsWidget());
- l->addWidget(new QLabel(i18n("This source has no options."), optionsWidget()));
+EntrezFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const EntrezFetcher* fetcher_/*=0*/)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQVBoxLayout* l = new TQVBoxLayout(optionsWidget());
+ l->addWidget(new TQLabel(i18n("This source has no options."), optionsWidget()));
l->addStretch();
// now add additional fields widget
- addFieldsWidget(EntrezFetcher::customFields(), fetcher_ ? fetcher_->m_fields : QStringList());
+ addFieldsWidget(EntrezFetcher::customFields(), fetcher_ ? fetcher_->m_fields : TQStringList());
}
void EntrezFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
@@ -482,16 +482,16 @@ void EntrezFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
slotSetModified(false);
}
-QString EntrezFetcher::ConfigWidget::preferredName() const {
+TQString EntrezFetcher::ConfigWidget::preferredName() const {
return EntrezFetcher::defaultName();
}
//static
Tellico::StringMap EntrezFetcher::customFields() {
StringMap map;
- map[QString::fromLatin1("institution")] = i18n("Institution");
- map[QString::fromLatin1("abstract")] = i18n("Abstract");
- map[QString::fromLatin1("url")] = i18n("URL");
+ map[TQString::tqfromLatin1("institution")] = i18n("Institution");
+ map[TQString::tqfromLatin1("abstract")] = i18n("Abstract");
+ map[TQString::tqfromLatin1("url")] = i18n("URL");
return map;
}
diff --git a/src/fetch/entrezfetcher.h b/src/fetch/entrezfetcher.h
index c8aac49..bd94fdc 100644
--- a/src/fetch/entrezfetcher.h
+++ b/src/fetch/entrezfetcher.h
@@ -22,8 +22,8 @@ namespace Tellico {
#include "configwidget.h"
#include "../datavectors.h"
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
namespace KIO {
class Job;
@@ -37,18 +37,19 @@ namespace Tellico {
*/
class EntrezFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- EntrezFetcher(QObject* parent, const char* name=0);
+ EntrezFetcher(TQObject* tqparent, const char* name=0);
/**
*/
virtual ~EntrezFetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
// pubmed can search title, person, and keyword
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person || k == Keyword || k == Raw || k == PubmedID || k == DOI; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void continueSearch();
virtual void stop();
virtual Data::EntryPtr fetchEntry(uint uid);
@@ -56,22 +57,22 @@ public:
virtual bool canFetch(int type) const;
virtual void readConfigHook(const KConfigGroup& config);
virtual void updateEntry(Data::EntryPtr entry);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
static StringMap customFields();
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_, const EntrezFetcher* fetcher=0);
+ ConfigWidget(TQWidget* tqparent_, const EntrezFetcher* fetcher=0);
virtual void saveConfig(KConfigGroup& config);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
@@ -89,22 +90,22 @@ private:
};
XSLTHandler* m_xsltHandler;
- QString m_dbname;
+ TQString m_dbname;
int m_start;
int m_total;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries; // map from search result id to entry
- QMap<int, int> m_matches; // search result id to pubmed id
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries; // map from search result id to entry
+ TQMap<int, int> m_matches; // search result id to pubmed id
+ TQGuardedPtr<KIO::Job> m_job;
- QString m_queryKey;
- QString m_webEnv;
+ TQString m_queryKey;
+ TQString m_webEnv;
Step m_step;
bool m_started;
- QStringList m_fields;
+ TQStringList m_fields;
};
} // end namespace
diff --git a/src/fetch/execexternalfetcher.cpp b/src/fetch/execexternalfetcher.cpp
index 07b99d8..88f8cd5 100644
--- a/src/fetch/execexternalfetcher.cpp
+++ b/src/fetch/execexternalfetcher.cpp
@@ -31,38 +31,38 @@
#include <kurlrequester.h>
#include <kaccelmanager.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qwhatsthis.h>
-#include <qregexp.h>
-#include <qvgroupbox.h>
-#include <qfile.h> // needed for QFile::remove
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqwhatsthis.h>
+#include <tqregexp.h>
+#include <tqvgroupbox.h>
+#include <tqfile.h> // needed for TQFile::remove
using Tellico::Fetch::ExecExternalFetcher;
-QStringList ExecExternalFetcher::parseArguments(const QString& str_) {
+TQStringList ExecExternalFetcher::parseArguments(const TQString& str_) {
// matching escaped quotes is too hard... :(
-// QRegExp quotes(QString::fromLatin1("[^\\\\](['\"])(.*[^\\\\])\\1"));
- QRegExp quotes(QString::fromLatin1("(['\"])(.*)\\1"));
+// TQRegExp quotes(TQString::tqfromLatin1("[^\\\\](['\"])(.*[^\\\\])\\1"));
+ TQRegExp quotes(TQString::tqfromLatin1("(['\"])(.*)\\1"));
quotes.setMinimal(true);
- QRegExp spaces(QString::fromLatin1("\\s+"));
+ TQRegExp spaces(TQString::tqfromLatin1("\\s+"));
spaces.setMinimal(true);
- QStringList args;
+ TQStringList args;
int pos = 0;
for(int nextPos = quotes.search(str_); nextPos > -1; pos = nextPos+1, nextPos = quotes.search(str_, pos)) {
// a non-quotes arguments runs from pos to nextPos
- args += QStringList::split(spaces, str_.mid(pos, nextPos-pos));
+ args += TQStringList::split(spaces, str_.mid(pos, nextPos-pos));
// move nextpos marker to end of match
pos = quotes.pos(2); // skip quotation mark
nextPos += quotes.matchedLength();
args += str_.mid(pos, nextPos-pos-1);
}
// catch the end stuff
- args += QStringList::split(spaces, str_.mid(pos));
+ args += TQStringList::split(spaces, str_.mid(pos));
#if 0
- for(QStringList::ConstIterator it = args.begin(); it != args.end(); ++it) {
+ for(TQStringList::ConstIterator it = args.begin(); it != args.end(); ++it) {
myDebug() << *it << endl;
}
#endif
@@ -70,7 +70,7 @@ QStringList ExecExternalFetcher::parseArguments(const QString& str_) {
return args;
}
-ExecExternalFetcher::ExecExternalFetcher(QObject* parent_, const char* name_/*=0*/) : Fetcher(parent_, name_),
+ExecExternalFetcher::ExecExternalFetcher(TQObject* tqparent_, const char* name_/*=0*/) : Fetcher(tqparent_, name_),
m_started(false), m_collType(-1), m_formatType(-1), m_canUpdate(false), m_process(0), m_deleteOnRemove(false) {
}
@@ -78,11 +78,11 @@ ExecExternalFetcher::~ExecExternalFetcher() {
stop();
}
-QString ExecExternalFetcher::defaultName() {
+TQString ExecExternalFetcher::defaultName() {
return i18n("External Application");
}
-QString ExecExternalFetcher::source() const {
+TQString ExecExternalFetcher::source() const {
return m_name;
}
@@ -91,21 +91,21 @@ bool ExecExternalFetcher::canFetch(int type_) const {
}
void ExecExternalFetcher::readConfigHook(const KConfigGroup& config_) {
- QString s = config_.readPathEntry("ExecPath");
+ TQString s = config_.readPathEntry("ExecPath");
if(!s.isEmpty()) {
m_path = s;
}
- QValueList<int> il;
+ TQValueList<int> il;
if(config_.hasKey("ArgumentKeys")) {
il = config_.readIntListEntry("ArgumentKeys");
} else {
il.append(Keyword);
}
- QStringList sl = config_.readListEntry("Arguments");
+ TQStringList sl = config_.readListEntry("Arguments");
if(il.count() != sl.count()) {
kdWarning() << "ExecExternalFetcher::readConfig() - unequal number of arguments and keys" << endl;
}
- int n = QMIN(il.count(), sl.count());
+ int n = TQMIN(il.count(), sl.count());
for(int i = 0; i < n; ++i) {
m_args[static_cast<FetchKey>(il[i])] = sl[i];
}
@@ -121,10 +121,10 @@ void ExecExternalFetcher::readConfigHook(const KConfigGroup& config_) {
m_newStuffName = config_.readEntry("NewStuffName");
}
-void ExecExternalFetcher::search(FetchKey key_, const QString& value_) {
+void ExecExternalFetcher::search(FetchKey key_, const TQString& value_) {
m_started = true;
- if(!m_args.contains(key_)) {
+ if(!m_args.tqcontains(key_)) {
stop();
return;
}
@@ -134,22 +134,22 @@ void ExecExternalFetcher::search(FetchKey key_, const QString& value_) {
// the search value needs to be enclosed in quotation marks
// but first check to make sure the user didn't do that already
// AND the "%1" wasn't used in the settings
- QString value = value_;
+ TQString value = value_;
if(key_ == ISBN) {
value.remove('-'); // remove hyphens from isbn values
// shouldn't hurt and might keep from confusing stupid search sources
}
- QRegExp rx1(QString::fromLatin1("['\"].*\\1"));
+ TQRegExp rx1(TQString::tqfromLatin1("['\"].*\\1"));
if(!rx1.exactMatch(value)) {
value.prepend('"').append('"');
}
- QString args = m_args[key_];
- QRegExp rx2(QString::fromLatin1("['\"]%1\\1"));
- args.replace(rx2, QString::fromLatin1("%1"));
- startSearch(parseArguments(args.arg(value))); // replace %1 with search value
+ TQString args = m_args[key_];
+ TQRegExp rx2(TQString::tqfromLatin1("['\"]%1\\1"));
+ args.tqreplace(rx2, TQString::tqfromLatin1("%1"));
+ startSearch(parseArguments(args.tqarg(value))); // tqreplace %1 with search value
}
-void ExecExternalFetcher::startSearch(const QStringList& args_) {
+void ExecExternalFetcher::startSearch(const TQStringList& args_) {
if(m_path.isEmpty()) {
stop();
return;
@@ -157,15 +157,15 @@ void ExecExternalFetcher::startSearch(const QStringList& args_) {
#if 0
myDebug() << m_path << endl;
- for(QStringList::ConstIterator it = args_.begin(); it != args_.end(); ++it) {
+ for(TQStringList::ConstIterator it = args_.begin(); it != args_.end(); ++it) {
myDebug() << " " << *it << endl;
}
#endif
m_process = new KProcess();
- connect(m_process, SIGNAL(receivedStdout(KProcess*, char*, int)), SLOT(slotData(KProcess*, char*, int)));
- connect(m_process, SIGNAL(receivedStderr(KProcess*, char*, int)), SLOT(slotError(KProcess*, char*, int)));
- connect(m_process, SIGNAL(processExited(KProcess*)), SLOT(slotProcessExited(KProcess*)));
+ connect(m_process, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), TQT_SLOT(slotData(KProcess*, char*, int)));
+ connect(m_process, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), TQT_SLOT(slotError(KProcess*, char*, int)));
+ connect(m_process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(slotProcessExited(KProcess*)));
*m_process << m_path << args_;
if(!m_process->start(KProcess::NotifyOnExit, KProcess::AllOutput)) {
myDebug() << "ExecExternalFetcher::startSearch() - process failed to start" << endl;
@@ -189,15 +189,15 @@ void ExecExternalFetcher::stop() {
}
void ExecExternalFetcher::slotData(KProcess*, char* buffer_, int len_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(buffer_, len_);
}
void ExecExternalFetcher::slotError(KProcess*, char* buffer_, int len_) {
- GUI::CursorSaver cs(Qt::arrowCursor);
- QString msg = QString::fromLocal8Bit(buffer_, len_);
- msg.prepend(source() + QString::fromLatin1(": "));
- if(msg.endsWith(QChar('\n'))) {
+ GUI::CursorSaver cs(TQt::arrowCursor);
+ TQString msg = TQString::fromLocal8Bit(buffer_, len_);
+ msg.prepend(source() + TQString::tqfromLatin1(": "));
+ if(msg.endsWith(TQChar('\n'))) {
msg.truncate(msg.length()-1);
}
myDebug() << "ExecExternalFetcher::slotError() - " << msg << endl;
@@ -209,13 +209,13 @@ void ExecExternalFetcher::slotProcessExited(KProcess*) {
if(!m_process->normalExit() || m_process->exitStatus()) {
myDebug() << "ExecExternalFetcher::slotProcessExited() - "<< source() << ": process did not exit successfully" << endl;
if(!m_errors.isEmpty()) {
- message(m_errors.join(QChar('\n')), MessageHandler::Error);
+ message(m_errors.join(TQChar('\n')), MessageHandler::Error);
}
stop();
return;
}
if(!m_errors.isEmpty()) {
- message(m_errors.join(QChar('\n')), MessageHandler::Warning);
+ message(m_errors.join(TQChar('\n')), MessageHandler::Warning);
}
if(m_data.isEmpty()) {
@@ -231,11 +231,11 @@ void ExecExternalFetcher::slotProcessExited(KProcess*) {
return;
}
- imp->setText(QString::fromUtf8(m_data, m_data.size()));
+ imp->setText(TQString::fromUtf8(m_data, m_data.size()));
Data::CollPtr coll = imp->collection();
if(!coll) {
if(!imp->statusMessage().isEmpty()) {
- message(imp->statusMessage(), MessageHandler::Status);
+ message(imp->statusMessage(), MessageHandler::tqStatus);
}
myDebug() << "ExecExternalFetcher::slotProcessExited() - "<< source() << ": no collection pointer" << endl;
delete imp;
@@ -252,60 +252,60 @@ void ExecExternalFetcher::slotProcessExited(KProcess*) {
Data::EntryVec entries = coll->entries();
for(Data::EntryVec::Iterator entry = entries.begin(); entry != entries.end(); ++entry) {
- QString desc;
+ TQString desc;
switch(coll->type()) {
case Data::Collection::Book:
case Data::Collection::Bibtex:
- desc = entry->field(QString::fromLatin1("author"))
- + QChar('/')
- + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("cr_year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("cr_year"));
- } else if(!entry->field(QString::fromLatin1("pub_year")).isEmpty()){
- desc += QChar('/') + entry->field(QString::fromLatin1("pub_year"));
+ desc = entry->field(TQString::tqfromLatin1("author"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("cr_year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("cr_year"));
+ } else if(!entry->field(TQString::tqfromLatin1("pub_year")).isEmpty()){
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("pub_year"));
}
break;
case Data::Collection::Video:
- desc = entry->field(QString::fromLatin1("studio"))
- + QChar('/')
- + entry->field(QString::fromLatin1("director"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"))
- + QChar('/')
- + entry->field(QString::fromLatin1("medium"));
+ desc = entry->field(TQString::tqfromLatin1("studio"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("director"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("medium"));
break;
case Data::Collection::Album:
- desc = entry->field(QString::fromLatin1("artist"))
- + QChar('/')
- + entry->field(QString::fromLatin1("label"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"));
+ desc = entry->field(TQString::tqfromLatin1("artist"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("label"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"));
break;
case Data::Collection::Game:
- desc = entry->field(QString::fromLatin1("platform"));
+ desc = entry->field(TQString::tqfromLatin1("platform"));
break;
case Data::Collection::ComicBook:
- desc = entry->field(QString::fromLatin1("publisher"))
- + QChar('/')
- + entry->field(QString::fromLatin1("pub_year"));
+ desc = entry->field(TQString::tqfromLatin1("publisher"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("pub_year"));
break;
case Data::Collection::BoardGame:
- desc = entry->field(QString::fromLatin1("designer"))
- + QChar('/')
- + entry->field(QString::fromLatin1("publisher"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"));
+ desc = entry->field(TQString::tqfromLatin1("designer"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("publisher"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"));
break;
default:
break;
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, entry);
emit signalResultFound(r);
}
@@ -324,36 +324,36 @@ void ExecExternalFetcher::updateEntry(Data::EntryPtr entry_) {
m_started = true;
Data::ConstEntryPtr e(entry_.data());
- QStringList args = parseArguments(m_updateArgs);
- for(QStringList::Iterator it = args.begin(); it != args.end(); ++it) {
+ TQStringList args = parseArguments(m_updateArgs);
+ for(TQStringList::Iterator it = args.begin(); it != args.end(); ++it) {
*it = Data::Entry::dependentValue(e, *it, false);
}
startSearch(args);
}
-Tellico::Fetch::ConfigWidget* ExecExternalFetcher::configWidget(QWidget* parent_) const {
- return new ExecExternalFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* ExecExternalFetcher::configWidget(TQWidget* tqparent_) const {
+ return new ExecExternalFetcher::ConfigWidget(tqparent_, this);
}
-ExecExternalFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const ExecExternalFetcher* fetcher_/*=0*/)
- : Fetch::ConfigWidget(parent_), m_deleteOnRemove(false) {
- QGridLayout* l = new QGridLayout(optionsWidget(), 5, 2);
+ExecExternalFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const ExecExternalFetcher* fetcher_/*=0*/)
+ : Fetch::ConfigWidget(tqparent_), m_deleteOnRemove(false) {
+ TQGridLayout* l = new TQGridLayout(optionsWidget(), 5, 2);
l->setSpacing(4);
l->setColStretch(1, 10);
int row = -1;
- QLabel* label = new QLabel(i18n("Collection &type:"), optionsWidget());
+ TQLabel* label = new TQLabel(i18n("Collection &type:"), optionsWidget());
l->addWidget(label, ++row, 0);
m_collCombo = new GUI::CollectionTypeCombo(optionsWidget());
- connect(m_collCombo, SIGNAL(activated(int)), SLOT(slotSetModified()));
+ connect(m_collCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetModified()));
l->addWidget(m_collCombo, row, 1);
- QString w = i18n("Set the collection type of the data returned from the external application.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_collCombo, w);
+ TQString w = i18n("Set the collection type of the data returned from the external application.");
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_collCombo, w);
label->setBuddy(m_collCombo);
- label = new QLabel(i18n("&Result type: "), optionsWidget());
+ label = new TQLabel(i18n("&Result type: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_formatCombo = new GUI::ComboBox(optionsWidget());
Import::FormatMap formatMap = ImportDialog::formatMap();
@@ -362,30 +362,30 @@ ExecExternalFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const ExecExte
m_formatCombo->insertItem(it.data(), it.key());
}
}
- connect(m_formatCombo, SIGNAL(activated(int)), SLOT(slotSetModified()));
+ connect(m_formatCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetModified()));
l->addWidget(m_formatCombo, row, 1);
w = i18n("Set the result type of the data returned from the external application.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_formatCombo, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_formatCombo, w);
label->setBuddy(m_formatCombo);
- label = new QLabel(i18n("Application &path: "), optionsWidget());
+ label = new TQLabel(i18n("Application &path: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_pathEdit = new KURLRequester(optionsWidget());
- connect(m_pathEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ connect(m_pathEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_pathEdit, row, 1);
w = i18n("Set the path of the application to run that should output a valid Tellico data file.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_pathEdit, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_pathEdit, w);
label->setBuddy(m_pathEdit);
w = i18n("Select the search keys supported by the data source.");
- QString w2 = i18n("Add any arguments that may be needed. <b>%1</b> will be replaced by the search term.");
- QVGroupBox* box = new QVGroupBox(i18n("Arguments"), optionsWidget());
+ TQString w2 = i18n("Add any arguments that may be needed. <b>%1</b> will be replaced by the search term.");
+ TQVGroupBox* box = new TQVGroupBox(i18n("Arguments"), optionsWidget());
++row;
l->addMultiCellWidget(box, row, row, 0, 1);
- QWidget* grid = new QWidget(box);
- QGridLayout* gridLayout = new QGridLayout(grid);
+ TQWidget* grid = new TQWidget(box);
+ TQGridLayout* gridLayout = new TQGridLayout(grid);
gridLayout->setSpacing(2);
row = -1;
const Fetch::KeyMap keyMap = Fetch::Manager::self()->keyMap();
@@ -394,15 +394,15 @@ ExecExternalFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const ExecExte
if(key == Raw) {
continue;
}
- QCheckBox* cb = new QCheckBox(it.data(), grid);
+ TQCheckBox* cb = new TQCheckBox(it.data(), grid);
gridLayout->addWidget(cb, ++row, 0);
m_cbDict.insert(key, cb);
GUI::LineEdit* le = new GUI::LineEdit(grid);
- le->setHint(QString::fromLatin1("%1")); // for example
- le->completionObject()->addItem(QString::fromLatin1("%1"));
+ le->setHint(TQString::tqfromLatin1("%1")); // for example
+ le->completionObject()->addItem(TQString::tqfromLatin1("%1"));
gridLayout->addWidget(le, row, 1);
m_leDict.insert(key, le);
- if(fetcher_ && fetcher_->m_args.contains(key)) {
+ if(fetcher_ && fetcher_->m_args.tqcontains(key)) {
cb->setChecked(true);
le->setEnabled(true);
le->setText(fetcher_->m_args[key]);
@@ -410,23 +410,23 @@ ExecExternalFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const ExecExte
cb->setChecked(false);
le->setEnabled(false);
}
- connect(cb, SIGNAL(toggled(bool)), le, SLOT(setEnabled(bool)));
- QWhatsThis::add(cb, w);
- QWhatsThis::add(le, w2);
+ connect(cb, TQT_SIGNAL(toggled(bool)), le, TQT_SLOT(setEnabled(bool)));
+ TQWhatsThis::add(cb, w);
+ TQWhatsThis::add(le, w2);
}
- m_cbUpdate = new QCheckBox(i18n("Update"), grid);
+ m_cbUpdate = new TQCheckBox(i18n("Update"), grid);
gridLayout->addWidget(m_cbUpdate, ++row, 0);
m_leUpdate = new GUI::LineEdit(grid);
- m_leUpdate->setHint(QString::fromLatin1("%{title}")); // for example
- m_leUpdate->completionObject()->addItem(QString::fromLatin1("%{title}"));
- m_leUpdate->completionObject()->addItem(QString::fromLatin1("%{isbn}"));
+ m_leUpdate->setHint(TQString::tqfromLatin1("%{title}")); // for example
+ m_leUpdate->completionObject()->addItem(TQString::tqfromLatin1("%{title}"));
+ m_leUpdate->completionObject()->addItem(TQString::tqfromLatin1("%{isbn}"));
gridLayout->addWidget(m_leUpdate, row, 1);
/* TRANSLATORS: Do not translate %{author}. */
w2 = i18n("<p>Enter the arguments which should be used to search for available updates to an entry.</p><p>"
"The format is the same as for <i>Dependent</i> fields, where field values "
"are contained inside braces, such as <i>%{author}</i>. See the documentation for details.</p>");
- QWhatsThis::add(m_cbUpdate, w);
- QWhatsThis::add(m_leUpdate, w2);
+ TQWhatsThis::add(m_cbUpdate, w);
+ TQWhatsThis::add(m_leUpdate, w2);
if(fetcher_ && fetcher_->m_canUpdate) {
m_cbUpdate->setChecked(true);
m_leUpdate->setEnabled(true);
@@ -435,7 +435,7 @@ ExecExternalFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const ExecExte
m_cbUpdate->setChecked(false);
m_leUpdate->setEnabled(false);
}
- connect(m_cbUpdate, SIGNAL(toggled(bool)), m_leUpdate, SLOT(setEnabled(bool)));
+ connect(m_cbUpdate, TQT_SIGNAL(toggled(bool)), m_leUpdate, TQT_SLOT(setEnabled(bool)));
l->setRowStretch(++row, 1);
@@ -462,25 +462,25 @@ ExecExternalFetcher::ConfigWidget::~ConfigWidget() {
void ExecExternalFetcher::ConfigWidget::readConfig(KConfig* config_) {
m_pathEdit->setURL(config_->readPathEntry("ExecPath"));
- QValueList<int> argKeys = config_->readIntListEntry("ArgumentKeys");
- QStringList argValues = config_->readListEntry("Arguments");
+ TQValueList<int> argKeys = config_->readIntListEntry("ArgumentKeys");
+ TQStringList argValues = config_->readListEntry("Arguments");
if(argKeys.count() != argValues.count()) {
kdWarning() << "ExecExternalFetcher::ConfigWidget::readConfig() - unequal number of arguments and keys" << endl;
}
- int n = QMIN(argKeys.count(), argValues.count());
- QMap<FetchKey, QString> args;
+ int n = TQMIN(argKeys.count(), argValues.count());
+ TQMap<FetchKey, TQString> args;
for(int i = 0; i < n; ++i) {
args[static_cast<FetchKey>(argKeys[i])] = argValues[i];
}
- for(QValueList<int>::Iterator it = argKeys.begin(); it != argKeys.end(); ++it) {
+ for(TQValueList<int>::Iterator it = argKeys.begin(); it != argKeys.end(); ++it) {
if(*it == Raw) {
continue;
}
FetchKey key = static_cast<FetchKey>(*it);
- QCheckBox* cb = m_cbDict[key];
+ TQCheckBox* cb = m_cbDict[key];
KLineEdit* le = m_leDict[key];
if(cb && le) {
- if(args.contains(key)) {
+ if(args.tqcontains(key)) {
cb->setChecked(true);
le->setEnabled(true);
le->setText(args[key]);
@@ -514,13 +514,13 @@ void ExecExternalFetcher::ConfigWidget::readConfig(KConfig* config_) {
}
void ExecExternalFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
- QString s = m_pathEdit->url();
+ TQString s = m_pathEdit->url();
if(!s.isEmpty()) {
config_.writePathEntry("ExecPath", s);
}
- QValueList<int> keys;
- QStringList args;
- for(QIntDictIterator<QCheckBox> it(m_cbDict); it.current(); ++it) {
+ TQValueList<int> keys;
+ TQStringList args;
+ for(TQIntDictIterator<TQCheckBox> it(m_cbDict); it.current(); ++it) {
if(it.current()->isChecked()) {
keys << it.currentKey();
args << m_leDict[it.currentKey()]->text();
@@ -549,12 +549,12 @@ void ExecExternalFetcher::ConfigWidget::removed() {
return;
}
if(!m_newStuffName.isEmpty()) {
- NewStuff::Manager man(this);
+ NewStuff::Manager man(TQT_TQOBJECT(this));
man.removeScript(m_newStuffName);
}
}
-QString ExecExternalFetcher::ConfigWidget::preferredName() const {
+TQString ExecExternalFetcher::ConfigWidget::preferredName() const {
return m_name.isEmpty() ? ExecExternalFetcher::defaultName() : m_name;
}
diff --git a/src/fetch/execexternalfetcher.h b/src/fetch/execexternalfetcher.h
index bdc2a40..49a16d0 100644
--- a/src/fetch/execexternalfetcher.h
+++ b/src/fetch/execexternalfetcher.h
@@ -18,14 +18,14 @@
#include "configwidget.h"
#include "../datavectors.h"
-#include <qintdict.h>
+#include <tqintdict.h>
class KProcess;
class KURLRequester;
class KLineEdit;
class KComboBox;
-class QCheckBox;
+class TQCheckBox;
namespace Tellico {
namespace GUI {
@@ -40,52 +40,53 @@ namespace Tellico {
*/
class ExecExternalFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- ExecExternalFetcher(QObject* parent, const char* name=0);
+ ExecExternalFetcher(TQObject* tqparent, const char* name=0);
/**
*/
virtual ~ExecExternalFetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual bool canSearch(FetchKey k) const { return m_args.contains(k); }
+ virtual bool canSearch(FetchKey k) const { return m_args.tqcontains(k); }
virtual bool canUpdate() const { return m_canUpdate; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void updateEntry(Data::EntryPtr entry);
virtual void stop();
virtual Data::EntryPtr fetchEntry(uint uid);
virtual Type type() const { return ExecExternal; }
virtual bool canFetch(int type) const;
virtual void readConfigHook(const KConfigGroup& config);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
- const QString& execPath() const { return m_path; }
+ const TQString& execPath() const { return m_path; }
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent = 0, const ExecExternalFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent = 0, const ExecExternalFetcher* fetcher = 0);
~ConfigWidget();
void readConfig(KConfig* config);
virtual void saveConfig(KConfigGroup& config);
virtual void removed();
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
private:
bool m_deleteOnRemove : 1;
- QString m_name, m_newStuffName;
+ TQString m_name, m_newStuffName;
KURLRequester* m_pathEdit;
GUI::CollectionTypeCombo* m_collCombo;
GUI::ComboBox* m_formatCombo;
- QIntDict<QCheckBox> m_cbDict;
- QIntDict<GUI::LineEdit> m_leDict;
- QCheckBox* m_cbUpdate;
+ TQIntDict<TQCheckBox> m_cbDict;
+ TQIntDict<GUI::LineEdit> m_leDict;
+ TQCheckBox* m_cbUpdate;
GUI::LineEdit* m_leUpdate;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
void slotData(KProcess* proc, char* buffer, int len);
@@ -93,23 +94,23 @@ private slots:
void slotProcessExited(KProcess* proc);
private:
- static QStringList parseArguments(const QString& str);
+ static TQStringList parseArguments(const TQString& str);
- void startSearch(const QStringList& args);
+ void startSearch(const TQStringList& args);
bool m_started;
int m_collType;
int m_formatType;
- QString m_path;
- QMap<FetchKey, QString> m_args;
+ TQString m_path;
+ TQMap<FetchKey, TQString> m_args;
bool m_canUpdate : 1;
- QString m_updateArgs;
+ TQString m_updateArgs;
KProcess* m_process;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries; // map from search result id to entry
- QStringList m_errors;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries; // map from search result id to entry
+ TQStringList m_errors;
bool m_deleteOnRemove : 1;
- QString m_newStuffName;
+ TQString m_newStuffName;
};
} // end namespace
diff --git a/src/fetch/fetcher.cpp b/src/fetch/fetcher.cpp
index 3bc7749..712ea96 100644
--- a/src/fetch/fetcher.cpp
+++ b/src/fetch/fetcher.cpp
@@ -26,10 +26,10 @@ Fetcher::~Fetcher() {
saveConfigHook(config);
}
-void Fetcher::readConfig(const KConfigGroup& config_, const QString& groupName_) {
+void Fetcher::readConfig(const KConfigGroup& config_, const TQString& groupName_) {
m_configGroup = groupName_;
- QString s = config_.readEntry("Name");
+ TQString s = config_.readEntry("Name");
if(!s.isEmpty()) {
m_name = s;
}
@@ -38,13 +38,13 @@ void Fetcher::readConfig(const KConfigGroup& config_, const QString& groupName_)
readConfigHook(config_);
}
-void Fetcher::message(const QString& message_, int type_) const {
+void Fetcher::message(const TQString& message_, int type_) const {
if(m_messager) {
m_messager->send(message_, static_cast<MessageHandler::Type>(type_));
}
}
-void Fetcher::infoList(const QString& message_, const QStringList& list_) const {
+void Fetcher::infoList(const TQString& message_, const TQStringList& list_) const {
if(m_messager) {
m_messager->infoList(message_, list_);
}
diff --git a/src/fetch/fetcher.h b/src/fetch/fetcher.h
index 0d2496e..09f5b2c 100644
--- a/src/fetch/fetcher.h
+++ b/src/fetch/fetcher.h
@@ -19,8 +19,8 @@
#include <kapplication.h> // for KApplication::random()
-#include <qobject.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstring.h>
class KConfigGroup;
@@ -35,8 +35,9 @@ namespace Tellico {
*
* @author Robby Stephenson
*/
-class Fetcher : public QObject, public KShared {
+class Fetcher : public TQObject, public KShared {
Q_OBJECT
+ TQ_OBJECT
public:
typedef KSharedPtr<Fetcher> Ptr;
@@ -44,7 +45,7 @@ public:
/**
*/
- Fetcher(QObject* parent, const char* name = 0) : QObject(parent, name), KShared(),
+ Fetcher(TQObject* tqparent, const char* name = 0) : TQObject(tqparent, name), KShared(),
m_updateOverwrite(false), m_hasMoreResults(false),
m_messager(0) {}
/**
@@ -68,7 +69,7 @@ public:
/**
* Returns the name of the data source, as defined by the user.
*/
- virtual QString source() const = 0;
+ virtual TQString source() const = 0;
/**
* Returns whether the fetcher will overwite existing info when updating
*/
@@ -76,7 +77,7 @@ public:
/**
* Starts a search, using a key and value.
*/
- virtual void search(FetchKey key, const QString& value) = 0;
+ virtual void search(FetchKey key, const TQString& value) = 0;
virtual void continueSearch() {}
virtual void updateEntry(Data::EntryPtr);
// mopst fetchers won't support this. it's particular useful for text fetchers
@@ -103,25 +104,25 @@ public:
MessageHandler* messageHandler() const { return m_messager; }
/**
*/
- void message(const QString& message, int type) const;
- void infoList(const QString& message, const QStringList& list) const;
+ void message(const TQString& message, int type) const;
+ void infoList(const TQString& message, const TQStringList& list) const;
/**
* Reads the config for the widget, given a config group.
*/
- void readConfig(const KConfigGroup& config, const QString& groupName);
+ void readConfig(const KConfigGroup& config, const TQString& groupName);
/**
* Returns a widget for modifying the fetcher's config.
*/
- virtual ConfigWidget* configWidget(QWidget* parent) const = 0;
+ virtual ConfigWidget* configWidget(TQWidget* tqparent) const = 0;
signals:
-// void signalStatus(const QString& status);
+// void signaltqStatus(const TQString& status);
void signalResultFound(Tellico::Fetch::SearchResult* result);
void signalDone(Tellico::Fetch::Fetcher::Ptr);
protected:
- QString m_name;
+ TQString m_name;
bool m_updateOverwrite : 1;
bool m_hasMoreResults : 1;
@@ -130,19 +131,19 @@ private:
virtual void saveConfigHook(KConfigGroup&) {}
MessageHandler* m_messager;
- QString m_configGroup;
+ TQString m_configGroup;
};
class SearchResult {
public:
- SearchResult(Fetcher::Ptr f, const QString& t, const QString& d, const QString& i)
+ SearchResult(Fetcher::Ptr f, const TQString& t, const TQString& d, const TQString& i)
: uid(KApplication::random()), fetcher(f), title(t), desc(d), isbn(i) {}
Data::EntryPtr fetchEntry();
uint uid;
Fetcher::Ptr fetcher;
- QString title;
- QString desc;
- QString isbn;
+ TQString title;
+ TQString desc;
+ TQString isbn;
};
} // end namespace
diff --git a/src/fetch/fetchmanager.cpp b/src/fetch/fetchmanager.cpp
index 84f4f39..f7bc4c3 100644
--- a/src/fetch/fetchmanager.cpp
+++ b/src/fetch/fetchmanager.cpp
@@ -56,8 +56,8 @@
#include <ktempfile.h>
#include <kio/netaccess.h>
-#include <qfileinfo.h>
-#include <qdir.h>
+#include <tqfileinfo.h>
+#include <tqdir.h>
#define LOAD_ICON(name, group, size) \
KGlobal::iconLoader()->loadIcon(name, static_cast<KIcon::Group>(group), size_)
@@ -65,11 +65,11 @@
using Tellico::Fetch::Manager;
Manager* Manager::s_self = 0;
-Manager::Manager() : QObject(), m_currentFetcherIndex(-1), m_messager(new ManagerMessage()),
+Manager::Manager() : TQObject(), m_currentFetcherIndex(-1), m_messager(new ManagerMessage()),
m_count(0), m_loadDefaults(false) {
loadFetchers();
-// m_keyMap.insert(FetchFirst, QString::null);
+// m_keyMap.insert(FetchFirst, TQString());
m_keyMap.insert(Title, i18n("Title"));
m_keyMap.insert(Person, i18n("Person"));
m_keyMap.insert(ISBN, i18n("ISBN"));
@@ -81,7 +81,7 @@ Manager::Manager() : QObject(), m_currentFetcherIndex(-1), m_messager(new Manage
// to keep from having a new i18n string, just remove octothorpe
m_keyMap.insert(LCCN, i18n("LCCN#").remove('#'));
m_keyMap.insert(Raw, i18n("Raw Query"));
-// m_keyMap.insert(FetchLast, QString::null);
+// m_keyMap.insert(FetchLast, TQString());
}
Manager::~Manager() {
@@ -94,11 +94,11 @@ void Manager::loadFetchers() {
m_configMap.clear();
KConfig* config = KGlobal::config();
- if(config->hasGroup(QString::fromLatin1("Data Sources"))) {
- KConfigGroup configGroup(config, QString::fromLatin1("Data Sources"));
+ if(config->hasGroup(TQString::tqfromLatin1("Data Sources"))) {
+ KConfigGroup configGroup(config, TQString::tqfromLatin1("Data Sources"));
int nSources = configGroup.readNumEntry("Sources Count", 0);
for(int i = 0; i < nSources; ++i) {
- QString group = QString::fromLatin1("Data Source %1").arg(i);
+ TQString group = TQString::tqfromLatin1("Data Source %1").tqarg(i);
Fetcher::Ptr f = createFetcher(config, group);
if(f) {
m_configMap.insert(f, group);
@@ -123,7 +123,7 @@ Tellico::Fetch::FetcherVec Manager::fetchers(int type_) {
return vec;
}
-Tellico::Fetch::KeyMap Manager::keyMap(const QString& source_) const {
+Tellico::Fetch::KeyMap Manager::keyMap(const TQString& source_) const {
// an empty string means return all
if(source_.isEmpty()) {
return m_keyMap;
@@ -151,7 +151,7 @@ Tellico::Fetch::KeyMap Manager::keyMap(const QString& source_) const {
return map;
}
-void Manager::startSearch(const QString& source_, FetchKey key_, const QString& value_) {
+void Manager::startSearch(const TQString& source_, FetchKey key_, const TQString& value_) {
if(value_.isEmpty()) {
emit signalDone();
return;
@@ -163,10 +163,10 @@ void Manager::startSearch(const QString& source_, FetchKey key_, const QString&
for(FetcherVec::Iterator it = m_fetchers.begin(); it != m_fetchers.end(); ++it, ++i) {
if(source_ == it->source()) {
++m_count; // Fetcher::search() might emit done(), so increment before calling search()
- connect(it.data(), SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
- SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)));
- connect(it.data(), SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
- SLOT(slotFetcherDone(Tellico::Fetch::Fetcher::Ptr)));
+ connect(it.data(), TQT_SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
+ TQT_SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)));
+ connect(it.data(), TQT_SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
+ TQT_SLOT(slotFetcherDone(Tellico::Fetch::Fetcher::Ptr)));
it->search(key_, value_);
m_currentFetcherIndex = i;
break;
@@ -183,10 +183,10 @@ void Manager::continueSearch() {
Fetcher::Ptr f = m_fetchers[m_currentFetcherIndex];
if(f && f->hasMoreResults()) {
++m_count;
- connect(f, SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
- SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)));
- connect(f, SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
- SLOT(slotFetcherDone(Tellico::Fetch::Fetcher::Ptr)));
+ connect(f, TQT_SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
+ TQT_SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)));
+ connect(f, TQT_SIGNAL(signalDone(Tellico::Fetch::Fetcher::Ptr)),
+ TQT_SLOT(slotFetcherDone(Tellico::Fetch::Fetcher::Ptr)));
f->continueSearch();
} else {
emit signalDone();
@@ -217,7 +217,7 @@ void Manager::stop() {
}
void Manager::slotFetcherDone(Fetcher::Ptr fetcher_) {
-// myDebug() << "Manager::slotFetcherDone() - " << (fetcher_ ? fetcher_->source() : QString::null)
+// myDebug() << "Manager::slotFetcherDone() - " << (fetcher_ ? fetcher_->source() : TQString())
// << " :" << m_count << endl;
fetcher_->disconnect(); // disconnect all signals
--m_count;
@@ -235,7 +235,7 @@ bool Manager::canFetch() const {
return false;
}
-Tellico::Fetch::Fetcher::Ptr Manager::createFetcher(KConfig* config_, const QString& group_) {
+Tellico::Fetch::Fetcher::Ptr Manager::createFetcher(KConfig* config_, const TQString& group_) {
if(!config_->hasGroup(group_)) {
myDebug() << "Manager::createFetcher() - no config group for " << group_ << endl;
return 0;
@@ -359,7 +359,7 @@ Tellico::Fetch::FetcherVec Manager::defaultFetchers() {
vec.append(new GoogleScholarFetcher(this));
vec.append(new DiscogsFetcher(this));
// only add IBS if user includes italian
- if(KGlobal::locale()->languagesTwoAlpha().contains(QString::fromLatin1("it"))) {
+ if(KGlobal::locale()->languagesTwoAlpha().tqcontains(TQString::tqfromLatin1("it"))) {
vec.append(new IBSFetcher(this));
}
return vec;
@@ -374,7 +374,7 @@ Tellico::Fetch::FetcherVec Manager::createUpdateFetchers(int collType_) {
KConfigGroup config(KGlobal::config(), "Data Sources");
int nSources = config.readNumEntry("Sources Count", 0);
for(int i = 0; i < nSources; ++i) {
- QString group = QString::fromLatin1("Data Source %1").arg(i);
+ TQString group = TQString::tqfromLatin1("Data Source %1").tqarg(i);
// needs the KConfig*
Fetcher::Ptr f = createFetcher(KGlobal::config(), group);
if(f && f->canFetch(collType_) && f->canUpdate()) {
@@ -396,7 +396,7 @@ Tellico::Fetch::FetcherVec Manager::createUpdateFetchers(int collType_, FetchKey
return fetchers;
}
-Tellico::Fetch::Fetcher::Ptr Manager::createUpdateFetcher(int collType_, const QString& source_) {
+Tellico::Fetch::Fetcher::Ptr Manager::createUpdateFetcher(int collType_, const TQString& source_) {
Fetcher::Ptr fetcher = 0;
// creates new fetchers
FetcherVec fetchers = createUpdateFetchers(collType_);
@@ -409,8 +409,8 @@ Tellico::Fetch::Fetcher::Ptr Manager::createUpdateFetcher(int collType_, const Q
return fetcher;
}
-void Manager::updateStatus(const QString& message_) {
- emit signalStatus(message_);
+void Manager::updatetqStatus(const TQString& message_) {
+ emit signaltqStatus(message_);
}
Tellico::Fetch::TypePairList Manager::typeList() {
@@ -440,11 +440,11 @@ Tellico::Fetch::TypePairList Manager::typeList() {
list.append(TypePair(DiscogsFetcher::defaultName(), Discogs));
// now find all the scripts distributed with tellico
- QStringList files = KGlobal::dirs()->findAllResources("appdata", QString::fromLatin1("data-sources/*.spec"),
+ TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::tqfromLatin1("data-sources/*.spec"),
false, true);
- for(QStringList::Iterator it = files.begin(); it != files.end(); ++it) {
+ for(TQStringList::Iterator it = files.begin(); it != files.end(); ++it) {
KConfig spec(*it, false, false);
- QString name = spec.readEntry("Name");
+ TQString name = spec.readEntry("Name");
if(name.isEmpty()) {
myDebug() << "Fetch::Manager::typeList() - no Name for " << *it << endl;
continue;
@@ -463,33 +463,33 @@ Tellico::Fetch::TypePairList Manager::typeList() {
// called when creating a new fetcher
-Tellico::Fetch::ConfigWidget* Manager::configWidget(QWidget* parent_, Type type_, const QString& name_) {
+Tellico::Fetch::ConfigWidget* Manager::configWidget(TQWidget* tqparent_, Type type_, const TQString& name_) {
ConfigWidget* w = 0;
switch(type_) {
#ifdef AMAZON_SUPPORT
case Amazon:
- w = new AmazonFetcher::ConfigWidget(parent_);
+ w = new AmazonFetcher::ConfigWidget(tqparent_);
break;
#endif
#ifdef IMDB_SUPPORT
case IMDB:
- w = new IMDBFetcher::ConfigWidget(parent_);
+ w = new IMDBFetcher::ConfigWidget(tqparent_);
break;
#endif
#ifdef HAVE_YAZ
case Z3950:
- w = new Z3950Fetcher::ConfigWidget(parent_);
+ w = new Z3950Fetcher::ConfigWidget(tqparent_);
break;
#endif
case SRU:
- w = new SRUConfigWidget(parent_);
+ w = new SRUConfigWidget(tqparent_);
break;
case Entrez:
- w = new EntrezFetcher::ConfigWidget(parent_);
+ w = new EntrezFetcher::ConfigWidget(tqparent_);
break;
case ExecExternal:
- w = new ExecExternalFetcher::ConfigWidget(parent_);
- if(!name_.isEmpty() && m_scriptMap.contains(name_)) {
+ w = new ExecExternalFetcher::ConfigWidget(tqparent_);
+ if(!name_.isEmpty() && m_scriptMap.tqcontains(name_)) {
// bundledScriptHasExecPath() actually needs to write the exec path
// back to the config so the configWidget can read it. But if the spec file
// is not readablle, that doesn't work. So work around it with a copy to a temp file
@@ -512,37 +512,37 @@ Tellico::Fetch::ConfigWidget* Manager::configWidget(QWidget* parent_, Type type_
}
break;
case Yahoo:
- w = new YahooFetcher::ConfigWidget(parent_);
+ w = new YahooFetcher::ConfigWidget(tqparent_);
break;
case AnimeNfo:
- w = new AnimeNfoFetcher::ConfigWidget(parent_);
+ w = new AnimeNfoFetcher::ConfigWidget(tqparent_);
break;
case IBS:
- w = new IBSFetcher::ConfigWidget(parent_);
+ w = new IBSFetcher::ConfigWidget(tqparent_);
break;
case ISBNdb:
- w = new ISBNdbFetcher::ConfigWidget(parent_);
+ w = new ISBNdbFetcher::ConfigWidget(tqparent_);
break;
case GCstarPlugin:
- w = new GCstarPluginFetcher::ConfigWidget(parent_);
+ w = new GCstarPluginFetcher::ConfigWidget(tqparent_);
break;
case CrossRef:
- w = new CrossRefFetcher::ConfigWidget(parent_);
+ w = new CrossRefFetcher::ConfigWidget(tqparent_);
break;
case Arxiv:
- w = new ArxivFetcher::ConfigWidget(parent_);
+ w = new ArxivFetcher::ConfigWidget(tqparent_);
break;
case Citebase:
- w = new CitebaseFetcher::ConfigWidget(parent_);
+ w = new CitebaseFetcher::ConfigWidget(tqparent_);
break;
case Bibsonomy:
- w = new BibsonomyFetcher::ConfigWidget(parent_);
+ w = new BibsonomyFetcher::ConfigWidget(tqparent_);
break;
case GoogleScholar:
- w = new GoogleScholarFetcher::ConfigWidget(parent_);
+ w = new GoogleScholarFetcher::ConfigWidget(tqparent_);
break;
case Discogs:
- w = new DiscogsFetcher::ConfigWidget(parent_);
+ w = new DiscogsFetcher::ConfigWidget(tqparent_);
break;
case Unknown:
kdWarning() << "Fetch::Manager::configWidget() - no widget defined for type = " << type_ << endl;
@@ -551,7 +551,7 @@ Tellico::Fetch::ConfigWidget* Manager::configWidget(QWidget* parent_, Type type_
}
// static
-QString Manager::typeName(Fetch::Type type_) {
+TQString Manager::typeName(Fetch::Type type_) {
switch(type_) {
#ifdef AMAZON_SUPPORT
case Amazon: return AmazonFetcher::defaultName();
@@ -579,17 +579,17 @@ QString Manager::typeName(Fetch::Type type_) {
case Unknown: break;
}
myWarning() << "Manager::typeName() - none found for " << type_ << endl;
- return QString::null;
+ return TQString();
}
-QPixmap Manager::fetcherIcon(Fetch::Fetcher::CPtr fetcher_, int group_, int size_) {
+TQPixmap Manager::fetcherIcon(Fetch::Fetcher::CPtr fetcher_, int group_, int size_) {
#ifdef HAVE_YAZ
if(fetcher_->type() == Fetch::Z3950) {
const Fetch::Z3950Fetcher* f = static_cast<const Fetch::Z3950Fetcher*>(fetcher_.data());
KURL u;
- u.setProtocol(QString::fromLatin1("http"));
+ u.setProtocol(TQString::tqfromLatin1("http"));
u.setHost(f->host());
- QString icon = favIcon(u);
+ TQString icon = favIcon(u);
if(u.isValid() && !icon.isEmpty()) {
return LOAD_ICON(icon, group_, size_);
}
@@ -597,21 +597,21 @@ QPixmap Manager::fetcherIcon(Fetch::Fetcher::CPtr fetcher_, int group_, int size
#endif
if(fetcher_->type() == Fetch::ExecExternal) {
const Fetch::ExecExternalFetcher* f = static_cast<const Fetch::ExecExternalFetcher*>(fetcher_.data());
- const QString p = f->execPath();
+ const TQString p = f->execPath();
KURL u;
- if(p.find(QString::fromLatin1("allocine")) > -1) {
- u = QString::fromLatin1("http://www.allocine.fr");
- } else if(p.find(QString::fromLatin1("ministerio_de_cultura")) > -1) {
- u = QString::fromLatin1("http://www.mcu.es");
- } else if(p.find(QString::fromLatin1("dark_horse_comics")) > -1) {
- u = QString::fromLatin1("http://www.darkhorse.com");
- } else if(p.find(QString::fromLatin1("boardgamegeek")) > -1) {
- u = QString::fromLatin1("http://www.boardgamegeek.com");
- } else if(f->source().find(QString::fromLatin1("amarok"), 0, false /*case-sensitive*/) > -1) {
- return LOAD_ICON(QString::fromLatin1("amarok"), group_, size_);
+ if(p.tqfind(TQString::tqfromLatin1("allocine")) > -1) {
+ u = TQString::tqfromLatin1("http://www.allocine.fr");
+ } else if(p.tqfind(TQString::tqfromLatin1("ministerio_de_cultura")) > -1) {
+ u = TQString::tqfromLatin1("http://www.mcu.es");
+ } else if(p.tqfind(TQString::tqfromLatin1("dark_horse_comics")) > -1) {
+ u = TQString::tqfromLatin1("http://www.darkhorse.com");
+ } else if(p.tqfind(TQString::tqfromLatin1("boardgamegeek")) > -1) {
+ u = TQString::tqfromLatin1("http://www.boardgamegeek.com");
+ } else if(f->source().tqfind(TQString::tqfromLatin1("amarok"), 0, false /*case-sensitive*/) > -1) {
+ return LOAD_ICON(TQString::tqfromLatin1("amarok"), group_, size_);
}
if(!u.isEmpty() && u.isValid()) {
- QString icon = favIcon(u);
+ TQString icon = favIcon(u);
if(!icon.isEmpty()) {
return LOAD_ICON(icon, group_, size_);
}
@@ -620,21 +620,21 @@ QPixmap Manager::fetcherIcon(Fetch::Fetcher::CPtr fetcher_, int group_, int size
return fetcherIcon(fetcher_->type(), group_);
}
-QPixmap Manager::fetcherIcon(Fetch::Type type_, int group_, int size_) {
- QString name;
+TQPixmap Manager::fetcherIcon(Fetch::Type type_, int group_, int size_) {
+ TQString name;
switch(type_) {
case Amazon:
name = favIcon("http://amazon.com"); break;
case IMDB:
name = favIcon("http://imdb.com"); break;
case Z3950:
- name = QString::fromLatin1("network"); break; // rather arbitrary
+ name = TQString::tqfromLatin1("network"); break; // rather arbitrary
case SRU:
- name = QString::fromLatin1("network_local"); break; // just to be different than z3950
+ name = TQString::tqfromLatin1("network_local"); break; // just to be different than z3950
case Entrez:
name = favIcon("http://www.ncbi.nlm.nih.gov"); break;
case ExecExternal:
- name = QString::fromLatin1("exec"); break;
+ name = TQString::tqfromLatin1("exec"); break;
case Yahoo:
name = favIcon("http://yahoo.com"); break;
case AnimeNfo:
@@ -644,7 +644,7 @@ QPixmap Manager::fetcherIcon(Fetch::Type type_, int group_, int size_) {
case ISBNdb:
name = favIcon("http://isbndb.com"); break;
case GCstarPlugin:
- name = QString::fromLatin1("gcstar"); break;
+ name = TQString::tqfromLatin1("gcstar"); break;
case CrossRef:
name = favIcon("http://crossref.org"); break;
case Arxiv:
@@ -661,13 +661,13 @@ QPixmap Manager::fetcherIcon(Fetch::Type type_, int group_, int size_) {
kdWarning() << "Fetch::Manager::fetcherIcon() - no pixmap defined for type = " << type_ << endl;
}
- return name.isEmpty() ? QPixmap() : LOAD_ICON(name, group_, size_);
+ return name.isEmpty() ? TQPixmap() : LOAD_ICON(name, group_, size_);
}
-QString Manager::favIcon(const KURL& url_) {
+TQString Manager::favIcon(const KURL& url_) {
DCOPRef kded("kded", "favicons");
DCOPReply reply = kded.call("iconForURL(KURL)", url_);
- QString iconName = reply.isValid() ? reply : QString();
+ TQString iconName = reply.isValid() ? reply : TQString();
if(!iconName.isEmpty()) {
return iconName;
} else {
@@ -677,15 +677,15 @@ QString Manager::favIcon(const KURL& url_) {
return KMimeType::iconForURL(url_);
}
-bool Manager::bundledScriptHasExecPath(const QString& specFile_, KConfig* config_) {
+bool Manager::bundledScriptHasExecPath(const TQString& specFile_, KConfig* config_) {
// make sure ExecPath is set and executable
// for the bundled scripts, either the exec name is not set, in which case it is the
// name of the spec file, minus the .spec, or the exec is set, and is local to the dir
// if not, look for it
- QString exec = config_->readPathEntry("ExecPath");
- QFileInfo specInfo(specFile_), execInfo(exec);
+ TQString exec = config_->readPathEntry("ExecPath");
+ TQFileInfo specInfo(specFile_), execInfo(exec);
if(exec.isEmpty() || !execInfo.exists()) {
- exec = specInfo.dirPath(true) + QDir::separator() + specInfo.baseName(true); // remove ".spec"
+ exec = specInfo.dirPath(true) + TQDir::separator() + specInfo.baseName(true); // remove ".spec"
} else if(execInfo.isRelative()) {
exec = specInfo.dirPath(true) + exec;
} else if(!execInfo.isExecutable()) {
diff --git a/src/fetch/fetchmanager.h b/src/fetch/fetchmanager.h
index 7036d71..c43b997 100644
--- a/src/fetch/fetchmanager.h
+++ b/src/fetch/fetchmanager.h
@@ -27,15 +27,15 @@ namespace Tellico {
#include <ksortablevaluelist.h>
-#include <qobject.h>
-#include <qmap.h>
+#include <tqobject.h>
+#include <tqmap.h>
namespace Tellico {
namespace Fetch {
-typedef KSortableItem<Type, QString> TypePair; // fetcher info, type and name of type
-typedef KSortableValueList<Type, QString> TypePairList;
-typedef QMap<FetchKey, QString> KeyMap; // map key type to name of key
+typedef KSortableItem<Type, TQString> TypePair; // fetcher info, type and name of type
+typedef KSortableValueList<Type, TQString> TypePairList;
+typedef TQMap<FetchKey, TQString> KeyMap; // map key type to name of key
typedef Vector<Fetcher> FetcherVec;
/**
@@ -43,16 +43,17 @@ typedef Vector<Fetcher> FetcherVec;
*
* @author Robby Stephenson
*/
-class Manager : public QObject {
+class Manager : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
static Manager* self() { if(!s_self) s_self = new Manager(); return s_self; }
~Manager();
- KeyMap keyMap(const QString& source = QString::null) const;
- void startSearch(const QString& source, FetchKey key, const QString& value);
+ KeyMap keyMap(const TQString& source = TQString()) const;
+ void startSearch(const TQString& source, FetchKey key, const TQString& value);
void continueSearch();
void stop();
bool canFetch() const;
@@ -61,19 +62,19 @@ public:
const FetcherVec& fetchers() const { return m_fetchers; }
FetcherVec fetchers(int type);
TypePairList typeList();
- ConfigWidget* configWidget(QWidget* parent, Type type, const QString& name);
+ ConfigWidget* configWidget(TQWidget* tqparent, Type type, const TQString& name);
// create fetcher for updating an entry
FetcherVec createUpdateFetchers(int collType);
FetcherVec createUpdateFetchers(int collType, FetchKey key);
- Fetcher::Ptr createUpdateFetcher(int collType, const QString& source);
+ Fetcher::Ptr createUpdateFetcher(int collType, const TQString& source);
- static QString typeName(Type type);
- static QPixmap fetcherIcon(Fetch::Type type, int iconGroup=3 /*Small*/, int size=0 /* default */);
- static QPixmap fetcherIcon(Fetch::Fetcher::CPtr ptr, int iconGroup=3 /*Small*/, int size=0 /* default*/);
+ static TQString typeName(Type type);
+ static TQPixmap fetcherIcon(Fetch::Type type, int iconGroup=3 /*Small*/, int size=0 /* default */);
+ static TQPixmap fetcherIcon(Fetch::Fetcher::CPtr ptr, int iconGroup=3 /*Small*/, int size=0 /* default*/);
signals:
- void signalStatus(const QString& status);
+ void signaltqStatus(const TQString& status);
void signalResultFound(Tellico::Fetch::SearchResult* result);
void signalDone();
@@ -85,17 +86,17 @@ private:
static Manager* s_self;
Manager();
- Fetcher::Ptr createFetcher(KConfig* config, const QString& configGroup);
+ Fetcher::Ptr createFetcher(KConfig* config, const TQString& configGroup);
FetcherVec defaultFetchers();
- void updateStatus(const QString& message);
+ void updatetqStatus(const TQString& message);
- static QString favIcon(const KURL& url);
- static bool bundledScriptHasExecPath(const QString& specFile, KConfig* config);
+ static TQString favIcon(const KURL& url);
+ static bool bundledScriptHasExecPath(const TQString& specFile, KConfig* config);
FetcherVec m_fetchers;
int m_currentFetcherIndex;
KeyMap m_keyMap;
- typedef QMap<Fetcher::Ptr, QString> ConfigMap;
+ typedef TQMap<Fetcher::Ptr, TQString> ConfigMap;
ConfigMap m_configMap;
StringMap m_scriptMap;
ManagerMessage* m_messager;
diff --git a/src/fetch/gcstarpluginfetcher.cpp b/src/fetch/gcstarpluginfetcher.cpp
index 4bffed7..3129c78 100644
--- a/src/fetch/gcstarpluginfetcher.cpp
+++ b/src/fetch/gcstarpluginfetcher.cpp
@@ -31,10 +31,10 @@
#include <kstandarddirs.h>
#include <kaccelmanager.h>
-#include <qdir.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qwhatsthis.h>
+#include <tqdir.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqwhatsthis.h>
using Tellico::Fetch::GCstarPluginFetcher;
@@ -43,25 +43,25 @@ GCstarPluginFetcher::PluginParse GCstarPluginFetcher::pluginParse = NotYet;
//static
GCstarPluginFetcher::PluginList GCstarPluginFetcher::plugins(int collType_) {
- if(!pluginMap.contains(collType_)) {
+ if(!pluginMap.tqcontains(collType_)) {
GUI::CursorSaver cs;
- QString gcstar = KStandardDirs::findExe(QString::fromLatin1("gcstar"));
+ TQString gcstar = KStandardDirs::findExe(TQString::tqfromLatin1("gcstar"));
if(pluginParse == NotYet) {
KProcIO proc;
- proc << gcstar << QString::fromLatin1("--version");
+ proc << gcstar << TQString::tqfromLatin1("--version");
// wait 5 seconds at most, just a sanity thing, never want to block completely
if(proc.start(KProcess::Block) && proc.wait(5)) {
- QString output;
+ TQString output;
proc.readln(output);
if(!output.isEmpty()) {
// always going to be x.y[.z] ?
- QRegExp versionRx(QString::fromLatin1("(\\d+)\\.(\\d+)(?:\\.(\\d+))?"));
+ TQRegExp versionRx(TQString::tqfromLatin1("(\\d+)\\.(\\d+)(?:\\.(\\d+))?"));
if(versionRx.search(output) > -1) {
int x = versionRx.cap(1).toInt();
int y = versionRx.cap(2).toInt();
int z = versionRx.cap(3).toInt(); // ok to be empty
- myDebug() << QString::fromLatin1("GCstarPluginFetcher() - found %1.%2.%3").arg(x).arg(y).arg(z) << endl;
+ myDebug() << TQString::tqfromLatin1("GCstarPluginFetcher() - found %1.%2.%3").tqarg(x).tqarg(y).tqarg(z) << endl;
// --list-plugins argument was added for 1.3 release
pluginParse = (x >= 1 && y >=3) ? New : Old;
}
@@ -80,13 +80,13 @@ GCstarPluginFetcher::PluginList GCstarPluginFetcher::plugins(int collType_) {
}
}
- return pluginMap.contains(collType_) ? pluginMap[collType_] : GCstarPluginFetcher::PluginList();
+ return pluginMap.tqcontains(collType_) ? pluginMap[collType_] : GCstarPluginFetcher::PluginList();
}
-void GCstarPluginFetcher::readPluginsNew(int collType_, const QString& gcstar_) {
+void GCstarPluginFetcher::readPluginsNew(int collType_, const TQString& gcstar_) {
PluginList plugins;
- QString gcstarCollection = gcstarType(collType_);
+ TQString gcstarCollection = gcstarType(collType_);
if(gcstarCollection.isEmpty()) {
pluginMap.insert(collType_, plugins);
return;
@@ -94,9 +94,9 @@ void GCstarPluginFetcher::readPluginsNew(int collType_, const QString& gcstar_)
KProcIO proc;
proc << gcstar_
- << QString::fromLatin1("-x")
- << QString::fromLatin1("--list-plugins")
- << QString::fromLatin1("--collection") << gcstarCollection;
+ << TQString::tqfromLatin1("-x")
+ << TQString::tqfromLatin1("--list-plugins")
+ << TQString::tqfromLatin1("--collection") << gcstarCollection;
if(!proc.start(KProcess::Block)) {
myWarning() << "GCstarPluginFetcher::readPluginsNew() - can't start" << endl;
@@ -105,7 +105,7 @@ void GCstarPluginFetcher::readPluginsNew(int collType_, const QString& gcstar_)
bool hasName = false;
PluginInfo info;
- QString line;
+ TQString line;
for(int length = 0; length > -1; length = proc.readln(line)) {
if(line.isEmpty()) {
if(hasName) {
@@ -117,10 +117,10 @@ void GCstarPluginFetcher::readPluginsNew(int collType_, const QString& gcstar_)
// authors have \t at beginning
line = line.stripWhiteSpace();
if(!hasName) {
- info.insert(QString::fromLatin1("name"), line);
+ info.insert(TQString::tqfromLatin1("name"), line);
hasName = true;
} else {
- info.insert(QString::fromLatin1("author"), line);
+ info.insert(TQString::tqfromLatin1("author"), line);
}
// myDebug() << line << endl;
}
@@ -129,34 +129,34 @@ void GCstarPluginFetcher::readPluginsNew(int collType_, const QString& gcstar_)
pluginMap.insert(collType_, plugins);
}
-void GCstarPluginFetcher::readPluginsOld(int collType_, const QString& gcstar_) {
- QDir dir(gcstar_, QString::fromLatin1("GC*.pm"));
- dir.cd(QString::fromLatin1("../../lib/gcstar/GCPlugins/"));
+void GCstarPluginFetcher::readPluginsOld(int collType_, const TQString& gcstar_) {
+ TQDir dir(gcstar_, TQString::tqfromLatin1("GC*.pm"));
+ dir.cd(TQString::tqfromLatin1("../../lib/gcstar/GCPlugins/"));
- QRegExp rx(QString::fromLatin1("get(Name|Author|Lang)\\s*\\{\\s*return\\s+['\"](.+)['\"]"));
+ TQRegExp rx(TQString::tqfromLatin1("get(Name|Author|Lang)\\s*\\{\\s*return\\s+['\"](.+)['\"]"));
rx.setMinimal(true);
PluginList plugins;
- QString dirName = gcstarType(collType_);
+ TQString dirName = gcstarType(collType_);
if(dirName.isEmpty()) {
pluginMap.insert(collType_, plugins);
return;
}
- QStringList files = dir.entryList();
- for(QStringList::ConstIterator file = files.begin(); file != files.end(); ++file) {
+ TQStringList files = dir.entryList();
+ for(TQStringList::ConstIterator file = files.begin(); file != files.end(); ++file) {
KURL u;
u.setPath(dir.filePath(*file));
PluginInfo info;
- QString text = FileHandler::readTextFile(u);
+ TQString text = FileHandler::readTextFile(u);
for(int pos = rx.search(text);
pos > -1;
pos = rx.search(text, pos+rx.matchedLength())) {
info.insert(rx.cap(1).lower(), rx.cap(2));
}
// only add if it has a name
- if(info.contains(QString::fromLatin1("name"))) {
+ if(info.tqcontains(TQString::tqfromLatin1("name"))) {
plugins << info;
}
}
@@ -164,21 +164,21 @@ void GCstarPluginFetcher::readPluginsOld(int collType_, const QString& gcstar_)
pluginMap.insert(collType_, plugins);
}
-QString GCstarPluginFetcher::gcstarType(int collType_) {
+TQString GCstarPluginFetcher::gcstarType(int collType_) {
switch(collType_) {
- case Data::Collection::Book: return QString::fromLatin1("GCbooks");
- case Data::Collection::Video: return QString::fromLatin1("GCfilms");
- case Data::Collection::Game: return QString::fromLatin1("GCgames");
- case Data::Collection::Album: return QString::fromLatin1("GCmusics");
- case Data::Collection::Coin: return QString::fromLatin1("GCcoins");
- case Data::Collection::Wine: return QString::fromLatin1("GCwines");
- case Data::Collection::BoardGame: return QString::fromLatin1("GCboardgames");
+ case Data::Collection::Book: return TQString::tqfromLatin1("GCbooks");
+ case Data::Collection::Video: return TQString::tqfromLatin1("GCfilms");
+ case Data::Collection::Game: return TQString::tqfromLatin1("GCgames");
+ case Data::Collection::Album: return TQString::tqfromLatin1("GCmusics");
+ case Data::Collection::Coin: return TQString::tqfromLatin1("GCcoins");
+ case Data::Collection::Wine: return TQString::tqfromLatin1("GCwines");
+ case Data::Collection::BoardGame: return TQString::tqfromLatin1("GCboardgames");
default: break;
}
- return QString();
+ return TQString();
}
-GCstarPluginFetcher::GCstarPluginFetcher(QObject* parent_, const char* name_/*=0*/) : Fetcher(parent_, name_),
+GCstarPluginFetcher::GCstarPluginFetcher(TQObject* tqparent_, const char* name_/*=0*/) : Fetcher(tqparent_, name_),
m_started(false), m_collType(-1), m_process(0) {
}
@@ -186,11 +186,11 @@ GCstarPluginFetcher::~GCstarPluginFetcher() {
stop();
}
-QString GCstarPluginFetcher::defaultName() {
+TQString GCstarPluginFetcher::defaultName() {
return i18n("GCstar Plugin");
}
-QString GCstarPluginFetcher::source() const {
+TQString GCstarPluginFetcher::source() const {
return m_name;
}
@@ -203,7 +203,7 @@ void GCstarPluginFetcher::readConfigHook(const KConfigGroup& config_) {
m_plugin = config_.readEntry("Plugin");
}
-void GCstarPluginFetcher::search(FetchKey key_, const QString& value_) {
+void GCstarPluginFetcher::search(FetchKey key_, const TQString& value_) {
m_started = true;
m_data.truncate(0);
@@ -213,14 +213,14 @@ void GCstarPluginFetcher::search(FetchKey key_, const QString& value_) {
return;
}
- QString gcstar = KStandardDirs::findExe(QString::fromLatin1("gcstar"));
+ TQString gcstar = KStandardDirs::findExe(TQString::tqfromLatin1("gcstar"));
if(gcstar.isEmpty()) {
myWarning() << "GCstarPluginFetcher::search() - gcstar not found!" << endl;
stop();
return;
}
- QString gcstarCollection = gcstarType(m_collType);
+ TQString gcstarCollection = gcstarType(m_collType);
if(m_plugin.isEmpty()) {
myWarning() << "GCstarPluginFetcher::search() - no plugin name! " << endl;
@@ -229,16 +229,16 @@ void GCstarPluginFetcher::search(FetchKey key_, const QString& value_) {
}
m_process = new KProcess();
- connect(m_process, SIGNAL(receivedStdout(KProcess*, char*, int)), SLOT(slotData(KProcess*, char*, int)));
- connect(m_process, SIGNAL(receivedStderr(KProcess*, char*, int)), SLOT(slotError(KProcess*, char*, int)));
- connect(m_process, SIGNAL(processExited(KProcess*)), SLOT(slotProcessExited(KProcess*)));
- QStringList args;
- args << gcstar << QString::fromLatin1("-x")
- << QString::fromLatin1("--collection") << gcstarCollection
- << QString::fromLatin1("--export") << QString::fromLatin1("Tellico")
- << QString::fromLatin1("--website") << m_plugin
- << QString::fromLatin1("--download") << KProcess::quote(value_);
- myLog() << "GCstarPluginFetcher::search() - " << args.join(QChar(' ')) << endl;
+ connect(m_process, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), TQT_SLOT(slotData(KProcess*, char*, int)));
+ connect(m_process, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), TQT_SLOT(slotError(KProcess*, char*, int)));
+ connect(m_process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(slotProcessExited(KProcess*)));
+ TQStringList args;
+ args << gcstar << TQString::tqfromLatin1("-x")
+ << TQString::tqfromLatin1("--collection") << gcstarCollection
+ << TQString::tqfromLatin1("--export") << TQString::tqfromLatin1("Tellico")
+ << TQString::tqfromLatin1("--website") << m_plugin
+ << TQString::tqfromLatin1("--download") << KProcess::quote(value_);
+ myLog() << "GCstarPluginFetcher::search() - " << args.join(TQChar(' ')) << endl;
*m_process << args;
if(!m_process->start(KProcess::NotifyOnExit, KProcess::AllOutput)) {
myDebug() << "GCstarPluginFetcher::startSearch() - process failed to start" << endl;
@@ -262,13 +262,13 @@ void GCstarPluginFetcher::stop() {
}
void GCstarPluginFetcher::slotData(KProcess*, char* buffer_, int len_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(buffer_, len_);
}
void GCstarPluginFetcher::slotError(KProcess*, char* buffer_, int len_) {
- QString msg = QString::fromLocal8Bit(buffer_, len_);
- msg.prepend(source() + QString::fromLatin1(": "));
+ TQString msg = TQString::fromLocal8Bit(buffer_, len_);
+ msg.prepend(source() + TQString::tqfromLatin1(": "));
myDebug() << "GCstarPluginFetcher::slotError() - " << msg << endl;
m_errors << msg;
}
@@ -278,13 +278,13 @@ void GCstarPluginFetcher::slotProcessExited(KProcess*) {
if(!m_process->normalExit() || m_process->exitStatus()) {
myDebug() << "GCstarPluginFetcher::slotProcessExited() - "<< source() << ": process did not exit successfully" << endl;
if(!m_errors.isEmpty()) {
- message(m_errors.join(QChar('\n')), MessageHandler::Error);
+ message(m_errors.join(TQChar('\n')), MessageHandler::Error);
}
stop();
return;
}
if(!m_errors.isEmpty()) {
- message(m_errors.join(QChar('\n')), MessageHandler::Warning);
+ message(m_errors.join(TQChar('\n')), MessageHandler::Warning);
}
if(m_data.isEmpty()) {
@@ -293,12 +293,12 @@ void GCstarPluginFetcher::slotProcessExited(KProcess*) {
return;
}
- Import::TellicoImporter imp(QString::fromUtf8(m_data, m_data.size()));
+ Import::TellicoImporter imp(TQString::fromUtf8(m_data, m_data.size()));
Data::CollPtr coll = imp.collection();
if(!coll) {
if(!imp.statusMessage().isEmpty()) {
- message(imp.statusMessage(), MessageHandler::Status);
+ message(imp.statusMessage(), MessageHandler::tqStatus);
}
myDebug() << "GCstarPluginFetcher::slotProcessExited() - "<< source() << ": no collection pointer" << endl;
stop();
@@ -307,60 +307,60 @@ void GCstarPluginFetcher::slotProcessExited(KProcess*) {
Data::EntryVec entries = coll->entries();
for(Data::EntryVec::Iterator entry = entries.begin(); entry != entries.end(); ++entry) {
- QString desc;
+ TQString desc;
switch(coll->type()) {
case Data::Collection::Book:
case Data::Collection::Bibtex:
- desc = entry->field(QString::fromLatin1("author"))
- + QChar('/')
- + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("cr_year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("cr_year"));
- } else if(!entry->field(QString::fromLatin1("pub_year")).isEmpty()){
- desc += QChar('/') + entry->field(QString::fromLatin1("pub_year"));
+ desc = entry->field(TQString::tqfromLatin1("author"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("cr_year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("cr_year"));
+ } else if(!entry->field(TQString::tqfromLatin1("pub_year")).isEmpty()){
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("pub_year"));
}
break;
case Data::Collection::Video:
- desc = entry->field(QString::fromLatin1("studio"))
- + QChar('/')
- + entry->field(QString::fromLatin1("director"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"))
- + QChar('/')
- + entry->field(QString::fromLatin1("medium"));
+ desc = entry->field(TQString::tqfromLatin1("studio"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("director"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("medium"));
break;
case Data::Collection::Album:
- desc = entry->field(QString::fromLatin1("artist"))
- + QChar('/')
- + entry->field(QString::fromLatin1("label"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"));
+ desc = entry->field(TQString::tqfromLatin1("artist"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("label"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"));
break;
case Data::Collection::Game:
- desc = entry->field(QString::fromLatin1("platform"));
+ desc = entry->field(TQString::tqfromLatin1("platform"));
break;
case Data::Collection::ComicBook:
- desc = entry->field(QString::fromLatin1("publisher"))
- + QChar('/')
- + entry->field(QString::fromLatin1("pub_year"));
+ desc = entry->field(TQString::tqfromLatin1("publisher"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("pub_year"));
break;
case Data::Collection::BoardGame:
- desc = entry->field(QString::fromLatin1("designer"))
- + QChar('/')
- + entry->field(QString::fromLatin1("publisher"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"));
+ desc = entry->field(TQString::tqfromLatin1("designer"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("publisher"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"));
break;
default:
break;
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, entry);
emit signalResultFound(r);
}
@@ -373,7 +373,7 @@ Tellico::Data::EntryPtr GCstarPluginFetcher::fetchEntry(uint uid_) {
void GCstarPluginFetcher::updateEntry(Data::EntryPtr entry_) {
// ry searching for title and rely on Collection::sameEntry() to figure things out
- QString t = entry_->field(QString::fromLatin1("title"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
if(!t.isEmpty()) {
search(Fetch::Title, t);
return;
@@ -383,48 +383,48 @@ void GCstarPluginFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* GCstarPluginFetcher::configWidget(QWidget* parent_) const {
- return new GCstarPluginFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* GCstarPluginFetcher::configWidget(TQWidget* tqparent_) const {
+ return new GCstarPluginFetcher::ConfigWidget(tqparent_, this);
}
-GCstarPluginFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const GCstarPluginFetcher* fetcher_/*=0*/)
- : Fetch::ConfigWidget(parent_), m_needPluginList(true) {
- QGridLayout* l = new QGridLayout(optionsWidget(), 3, 4);
+GCstarPluginFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const GCstarPluginFetcher* fetcher_/*=0*/)
+ : Fetch::ConfigWidget(tqparent_), m_needPluginList(true) {
+ TQGridLayout* l = new TQGridLayout(optionsWidget(), 3, 4);
l->setSpacing(4);
l->setColStretch(1, 10);
int row = -1;
- QLabel* label = new QLabel(i18n("Collection &type:"), optionsWidget());
+ TQLabel* label = new TQLabel(i18n("Collection &type:"), optionsWidget());
l->addWidget(label, ++row, 0);
m_collCombo = new GUI::CollectionTypeCombo(optionsWidget());
- connect(m_collCombo, SIGNAL(activated(int)), SLOT(slotSetModified()));
- connect(m_collCombo, SIGNAL(activated(int)), SLOT(slotTypeChanged()));
+ connect(m_collCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetModified()));
+ connect(m_collCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotTypeChanged()));
l->addMultiCellWidget(m_collCombo, row, row, 1, 3);
- QString w = i18n("Set the collection type of the data returned from the plugin.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_collCombo, w);
+ TQString w = i18n("Set the collection type of the data returned from the plugin.");
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_collCombo, w);
label->setBuddy(m_collCombo);
- label = new QLabel(i18n("&Plugin: "), optionsWidget());
+ label = new TQLabel(i18n("&Plugin: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_pluginCombo = new GUI::ComboBox(optionsWidget());
- connect(m_pluginCombo, SIGNAL(activated(int)), SLOT(slotSetModified()));
- connect(m_pluginCombo, SIGNAL(activated(int)), SLOT(slotPluginChanged()));
+ connect(m_pluginCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetModified()));
+ connect(m_pluginCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotPluginChanged()));
l->addMultiCellWidget(m_pluginCombo, row, row, 1, 3);
w = i18n("Select the GCstar plugin used for the data source.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_pluginCombo, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_pluginCombo, w);
label->setBuddy(m_pluginCombo);
- label = new QLabel(i18n("Author: "), optionsWidget());
+ label = new TQLabel(i18n("Author: "), optionsWidget());
l->addWidget(label, ++row, 0);
- m_authorLabel = new QLabel(optionsWidget());
+ m_authorLabel = new TQLabel(optionsWidget());
l->addWidget(m_authorLabel, row, 1);
-// label = new QLabel(i18n("Language: "), optionsWidget());
+// label = new TQLabel(i18n("Language: "), optionsWidget());
// l->addWidget(label, row, 2);
-// m_langLabel = new QLabel(optionsWidget());
+// m_langLabel = new TQLabel(optionsWidget());
// l->addWidget(m_langLabel, row, 3);
if(fetcher_ && fetcher_->m_collType > -1) {
@@ -448,17 +448,17 @@ void GCstarPluginFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
config_.writeEntry("Plugin", m_pluginCombo->currentText());
}
-QString GCstarPluginFetcher::ConfigWidget::preferredName() const {
- return QString::fromLatin1("GCstar - ") + m_pluginCombo->currentText();
+TQString GCstarPluginFetcher::ConfigWidget::preferredName() const {
+ return TQString::tqfromLatin1("GCstar - ") + m_pluginCombo->currentText();
}
void GCstarPluginFetcher::ConfigWidget::slotTypeChanged() {
int collType = m_collCombo->currentType();
m_pluginCombo->clear();
- QStringList pluginNames;
+ TQStringList pluginNames;
GCstarPluginFetcher::PluginList list = GCstarPluginFetcher::plugins(collType);
for(GCstarPluginFetcher::PluginList::ConstIterator it = list.begin(); it != list.end(); ++it) {
- pluginNames << (*it)[QString::fromLatin1("name")].toString();
+ pluginNames << (*it)[TQString::tqfromLatin1("name")].toString();
m_pluginCombo->insertItem(pluginNames.last(), *it);
}
slotPluginChanged();
@@ -467,12 +467,12 @@ void GCstarPluginFetcher::ConfigWidget::slotTypeChanged() {
void GCstarPluginFetcher::ConfigWidget::slotPluginChanged() {
PluginInfo info = m_pluginCombo->currentData().toMap();
- m_authorLabel->setText(info[QString::fromLatin1("author")].toString());
-// m_langLabel->setText(info[QString::fromLatin1("lang")].toString());
+ m_authorLabel->setText(info[TQString::tqfromLatin1("author")].toString());
+// m_langLabel->setText(info[TQString::tqfromLatin1("lang")].toString());
emit signalName(preferredName());
}
-void GCstarPluginFetcher::ConfigWidget::showEvent(QShowEvent*) {
+void GCstarPluginFetcher::ConfigWidget::showEvent(TQShowEvent*) {
if(m_needPluginList) {
m_needPluginList = false;
slotTypeChanged(); // update plugin combo box
diff --git a/src/fetch/gcstarpluginfetcher.h b/src/fetch/gcstarpluginfetcher.h
index 1994b58..0bda3b0 100644
--- a/src/fetch/gcstarpluginfetcher.h
+++ b/src/fetch/gcstarpluginfetcher.h
@@ -18,9 +18,9 @@
#include "configwidget.h"
#include "../datavectors.h"
-#include <qintdict.h>
+#include <tqintdict.h>
-class QLabel;
+class TQLabel;
class KProcess;
namespace Tellico {
@@ -35,31 +35,32 @@ namespace Tellico {
*/
class GCstarPluginFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- GCstarPluginFetcher(QObject* parent, const char* name=0);
+ GCstarPluginFetcher(TQObject* tqparent, const char* name=0);
/**
*/
virtual ~GCstarPluginFetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
virtual bool canSearch(FetchKey k) const { return k == Title; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void updateEntry(Data::EntryPtr entry);
virtual void stop();
virtual Data::EntryPtr fetchEntry(uint uid);
virtual Type type() const { return GCstarPlugin; }
virtual bool canFetch(int type) const;
virtual void readConfigHook(const KConfigGroup& config);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget;
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
void slotData(KProcess* proc, char* buffer, int len);
@@ -68,51 +69,52 @@ private slots:
private:
// map Author, Name, Lang, etc...
- typedef QMap<QString, QVariant> PluginInfo;
- typedef QValueList<PluginInfo> PluginList;
+ typedef TQMap<TQString, TQVariant> PluginInfo;
+ typedef TQValueList<PluginInfo> PluginList;
// map collection type to all available plugins
- typedef QMap<int, PluginList> PluginMap;
+ typedef TQMap<int, PluginList> PluginMap;
static PluginMap pluginMap;
static PluginList plugins(int collType);
// we need to keep track if we've searched for plugins yet and by what method
enum PluginParse {NotYet, Old, New};
static PluginParse pluginParse;
- static void readPluginsNew(int collType, const QString& exe);
- static void readPluginsOld(int collType, const QString& exe);
- static QString gcstarType(int collType);
+ static void readPluginsNew(int collType, const TQString& exe);
+ static void readPluginsOld(int collType, const TQString& exe);
+ static TQString gcstarType(int collType);
bool m_started;
int m_collType;
- QString m_plugin;
+ TQString m_plugin;
KProcess* m_process;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries; // map from search result id to entry
- QStringList m_errors;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries; // map from search result id to entry
+ TQStringList m_errors;
};
class GCstarPluginFetcher::ConfigWidget : public Fetch::ConfigWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- ConfigWidget(QWidget* parent, const GCstarPluginFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent, const GCstarPluginFetcher* fetcher = 0);
~ConfigWidget();
virtual void saveConfig(KConfigGroup& config);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
private slots:
void slotTypeChanged();
void slotPluginChanged();
private:
- void showEvent(QShowEvent* event);
+ void showEvent(TQShowEvent* event);
bool m_needPluginList;
- QString m_originalPluginName;
+ TQString m_originalPluginName;
GUI::CollectionTypeCombo* m_collCombo;
GUI::ComboBox* m_pluginCombo;
- QLabel* m_authorLabel;
- QLabel* m_langLabel;
+ TQLabel* m_authorLabel;
+ TQLabel* m_langLabel;
};
} // end namespace
diff --git a/src/fetch/googlescholarfetcher.cpp b/src/fetch/googlescholarfetcher.cpp
index 21979c4..1d14043 100644
--- a/src/fetch/googlescholarfetcher.cpp
+++ b/src/fetch/googlescholarfetcher.cpp
@@ -24,8 +24,8 @@
#include <kconfig.h>
#include <kio/job.h>
-#include <qlabel.h>
-#include <qlayout.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
namespace {
static const int GOOGLE_MAX_RETURNS_TOTAL = 20;
@@ -34,23 +34,23 @@ namespace {
using Tellico::Fetch::GoogleScholarFetcher;
-GoogleScholarFetcher::GoogleScholarFetcher(QObject* parent_, const char* name_)
- : Fetcher(parent_, name_),
+GoogleScholarFetcher::GoogleScholarFetcher(TQObject* tqparent_, const char* name_)
+ : Fetcher(tqparent_, name_),
m_limit(GOOGLE_MAX_RETURNS_TOTAL), m_start(0), m_job(0), m_started(false),
m_cookieIsSet(false) {
- m_bibtexRx = QRegExp(QString::fromLatin1("<a\\s.*href\\s*=\\s*\"([^>]*scholar\\.bib[^>]*)\""));
+ m_bibtexRx = TQRegExp(TQString::tqfromLatin1("<a\\s.*href\\s*=\\s*\"([^>]*scholar\\.bib[^>]*)\""));
m_bibtexRx.setMinimal(true);
}
GoogleScholarFetcher::~GoogleScholarFetcher() {
}
-QString GoogleScholarFetcher::defaultName() {
+TQString GoogleScholarFetcher::defaultName() {
// no i18n
- return QString::fromLatin1("Google Scholar");
+ return TQString::tqfromLatin1("Google Scholar");
}
-QString GoogleScholarFetcher::source() const {
+TQString GoogleScholarFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -62,10 +62,10 @@ void GoogleScholarFetcher::readConfigHook(const KConfigGroup& config_) {
Q_UNUSED(config_);
}
-void GoogleScholarFetcher::search(FetchKey key_, const QString& value_) {
+void GoogleScholarFetcher::search(FetchKey key_, const TQString& value_) {
if(!m_cookieIsSet) {
// have to set preferences to have bibtex output
- FileHandler::readTextFile(QString::fromLatin1("http://scholar.google.com/scholar_setprefs?num=100&scis=yes&scisf=4&submit=Save+Preferences"), true);
+ FileHandler::readTextFile(TQString::tqfromLatin1("http://scholar.google.com/scholar_setprefs?num=100&scis=yes&scisf=4&submit=Save+Preferences"), true);
m_cookieIsSet = true;
}
m_key = key_;
@@ -85,25 +85,25 @@ void GoogleScholarFetcher::doSearch() {
// myDebug() << "GoogleScholarFetcher::search() - value = " << value_ << endl;
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
- KURL u(QString::fromLatin1(SCHOLAR_BASE_URL));
- u.addQueryItem(QString::fromLatin1("start"), QString::number(m_start));
+ KURL u(TQString::tqfromLatin1(SCHOLAR_BASE_URL));
+ u.addQueryItem(TQString::tqfromLatin1("start"), TQString::number(m_start));
switch(m_key) {
case Title:
- u.addQueryItem(QString::fromLatin1("q"), QString::fromLatin1("allintitle:%1").arg(m_value));
+ u.addQueryItem(TQString::tqfromLatin1("q"), TQString::tqfromLatin1("allintitle:%1").tqarg(m_value));
break;
case Keyword:
- u.addQueryItem(QString::fromLatin1("q"), m_value);
+ u.addQueryItem(TQString::tqfromLatin1("q"), m_value);
break;
case Person:
- u.addQueryItem(QString::fromLatin1("q"), QString::fromLatin1("author:%1").arg(m_value));
+ u.addQueryItem(TQString::tqfromLatin1("q"), TQString::tqfromLatin1("author:%1").tqarg(m_value));
break;
default:
@@ -114,10 +114,10 @@ void GoogleScholarFetcher::doSearch() {
// myDebug() << "GoogleScholarFetcher::search() - url: " << u.url() << endl;
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void GoogleScholarFetcher::stop() {
@@ -133,8 +133,8 @@ void GoogleScholarFetcher::stop() {
emit signalDone(this);
}
-void GoogleScholarFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void GoogleScholarFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -155,11 +155,11 @@ void GoogleScholarFetcher::slotComplete(KIO::Job* job_) {
return;
}
- QString text = QString::fromUtf8(m_data, m_data.size());
- QString bibtex;
+ TQString text = TQString::fromUtf8(m_data, m_data.size());
+ TQString bibtex;
int count = 0;
- for(int pos = text.find(m_bibtexRx); count < m_limit && pos > -1; pos = text.find(m_bibtexRx, pos+m_bibtexRx.matchedLength()), ++count) {
- KURL bibtexUrl(QString::fromLatin1(SCHOLAR_BASE_URL), m_bibtexRx.cap(1));
+ for(int pos = text.tqfind(m_bibtexRx); count < m_limit && pos > -1; pos = text.tqfind(m_bibtexRx, pos+m_bibtexRx.matchedLength()), ++count) {
+ KURL bibtexUrl(TQString::tqfromLatin1(SCHOLAR_BASE_URL), m_bibtexRx.cap(1));
// myDebug() << bibtexUrl << endl;
bibtex += FileHandler::readTextFile(bibtexUrl, true);
}
@@ -179,13 +179,13 @@ void GoogleScholarFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- QString desc = entry->field(QString::fromLatin1("author"))
- + QChar('/') + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("year"));
+ TQString desc = entry->field(TQString::tqfromLatin1("author"))
+ + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("year"));
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
}
@@ -205,7 +205,7 @@ void GoogleScholarFetcher::updateEntry(Data::EntryPtr entry_) {
// limit to top 5 results
m_limit = 5;
- QString title = entry_->field(QString::fromLatin1("title"));
+ TQString title = entry_->field(TQString::tqfromLatin1("title"));
if(!title.isEmpty()) {
search(Title, title);
return;
@@ -215,18 +215,18 @@ void GoogleScholarFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* GoogleScholarFetcher::configWidget(QWidget* parent_) const {
- return new GoogleScholarFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* GoogleScholarFetcher::configWidget(TQWidget* tqparent_) const {
+ return new GoogleScholarFetcher::ConfigWidget(tqparent_, this);
}
-GoogleScholarFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const GoogleScholarFetcher*/*=0*/)
- : Fetch::ConfigWidget(parent_) {
- QVBoxLayout* l = new QVBoxLayout(optionsWidget());
- l->addWidget(new QLabel(i18n("This source has no options."), optionsWidget()));
+GoogleScholarFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const GoogleScholarFetcher*/*=0*/)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQVBoxLayout* l = new TQVBoxLayout(optionsWidget());
+ l->addWidget(new TQLabel(i18n("This source has no options."), optionsWidget()));
l->addStretch();
}
-QString GoogleScholarFetcher::ConfigWidget::preferredName() const {
+TQString GoogleScholarFetcher::ConfigWidget::preferredName() const {
return GoogleScholarFetcher::defaultName();
}
diff --git a/src/fetch/googlescholarfetcher.h b/src/fetch/googlescholarfetcher.h
index 4e15475..9391d1f 100644
--- a/src/fetch/googlescholarfetcher.h
+++ b/src/fetch/googlescholarfetcher.h
@@ -18,8 +18,8 @@
#include "configwidget.h"
#include "../datavectors.h"
-#include <qguardedptr.h>
-#include <qregexp.h>
+#include <tqguardedptr.h>
+#include <tqregexp.h>
namespace KIO {
class Job;
@@ -35,20 +35,21 @@ namespace Tellico {
*/
class GoogleScholarFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
/**
*/
- GoogleScholarFetcher(QObject* parent, const char* name = 0);
+ GoogleScholarFetcher(TQObject* tqparent, const char* name = 0);
/**
*/
virtual ~GoogleScholarFetcher();
/**
*/
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void continueSearch();
// amazon can search title or person
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person || k == Keyword; }
@@ -63,20 +64,20 @@ public:
/**
* Returns a widget for modifying the fetcher's config.
*/
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_, const GoogleScholarFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent_, const GoogleScholarFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup&) {}
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
@@ -86,15 +87,15 @@ private:
int m_start;
int m_total;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries;
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQGuardedPtr<KIO::Job> m_job;
FetchKey m_key;
- QString m_value;
+ TQString m_value;
bool m_started;
- QRegExp m_bibtexRx;
+ TQRegExp m_bibtexRx;
bool m_cookieIsSet;
};
diff --git a/src/fetch/ibsfetcher.cpp b/src/fetch/ibsfetcher.cpp
index b11258b..855d2f0 100644
--- a/src/fetch/ibsfetcher.cpp
+++ b/src/fetch/ibsfetcher.cpp
@@ -26,10 +26,10 @@
#include <kconfig.h>
#include <kio/job.h>
-#include <qregexp.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qfile.h>
+#include <tqregexp.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqfile.h>
//#define IBS_TEST
@@ -39,15 +39,15 @@ namespace {
using Tellico::Fetch::IBSFetcher;
-IBSFetcher::IBSFetcher(QObject* parent_, const char* name_ /*=0*/)
- : Fetcher(parent_, name_), m_started(false) {
+IBSFetcher::IBSFetcher(TQObject* tqparent_, const char* name_ /*=0*/)
+ : Fetcher(tqparent_, name_), m_started(false) {
}
-QString IBSFetcher::defaultName() {
+TQString IBSFetcher::defaultName() {
return i18n("Internet Bookshop (ibs.it)");
}
-QString IBSFetcher::source() const {
+TQString IBSFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -59,46 +59,46 @@ void IBSFetcher::readConfigHook(const KConfigGroup& config_) {
Q_UNUSED(config_);
}
-void IBSFetcher::search(FetchKey key_, const QString& value_) {
+void IBSFetcher::search(FetchKey key_, const TQString& value_) {
m_started = true;
m_matches.clear();
#ifdef IBS_TEST
- KURL u = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/ibs.html"));
+ KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/ibs.html"));
#else
- KURL u(QString::fromLatin1(IBS_BASE_URL));
+ KURL u(TQString::tqfromLatin1(IBS_BASE_URL));
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
switch(key_) {
case Title:
- u.addQueryItem(QString::fromLatin1("Type"), QString::fromLatin1("keyword"));
- u.addQueryItem(QString::fromLatin1("T"), value_);
+ u.addQueryItem(TQString::tqfromLatin1("Type"), TQString::tqfromLatin1("keyword"));
+ u.addQueryItem(TQString::tqfromLatin1("T"), value_);
break;
case Person:
- u.addQueryItem(QString::fromLatin1("Type"), QString::fromLatin1("keyword"));
- u.addQueryItem(QString::fromLatin1("A"), value_);
+ u.addQueryItem(TQString::tqfromLatin1("Type"), TQString::tqfromLatin1("keyword"));
+ u.addQueryItem(TQString::tqfromLatin1("A"), value_);
break;
case ISBN:
{
- QString s = value_;
+ TQString s = value_;
s.remove('-');
// limit to first isbn
s = s.section(';', 0, 0);
- u.setFileName(QString::fromLatin1("serdsp.asp"));
- u.addQueryItem(QString::fromLatin1("isbn"), s);
+ u.setFileName(TQString::tqfromLatin1("serdsp.asp"));
+ u.addQueryItem(TQString::tqfromLatin1("isbn"), s);
}
break;
case Keyword:
- u.addQueryItem(QString::fromLatin1("Type"), QString::fromLatin1("keyword"));
- u.addQueryItem(QString::fromLatin1("S"), value_);
+ u.addQueryItem(TQString::tqfromLatin1("Type"), TQString::tqfromLatin1("keyword"));
+ u.addQueryItem(TQString::tqfromLatin1("S"), value_);
break;
default:
@@ -110,12 +110,12 @@ void IBSFetcher::search(FetchKey key_, const QString& value_) {
// myDebug() << "IBSFetcher::search() - url: " << u.url() << endl;
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
if(key_ == ISBN) {
- connect(m_job, SIGNAL(result(KIO::Job*)), SLOT(slotCompleteISBN(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)), TQT_SLOT(slotCompleteISBN(KIO::Job*)));
} else {
- connect(m_job, SIGNAL(result(KIO::Job*)), SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)), TQT_SLOT(slotComplete(KIO::Job*)));
}
}
@@ -133,8 +133,8 @@ void IBSFetcher::stop() {
emit signalDone(this);
}
-void IBSFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void IBSFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -154,28 +154,28 @@ void IBSFetcher::slotComplete(KIO::Job* job_) {
return;
}
- QString s = Tellico::decodeHTML(QString(m_data));
+ TQString s = Tellico::decodeHTML(TQString(m_data));
// really specific regexp
- QString pat = QString::fromLatin1("http://www.internetbookshop.it/code/");
- QRegExp anchorRx(QString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](") +
- QRegExp::escape(pat) +
- QString::fromLatin1("[^\"]*)\"[^>]*><b>([^<]+)<"), false);
+ TQString pat = TQString::tqfromLatin1("http://www.internetbookshop.it/code/");
+ TQRegExp anchorRx(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*[\"'](") +
+ TQRegExp::escape(pat) +
+ TQString::tqfromLatin1("[^\"]*)\"[^>]*><b>([^<]+)<"), false);
anchorRx.setMinimal(true);
- QRegExp tagRx(QString::fromLatin1("<.*>"));
+ TQRegExp tagRx(TQString::tqfromLatin1("<.*>"));
tagRx.setMinimal(true);
- QString u, t, d;
+ TQString u, t, d;
int pos2;
for(int pos = anchorRx.search(s); m_started && pos > -1; pos = anchorRx.search(s, pos+anchorRx.matchedLength())) {
if(!u.isEmpty()) {
- SearchResult* r = new SearchResult(this, t, d, QString());
+ SearchResult* r = new SearchResult(this, t, d, TQString());
emit signalResultFound(r);
#ifdef IBS_TEST
- KURL url = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/ibs2.html"));
+ KURL url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/ibs2.html"));
#else
- // the url probable contains &amp; so be careful
- KURL url = u.replace(QString::fromLatin1("&amp;"), QChar('&'));
+ // the url probable tqcontains &amp; so be careful
+ KURL url = u.tqreplace(TQString::tqfromLatin1("&amp;"), TQChar('&'));
#endif
m_matches.insert(r->uid, url);
@@ -185,9 +185,9 @@ void IBSFetcher::slotComplete(KIO::Job* job_) {
}
u = anchorRx.cap(1);
t = anchorRx.cap(2);
- pos2 = s.find(QString::fromLatin1("<br>"), pos, false);
+ pos2 = s.tqfind(TQString::tqfromLatin1("<br>"), pos, false);
if(pos2 > -1) {
- int pos3 = s.find(QString::fromLatin1("<br>"), pos2+1, false);
+ int pos3 = s.tqfind(TQString::tqfromLatin1("<br>"), pos2+1, false);
if(pos3 > -1) {
d = s.mid(pos2, pos3-pos2).remove(tagRx).simplifyWhiteSpace();
}
@@ -195,9 +195,9 @@ void IBSFetcher::slotComplete(KIO::Job* job_) {
}
#ifndef IBS_TEST
if(!u.isEmpty()) {
- SearchResult* r = new SearchResult(this, t, d, QString());
+ SearchResult* r = new SearchResult(this, t, d, TQString());
emit signalResultFound(r);
- m_matches.insert(r->uid, u.replace(QString::fromLatin1("&amp;"), QChar('&')));
+ m_matches.insert(r->uid, u.tqreplace(TQString::tqfromLatin1("&amp;"), TQChar('&')));
}
#endif
@@ -220,16 +220,16 @@ void IBSFetcher::slotCompleteISBN(KIO::Job* job_) {
return;
}
- QString str = Tellico::decodeHTML(QString(m_data));
- if(str.find(QString::fromLatin1("Libro non presente"), 0, false /* cas-sensitive */) > -1) {
+ TQString str = Tellico::decodeHTML(TQString(m_data));
+ if(str.tqfind(TQString::tqfromLatin1("Libro non presente"), 0, false /* cas-sensitive */) > -1) {
stop();
return;
}
Data::EntryPtr entry = parseEntry(str);
if(entry) {
- QString desc = entry->field(QString::fromLatin1("author"))
- + '/' + entry->field(QString::fromLatin1("publisher"));
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ TQString desc = entry->field(TQString::tqfromLatin1("author"))
+ + '/' + entry->field(TQString::tqfromLatin1("publisher"));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
emit signalResultFound(r);
m_matches.insert(r->uid, static_cast<KIO::TransferJob*>(job_)->url().url());
}
@@ -250,7 +250,7 @@ Tellico::Data::EntryPtr IBSFetcher::fetchEntry(uint uid_) {
return 0;
}
- QString results = Tellico::decodeHTML(FileHandler::readTextFile(url, true));
+ TQString results = Tellico::decodeHTML(FileHandler::readTextFile(url, true));
if(results.isEmpty()) {
myDebug() << "IBSFetcher::fetchEntry() - no text results" << endl;
return 0;
@@ -259,10 +259,10 @@ Tellico::Data::EntryPtr IBSFetcher::fetchEntry(uint uid_) {
// myDebug() << url.url() << endl;
#if 0
kdWarning() << "Remove debug from ibsfetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test.html"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.html"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
t << results;
}
f.close();
@@ -277,13 +277,13 @@ Tellico::Data::EntryPtr IBSFetcher::fetchEntry(uint uid_) {
return entry;
}
-Tellico::Data::EntryPtr IBSFetcher::parseEntry(const QString& str_) {
+Tellico::Data::EntryPtr IBSFetcher::parseEntry(const TQString& str_) {
// myDebug() << "IBSFetcher::parseEntry()" << endl;
// class might be anime_info_top
- QString pat = QString::fromLatin1("%1(?:<[^>]+>)+([^<>\\s][^<>]+)");
+ TQString pat = TQString::tqfromLatin1("%1(?:<[^>]+>)+([^<>\\s][^<>]+)");
- QRegExp isbnRx(QString::fromLatin1("isbn=([\\dxX]{13})"), false);
- QString isbn;
+ TQRegExp isbnRx(TQString::tqfromLatin1("isbn=([\\dxX]{13})"), false);
+ TQString isbn;
int pos = isbnRx.search(str_);
if(pos > -1) {
isbn = isbnRx.cap(1);
@@ -292,26 +292,26 @@ Tellico::Data::EntryPtr IBSFetcher::parseEntry(const QString& str_) {
Data::CollPtr coll = new Data::BookCollection(true);
// map captions in HTML to field names
- QMap<QString, QString> fieldMap;
- fieldMap.insert(QString::fromLatin1("Titolo"), QString::fromLatin1("title"));
- fieldMap.insert(QString::fromLatin1("Autore"), QString::fromLatin1("author"));
- fieldMap.insert(QString::fromLatin1("Anno"), QString::fromLatin1("pub_year"));
- fieldMap.insert(QString::fromLatin1("Categoria"), QString::fromLatin1("genre"));
- fieldMap.insert(QString::fromLatin1("Rilegatura"), QString::fromLatin1("binding"));
- fieldMap.insert(QString::fromLatin1("Editore"), QString::fromLatin1("publisher"));
- fieldMap.insert(QString::fromLatin1("Dati"), QString::fromLatin1("edition"));
-
- QRegExp pagesRx(QString::fromLatin1("(\\d+) p\\.(\\s*,\\s*)?"));
+ TQMap<TQString, TQString> fieldMap;
+ fieldMap.insert(TQString::tqfromLatin1("Titolo"), TQString::tqfromLatin1("title"));
+ fieldMap.insert(TQString::tqfromLatin1("Autore"), TQString::tqfromLatin1("author"));
+ fieldMap.insert(TQString::tqfromLatin1("Anno"), TQString::tqfromLatin1("pub_year"));
+ fieldMap.insert(TQString::tqfromLatin1("Categoria"), TQString::tqfromLatin1("genre"));
+ fieldMap.insert(TQString::tqfromLatin1("Rilegatura"), TQString::tqfromLatin1("binding"));
+ fieldMap.insert(TQString::tqfromLatin1("Editore"), TQString::tqfromLatin1("publisher"));
+ fieldMap.insert(TQString::tqfromLatin1("Dati"), TQString::tqfromLatin1("edition"));
+
+ TQRegExp pagesRx(TQString::tqfromLatin1("(\\d+) p\\.(\\s*,\\s*)?"));
Data::EntryPtr entry = new Data::Entry(coll);
- for(QMap<QString, QString>::Iterator it = fieldMap.begin(); it != fieldMap.end(); ++it) {
- QRegExp infoRx(pat.arg(it.key()));
+ for(TQMap<TQString, TQString>::Iterator it = fieldMap.begin(); it != fieldMap.end(); ++it) {
+ TQRegExp infoRx(pat.tqarg(it.key()));
pos = infoRx.search(str_);
if(pos > -1) {
if(it.data() == Latin1Literal("edition")) {
int pos2 = pagesRx.search(infoRx.cap(1));
if(pos2 > -1) {
- entry->setField(QString::fromLatin1("pages"), pagesRx.cap(1));
+ entry->setField(TQString::tqfromLatin1("pages"), pagesRx.cap(1));
entry->setField(it.data(), infoRx.cap(1).remove(pagesRx));
} else {
entry->setField(it.data(), infoRx.cap(1));
@@ -324,70 +324,70 @@ Tellico::Data::EntryPtr IBSFetcher::parseEntry(const QString& str_) {
// image
if(!isbn.isEmpty()) {
- entry->setField(QString::fromLatin1("isbn"), isbn);
+ entry->setField(TQString::tqfromLatin1("isbn"), isbn);
#if 1
- QString imgURL = QString::fromLatin1("http://giotto.ibs.it/cop/copt13.asp?f=%1").arg(isbn);
+ TQString imgURL = TQString::tqfromLatin1("http://giotto.ibs.it/cop/copt13.asp?f=%1").tqarg(isbn);
myLog() << "IBSFetcher() - cover = " << imgURL << endl;
- QString id = ImageFactory::addImage(imgURL, true, QString::fromLatin1("http://internetbookshop.it"));
+ TQString id = ImageFactory::addImage(imgURL, true, TQString::tqfromLatin1("http://internetbookshop.it"));
if(!id.isEmpty()) {
- entry->setField(QString::fromLatin1("cover"), id);
+ entry->setField(TQString::tqfromLatin1("cover"), id);
}
#else
- QRegExp imgRx(QString::fromLatin1("<img\\s+[^>]*\\s*src\\s*=\\s*\"(http://[^/]*\\.ibs\\.it/[^\"]+e=%1)").arg(isbn));
+ TQRegExp imgRx(TQString::tqfromLatin1("<img\\s+[^>]*\\s*src\\s*=\\s*\"(http://[^/]*\\.ibs\\.it/[^\"]+e=%1)").tqarg(isbn));
imgRx.setMinimal(true);
pos = imgRx.search(str_);
if(pos > -1) {
myLog() << "IBSFetcher() - cover = " << imgRx.cap(1) << endl;
- QString id = ImageFactory::addImage(imgRx.cap(1), true, QString::fromLatin1("http://internetbookshop.it"));
+ TQString id = ImageFactory::addImage(imgRx.cap(1), true, TQString::tqfromLatin1("http://internetbookshop.it"));
if(!id.isEmpty()) {
- entry->setField(QString::fromLatin1("cover"), id);
+ entry->setField(TQString::tqfromLatin1("cover"), id);
}
}
#endif
}
// now look for description
- QRegExp descRx(QString::fromLatin1("Descrizione(?:<[^>]+>)+([^<>\\s].+)</span>"), false);
+ TQRegExp descRx(TQString::tqfromLatin1("Descrizione(?:<[^>]+>)+([^<>\\s].+)</span>"), false);
descRx.setMinimal(true);
pos = descRx.search(str_);
if(pos == -1) {
- descRx.setPattern(QString::fromLatin1("In sintesi(?:<[^>]+>)+([^<>\\s].+)</span>"));
+ descRx.setPattern(TQString::tqfromLatin1("In sintesi(?:<[^>]+>)+([^<>\\s].+)</span>"));
pos = descRx.search(str_);
}
if(pos > -1) {
- Data::FieldPtr f = new Data::Field(QString::fromLatin1("plot"), i18n("Plot Summary"), Data::Field::Para);
+ Data::FieldPtr f = new Data::Field(TQString::tqfromLatin1("plot"), i18n("Plot Summary"), Data::Field::Para);
coll->addField(f);
entry->setField(f, descRx.cap(1).simplifyWhiteSpace());
}
// IBS switches the surname and family name of the author
- QStringList names = entry->fields(QString::fromLatin1("author"), false);
+ TQStringList names = entry->fields(TQString::tqfromLatin1("author"), false);
if(!names.isEmpty() && !names[0].isEmpty()) {
- for(QStringList::Iterator it = names.begin(); it != names.end(); ++it) {
- if((*it).find(',') > -1) {
+ for(TQStringList::Iterator it = names.begin(); it != names.end(); ++it) {
+ if((*it).tqfind(',') > -1) {
continue; // skip if it has a comma
}
- QStringList words = QStringList::split(' ', *it);
+ TQStringList words = TQStringList::split(' ', *it);
if(words.isEmpty()) {
continue;
}
// put first word in back
words.append(words[0]);
words.pop_front();
- *it = words.join(QChar(' '));
+ *it = words.join(TQChar(' '));
}
- entry->setField(QString::fromLatin1("author"), names.join(QString::fromLatin1("; ")));
+ entry->setField(TQString::tqfromLatin1("author"), names.join(TQString::tqfromLatin1("; ")));
}
return entry;
}
void IBSFetcher::updateEntry(Data::EntryPtr entry_) {
- QString isbn = entry_->field(QString::fromLatin1("isbn"));
+ TQString isbn = entry_->field(TQString::tqfromLatin1("isbn"));
if(!isbn.isEmpty()) {
search(Fetch::ISBN, isbn);
return;
}
- QString t = entry_->field(QString::fromLatin1("title"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
if(!t.isEmpty()) {
search(Fetch::Title, t);
return;
@@ -397,18 +397,18 @@ void IBSFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* IBSFetcher::configWidget(QWidget* parent_) const {
- return new IBSFetcher::ConfigWidget(parent_);
+Tellico::Fetch::ConfigWidget* IBSFetcher::configWidget(TQWidget* tqparent_) const {
+ return new IBSFetcher::ConfigWidget(tqparent_);
}
-IBSFetcher::ConfigWidget::ConfigWidget(QWidget* parent_)
- : Fetch::ConfigWidget(parent_) {
- QVBoxLayout* l = new QVBoxLayout(optionsWidget());
- l->addWidget(new QLabel(i18n("This source has no options."), optionsWidget()));
+IBSFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQVBoxLayout* l = new TQVBoxLayout(optionsWidget());
+ l->addWidget(new TQLabel(i18n("This source has no options."), optionsWidget()));
l->addStretch();
}
-QString IBSFetcher::ConfigWidget::preferredName() const {
+TQString IBSFetcher::ConfigWidget::preferredName() const {
return IBSFetcher::defaultName();
}
diff --git a/src/fetch/ibsfetcher.h b/src/fetch/ibsfetcher.h
index 39326b2..b607b3a 100644
--- a/src/fetch/ibsfetcher.h
+++ b/src/fetch/ibsfetcher.h
@@ -17,8 +17,8 @@
#include "fetcher.h"
#include "configwidget.h"
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
namespace KIO {
class Job;
@@ -34,14 +34,15 @@ namespace Tellico {
*/
class IBSFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- IBSFetcher(QObject* parent, const char* name = 0);
+ IBSFetcher(TQObject* tqparent, const char* name = 0);
virtual ~IBSFetcher() {}
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
// can search title, person, isbn, or keyword. No UPC or Raw for now.
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person || k == ISBN || k == Keyword; }
virtual void stop();
@@ -52,34 +53,34 @@ public:
virtual void updateEntry(Data::EntryPtr entry);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_);
+ ConfigWidget(TQWidget* tqparent_);
virtual void saveConfig(KConfigGroup&) {}
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
void slotCompleteISBN(KIO::Job* job);
private:
- Data::EntryPtr parseEntry(const QString& str);
+ Data::EntryPtr parseEntry(const TQString& str);
- QByteArray m_data;
+ TQByteArray m_data;
int m_total;
- QMap<int, Data::EntryPtr> m_entries;
- QMap<int, KURL> m_matches;
- QGuardedPtr<KIO::Job> m_job;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQMap<int, KURL> m_matches;
+ TQGuardedPtr<KIO::Job> m_job;
bool m_started;
-// QStringList m_fields;
+// TQStringList m_fields;
};
} // end namespace
diff --git a/src/fetch/imdbfetcher.cpp b/src/fetch/imdbfetcher.cpp
index 1066177..5db3a49 100644
--- a/src/fetch/imdbfetcher.cpp
+++ b/src/fetch/imdbfetcher.cpp
@@ -29,53 +29,53 @@
#include <klineedit.h>
#include <knuminput.h>
-#include <qregexp.h>
-#include <qfile.h>
-#include <qmap.h>
-#include <qvbox.h>
-#include <qlabel.h>
-#include <qlistbox.h>
-#include <qwhatsthis.h>
-#include <qlayout.h>
-#include <qcheckbox.h>
-#include <qvgroupbox.h>
+#include <tqregexp.h>
+#include <tqfile.h>
+#include <tqmap.h>
+#include <tqvbox.h>
+#include <tqlabel.h>
+#include <tqlistbox.h>
+#include <tqwhatsthis.h>
+#include <tqlayout.h>
+#include <tqcheckbox.h>
+#include <tqvgroupbox.h>
//#define IMDB_TEST
namespace {
static const char* IMDB_SERVER = "akas.imdb.com";
static const uint IMDB_MAX_RESULTS = 20;
- static const QString sep = QString::fromLatin1("; ");
+ static const TQString sep = TQString::tqfromLatin1("; ");
}
using Tellico::Fetch::IMDBFetcher;
-QRegExp* IMDBFetcher::s_tagRx = 0;
-QRegExp* IMDBFetcher::s_anchorRx = 0;
-QRegExp* IMDBFetcher::s_anchorTitleRx = 0;
-QRegExp* IMDBFetcher::s_anchorNameRx = 0;
-QRegExp* IMDBFetcher::s_titleRx = 0;
+TQRegExp* IMDBFetcher::s_tagRx = 0;
+TQRegExp* IMDBFetcher::s_anchorRx = 0;
+TQRegExp* IMDBFetcher::s_anchorTitleRx = 0;
+TQRegExp* IMDBFetcher::s_anchorNameRx = 0;
+TQRegExp* IMDBFetcher::s_titleRx = 0;
// static
void IMDBFetcher::initRegExps() {
- s_tagRx = new QRegExp(QString::fromLatin1("<.*>"));
+ s_tagRx = new TQRegExp(TQString::tqfromLatin1("<.*>"));
s_tagRx->setMinimal(true);
- s_anchorRx = new QRegExp(QString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"[^<]*>([^<]*)</a>"), false);
+ s_anchorRx = new TQRegExp(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"[^<]*>([^<]*)</a>"), false);
s_anchorRx->setMinimal(true);
- s_anchorTitleRx = new QRegExp(QString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*/title/[^\"]*)\"[^<]*>([^<]*)</a>"), false);
+ s_anchorTitleRx = new TQRegExp(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*/title/[^\"]*)\"[^<]*>([^<]*)</a>"), false);
s_anchorTitleRx->setMinimal(true);
- s_anchorNameRx = new QRegExp(QString::fromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*/name/[^\"]*)\"[^<]*>([^<]*)</a>"), false);
+ s_anchorNameRx = new TQRegExp(TQString::tqfromLatin1("<a\\s+[^>]*href\\s*=\\s*\"([^\"]*/name/[^\"]*)\"[^<]*>([^<]*)</a>"), false);
s_anchorNameRx->setMinimal(true);
- s_titleRx = new QRegExp(QString::fromLatin1("<title>(.*)</title>"), false);
+ s_titleRx = new TQRegExp(TQString::tqfromLatin1("<title>(.*)</title>"), false);
s_titleRx->setMinimal(true);
}
-IMDBFetcher::IMDBFetcher(QObject* parent_, const char* name_) : Fetcher(parent_, name_),
- m_job(0), m_started(false), m_fetchImages(true), m_host(QString::fromLatin1(IMDB_SERVER)),
+IMDBFetcher::IMDBFetcher(TQObject* tqparent_, const char* name_) : Fetcher(tqparent_, name_),
+ m_job(0), m_started(false), m_fetchImages(true), m_host(TQString::tqfromLatin1(IMDB_SERVER)),
m_limit(IMDB_MAX_RESULTS), m_countOffset(0) {
if(!s_tagRx) {
initRegExps();
@@ -85,11 +85,11 @@ IMDBFetcher::IMDBFetcher(QObject* parent_, const char* name_) : Fetcher(parent_,
IMDBFetcher::~IMDBFetcher() {
}
-QString IMDBFetcher::defaultName() {
+TQString IMDBFetcher::defaultName() {
return i18n("Internet Movie Database");
}
-QString IMDBFetcher::source() const {
+TQString IMDBFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -98,7 +98,7 @@ bool IMDBFetcher::canFetch(int type) const {
}
void IMDBFetcher::readConfigHook(const KConfigGroup& config_) {
- QString h = config_.readEntry("Host");
+ TQString h = config_.readEntry("Host");
if(!h.isEmpty()) {
m_host = h;
}
@@ -108,7 +108,7 @@ void IMDBFetcher::readConfigHook(const KConfigGroup& config_) {
}
// multiple values not supported
-void IMDBFetcher::search(FetchKey key_, const QString& value_) {
+void IMDBFetcher::search(FetchKey key_, const TQString& value_) {
m_key = key_;
m_value = value_;
m_started = true;
@@ -130,25 +130,25 @@ void IMDBFetcher::search(FetchKey key_, const QString& value_) {
#ifdef IMDB_TEST
if(m_key == Title) {
- m_url = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/imdb-title.html"));
+ m_url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-title.html"));
m_redirected = false;
} else {
- m_url = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/imdb-name.html"));
+ m_url = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-name.html"));
m_redirected = true;
}
#else
m_url = KURL();
- m_url.setProtocol(QString::fromLatin1("http"));
- m_url.setHost(m_host.isEmpty() ? QString::fromLatin1(IMDB_SERVER) : m_host);
- m_url.setPath(QString::fromLatin1("/find"));
+ m_url.setProtocol(TQString::tqfromLatin1("http"));
+ m_url.setHost(m_host.isEmpty() ? TQString::tqfromLatin1(IMDB_SERVER) : m_host);
+ m_url.setPath(TQString::tqfromLatin1("/tqfind"));
switch(key_) {
case Title:
- m_url.addQueryItem(QString::fromLatin1("s"), QString::fromLatin1("tt"));
+ m_url.addQueryItem(TQString::tqfromLatin1("s"), TQString::tqfromLatin1("tt"));
break;
case Person:
- m_url.addQueryItem(QString::fromLatin1("s"), QString::fromLatin1("nm"));
+ m_url.addQueryItem(TQString::tqfromLatin1("s"), TQString::tqfromLatin1("nm"));
break;
default:
@@ -159,18 +159,18 @@ void IMDBFetcher::search(FetchKey key_, const QString& value_) {
// as far as I can tell, the url encoding should always be iso-8859-1
// not utf-8
- m_url.addQueryItem(QString::fromLatin1("q"), value_, 4 /* iso-8859-1 */);
+ m_url.addQueryItem(TQString::tqfromLatin1("q"), value_, 4 /* iso-8859-1 */);
// myDebug() << "IMDBFetcher::search() url = " << m_url << endl;
#endif
m_job = KIO::get(m_url, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
- connect(m_job, SIGNAL(redirection(KIO::Job *, const KURL&)),
- SLOT(slotRedirection(KIO::Job*, const KURL&)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(redirection(KIO::Job *, const KURL&)),
+ TQT_SLOT(slotRedirection(KIO::Job*, const KURL&)));
}
void IMDBFetcher::continueSearch() {
@@ -217,8 +217,8 @@ void IMDBFetcher::stop() {
emit signalDone(this);
}
-void IMDBFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void IMDBFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -260,15 +260,15 @@ void IMDBFetcher::slotComplete(KIO::Job* job_) {
void IMDBFetcher::parseSingleTitleResult() {
// myDebug() << "IMDBFetcher::parseSingleTitleResult()" << endl;
- s_titleRx->search(Tellico::decodeHTML(QString(m_data)));
- // split title at parenthesis
- const QString cap1 = s_titleRx->cap(1);
- int pPos = cap1.find('(');
- // FIXME: maybe remove parentheses here?
+ s_titleRx->search(Tellico::decodeHTML(TQString(m_data)));
+ // split title at tqparenthesis
+ const TQString cap1 = s_titleRx->cap(1);
+ int pPos = cap1.tqfind('(');
+ // FIXME: maybe remove tqparentheses here?
SearchResult* r = new SearchResult(this,
pPos == -1 ? cap1 : cap1.left(pPos),
- pPos == -1 ? QString::null : cap1.mid(pPos),
- QString());
+ pPos == -1 ? TQString() : cap1.mid(pPos),
+ TQString());
m_matches.insert(r->uid, m_url);
emit signalResultFound(r);
@@ -278,13 +278,13 @@ void IMDBFetcher::parseSingleTitleResult() {
void IMDBFetcher::parseMultipleTitleResults() {
// myDebug() << "IMDBFetcher::parseMultipleTitleResults()" << endl;
- QString output = Tellico::decodeHTML(QString(m_data));
+ TQString output = Tellico::decodeHTML(TQString(m_data));
// IMDb can return three title lists, popular, exact, and partial
// the popular titles are in the first table, after the "Popular Results" text
- int pos_popular = output.find(QString::fromLatin1("Popular Titles"), 0, false);
- int pos_exact = output.find(QString::fromLatin1("Exact Matches"), QMAX(pos_popular, 0), false);
- int pos_partial = output.find(QString::fromLatin1("Partial Matches"), QMAX(pos_exact, 0), false);
+ int pos_popular = output.tqfind(TQString::tqfromLatin1("Popular Titles"), 0, false);
+ int pos_exact = output.tqfind(TQString::tqfromLatin1("Exact Matches"), TQMAX(pos_popular, 0), false);
+ int pos_partial = output.tqfind(TQString::tqfromLatin1("Partial Matches"), TQMAX(pos_exact, 0), false);
int end_popular = pos_exact; // keep track of where to end
if(end_popular == -1) {
end_popular = pos_partial == -1 ? output.length() : pos_partial;
@@ -329,14 +329,14 @@ void IMDBFetcher::parseMultipleTitleResults() {
stop();
}
-void IMDBFetcher::parseTitleBlock(const QString& str_) {
+void IMDBFetcher::parseTitleBlock(const TQString& str_) {
if(str_.isEmpty()) {
m_countOffset = 0;
return;
}
// myDebug() << "IMDBFetcher::parseTitleBlock() - " << m_currentTitleBlock << endl;
- QRegExp akaRx(QString::fromLatin1("aka (.*)(</li>|<br)"), false);
+ TQRegExp akaRx(TQString::tqfromLatin1("aka (.*)(</li>|<br)"), false);
akaRx.setMinimal(true);
m_hasMoreResults = false;
@@ -344,29 +344,29 @@ void IMDBFetcher::parseTitleBlock(const QString& str_) {
int count = 0;
int start = s_anchorTitleRx->search(str_);
while(m_started && start > -1) {
- // split title at parenthesis
- const QString cap1 = s_anchorTitleRx->cap(1); // the anchor url
- const QString cap2 = s_anchorTitleRx->cap(2).stripWhiteSpace(); // the anchor text
+ // split title at tqparenthesis
+ const TQString cap1 = s_anchorTitleRx->cap(1); // the anchor url
+ const TQString cap2 = s_anchorTitleRx->cap(2).stripWhiteSpace(); // the anchor text
start += s_anchorTitleRx->matchedLength();
- int pPos = cap2.find('('); // if it has parentheses, use that for description
- QString desc;
+ int pPos = cap2.tqfind('('); // if it has tqparentheses, use that for description
+ TQString desc;
if(pPos > -1) {
- int pPos2 = cap2.find(')', pPos+1);
+ int pPos2 = cap2.tqfind(')', pPos+1);
if(pPos2 > -1) {
desc = cap2.mid(pPos+1, pPos2-pPos-1);
}
} else {
- // parenthesis might be outside anchor tag
+ // tqparenthesis might be outside anchor tag
int end = s_anchorTitleRx->search(str_, start);
if(end == -1) {
end = str_.length();
}
- QString text = str_.mid(start, end-start);
- pPos = text.find('(');
+ TQString text = str_.mid(start, end-start);
+ pPos = text.tqfind('(');
if(pPos > -1) {
- int pNewLine = text.find(QString::fromLatin1("<br"));
+ int pNewLine = text.tqfind(TQString::tqfromLatin1("<br"));
if(pNewLine == -1 || pPos < pNewLine) {
- int pPos2 = text.find(')', pPos);
+ int pPos2 = text.tqfind(')', pPos);
desc = text.mid(pPos+1, pPos2-pPos-1);
}
pPos = -1;
@@ -380,9 +380,9 @@ void IMDBFetcher::parseTitleBlock(const QString& str_) {
int akaPos = akaRx.search(str_, start+1);
if(akaPos > -1 && akaPos < end) {
// limit to 50 chars
- desc += QChar(' ') + akaRx.cap(1).stripWhiteSpace().remove(*s_tagRx);
+ desc += TQChar(' ') + akaRx.cap(1).stripWhiteSpace().remove(*s_tagRx);
if(desc.length() > 50) {
- desc = desc.left(50) + QString::fromLatin1("...");
+ desc = desc.left(50) + TQString::tqfromLatin1("...");
}
}
@@ -399,9 +399,9 @@ void IMDBFetcher::parseTitleBlock(const QString& str_) {
break;
}
- SearchResult* r = new SearchResult(this, pPos == -1 ? cap2 : cap2.left(pPos), desc, QString());
+ SearchResult* r = new SearchResult(this, pPos == -1 ? cap2 : cap2.left(pPos), desc, TQString());
KURL u(m_url, cap1);
- u.setQuery(QString::null);
+ u.setQuery(TQString());
m_matches.insert(r->uid, u);
emit signalResultFound(r);
++count;
@@ -417,7 +417,7 @@ void IMDBFetcher::parseSingleNameResult() {
m_currentTitleBlock = SinglePerson;
- QString output = Tellico::decodeHTML(QString(m_data));
+ TQString output = Tellico::decodeHTML(TQString(m_data));
int pos = s_anchorTitleRx->search(output);
if(pos == -1) {
@@ -425,35 +425,35 @@ void IMDBFetcher::parseSingleNameResult() {
return;
}
- QRegExp tvRegExp(QString::fromLatin1("TV\\sEpisode"), false);
+ TQRegExp tvRegExp(TQString::tqfromLatin1("TV\\sEpisode"), false);
int len = 0;
int count = 0;
- QString desc;
+ TQString desc;
for( ; m_started && pos > -1; pos = s_anchorTitleRx->search(output, pos+len)) {
desc.truncate(0);
bool isEpisode = false;
len = s_anchorTitleRx->cap(0).length();
- // split title at parenthesis
- const QString cap2 = s_anchorTitleRx->cap(2).stripWhiteSpace();
- int pPos = cap2.find('(');
+ // split title at tqparenthesis
+ const TQString cap2 = s_anchorTitleRx->cap(2).stripWhiteSpace();
+ int pPos = cap2.tqfind('(');
if(pPos > -1) {
desc = cap2.mid(pPos);
} else {
// look until the next <a
- int aPos = output.find(QString::fromLatin1("<a"), pos+len, false);
+ int aPos = output.tqfind(TQString::tqfromLatin1("<a"), pos+len, false);
if(aPos == -1) {
aPos = output.length();
}
- QString tmp = output.mid(pos+len, aPos-pos-len);
- if(tmp.find(tvRegExp) > -1) {
+ TQString tmp = output.mid(pos+len, aPos-pos-len);
+ if(tmp.tqfind(tvRegExp) > -1) {
isEpisode = true;
}
- pPos = tmp.find('(');
+ pPos = tmp.tqfind('(');
if(pPos > -1) {
- int pNewLine = tmp.find(QString::fromLatin1("<br"));
+ int pNewLine = tmp.tqfind(TQString::tqfromLatin1("<br"));
if(pNewLine == -1 || pPos < pNewLine) {
- int pEnd = tmp.find(')', pPos+1);
+ int pEnd = tmp.tqfind(')', pPos+1);
desc = tmp.mid(pPos+1, pEnd-pPos-1).remove(*s_tagRx);
}
// but need to indicate it wasn't found initially
@@ -479,10 +479,10 @@ void IMDBFetcher::parseSingleNameResult() {
break;
}
- // FIXME: maybe remove parentheses here?
- SearchResult* r = new SearchResult(this, pPos == -1 ? cap2 : cap2.left(pPos), desc, QString());
+ // FIXME: maybe remove tqparentheses here?
+ SearchResult* r = new SearchResult(this, pPos == -1 ? cap2 : cap2.left(pPos), desc, TQString());
KURL u(m_url, s_anchorTitleRx->cap(1)); // relative URL constructor
- u.setQuery(QString::null);
+ u.setQuery(TQString());
m_matches.insert(r->uid, u);
// myDebug() << u.prettyURL() << endl;
// myDebug() << cap2 << endl;
@@ -500,36 +500,36 @@ void IMDBFetcher::parseMultipleNameResults() {
// myDebug() << "IMDBFetcher::parseMultipleNameResults()" << endl;
// the exact results are in the first table after the "exact results" text
- QString output = Tellico::decodeHTML(QString(m_data));
- int pos = output.find(QString::fromLatin1("Popular Results"), 0, false);
+ TQString output = Tellico::decodeHTML(TQString(m_data));
+ int pos = output.tqfind(TQString::tqfromLatin1("Popular Results"), 0, false);
if(pos == -1) {
- pos = output.find(QString::fromLatin1("Exact Matches"), 0, false);
+ pos = output.tqfind(TQString::tqfromLatin1("Exact Matches"), 0, false);
}
// find beginning of partial matches
- int end = output.find(QString::fromLatin1("Other Results"), QMAX(pos, 0), false);
+ int end = output.tqfind(TQString::tqfromLatin1("Other Results"), TQMAX(pos, 0), false);
if(end == -1) {
- end = output.find(QString::fromLatin1("Partial Matches"), QMAX(pos, 0), false);
+ end = output.tqfind(TQString::tqfromLatin1("Partial Matches"), TQMAX(pos, 0), false);
if(end == -1) {
- end = output.find(QString::fromLatin1("Approx Matches"), QMAX(pos, 0), false);
+ end = output.tqfind(TQString::tqfromLatin1("Approx Matches"), TQMAX(pos, 0), false);
if(end == -1) {
end = output.length();
}
}
}
- QMap<QString, KURL> map;
- QMap<QString, int> nameMap;
+ TQMap<TQString, KURL> map;
+ TQMap<TQString, int> nameMap;
- QString s;
+ TQString s;
// if found exact matches
if(pos > -1) {
pos = s_anchorNameRx->search(output, pos+13);
while(pos > -1 && pos < end && m_matches.size() < m_limit) {
KURL u(m_url, s_anchorNameRx->cap(1));
s = s_anchorNameRx->cap(2).stripWhiteSpace() + ' ';
- // if more than one exact, add parentheses
- if(nameMap.contains(s) && nameMap[s] > 0) {
+ // if more than one exact, add tqparentheses
+ if(nameMap.tqcontains(s) && nameMap[s] > 0) {
// fix the first one that didn't have a number
if(nameMap[s] == 1) {
KURL u2 = map[s];
@@ -538,7 +538,7 @@ void IMDBFetcher::parseMultipleNameResults() {
}
nameMap.insert(s, nameMap[s] + 1);
// check for duplicate names
- s += QString::fromLatin1("(%1) ").arg(nameMap[s]);
+ s += TQString::tqfromLatin1("(%1) ").tqarg(nameMap[s]);
} else {
nameMap.insert(s, 1);
}
@@ -552,7 +552,7 @@ void IMDBFetcher::parseMultipleNameResults() {
while(pos > -1 && m_matches.size() < m_limit) {
KURL u(m_url, s_anchorNameRx->cap(1)); // relative URL
s = s_anchorNameRx->cap(2).stripWhiteSpace();
- if(nameMap.contains(s) && nameMap[s] > 0) {
+ if(nameMap.tqcontains(s) && nameMap[s] > 0) {
// fix the first one that didn't have a number
if(nameMap[s] == 1) {
KURL u2 = map[s];
@@ -561,7 +561,7 @@ void IMDBFetcher::parseMultipleNameResults() {
}
nameMap.insert(s, nameMap[s] + 1);
// check for duplicate names
- s += QString::fromLatin1(" (%1)").arg(nameMap[s]);
+ s += TQString::tqfromLatin1(" (%1)").tqarg(nameMap[s]);
} else {
nameMap.insert(s, 1);
}
@@ -576,16 +576,16 @@ void IMDBFetcher::parseMultipleNameResults() {
KDialogBase* dlg = new KDialogBase(Kernel::self()->widget(), "imdb dialog",
true, i18n("Select IMDB Result"), KDialogBase::Ok|KDialogBase::Cancel);
- QVBox* box = new QVBox(dlg);
+ TQVBox* box = new TQVBox(dlg);
box->setSpacing(10);
- (void) new QLabel(i18n("<qt>Your search returned multiple matches. Please select one below.</qt>"), box);
+ (void) new TQLabel(i18n("<qt>Your search returned multiple matches. Please select one below.</qt>"), box);
- QListBox* listBox = new QListBox(box);
+ TQListBox* listBox = new TQListBox(box);
listBox->setMinimumWidth(400);
- listBox->setColumnMode(QListBox::FitToWidth);
- const QStringList values = map.keys();
- for(QStringList::ConstIterator it = values.begin(); it != values.end(); ++it) {
- if((*it).endsWith(QChar(' '))) {
+ listBox->setColumnMode(TQListBox::FitToWidth);
+ const TQStringList values = map.keys();
+ for(TQStringList::ConstIterator it = values.begin(); it != values.end(); ++it) {
+ if((*it).endsWith(TQChar(' '))) {
GUI::ListBoxText* box = new GUI::ListBoxText(listBox, *it, 0);
box->setColored(true);
} else {
@@ -593,10 +593,10 @@ void IMDBFetcher::parseMultipleNameResults() {
}
}
listBox->setSelected(0, true);
- QWhatsThis::add(listBox, i18n("<qt>Select a search result.</qt>"));
+ TQWhatsThis::add(listBox, i18n("<qt>Select a search result.</qt>"));
dlg->setMainWidget(box);
- if(dlg->exec() != QDialog::Accepted || listBox->currentText().isEmpty()) {
+ if(dlg->exec() != TQDialog::Accepted || listBox->currentText().isEmpty()) {
dlg->delayedDestruct();
stop();
return;
@@ -609,12 +609,12 @@ void IMDBFetcher::parseMultipleNameResults() {
m_redirected = true;
m_data.truncate(0);
m_job = KIO::get(m_url, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
- connect(m_job, SIGNAL(redirection(KIO::Job *, const KURL&)),
- SLOT(slotRedirection(KIO::Job*, const KURL&)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(redirection(KIO::Job *, const KURL&)),
+ TQT_SLOT(slotRedirection(KIO::Job*, const KURL&)));
// do not stop() here
}
@@ -633,15 +633,15 @@ Tellico::Data::EntryPtr IMDBFetcher::fetchEntry(uint uid_) {
}
KURL origURL = m_url; // keep to switch back
- QString results;
+ TQString results;
// if the url matches the current one, no need to redownload it
if(url == m_url) {
// myDebug() << "IMDBFetcher::fetchEntry() - matches previous URL, no downloading needed." << endl;
- results = Tellico::decodeHTML(QString(m_data));
+ results = Tellico::decodeHTML(TQString(m_data));
} else {
// now it's sychronous
#ifdef IMDB_TEST
- KURL u = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/imdb-title-result.html"));
+ KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-title-result.html"));
results = Tellico::decodeHTML(FileHandler::readTextFile(u));
#else
// be quiet about failure
@@ -665,7 +665,7 @@ Tellico::Data::EntryPtr IMDBFetcher::fetchEntry(uint uid_) {
return entry;
}
-Tellico::Data::EntryPtr IMDBFetcher::parseEntry(const QString& str_) {
+Tellico::Data::EntryPtr IMDBFetcher::parseEntry(const TQString& str_) {
Data::CollPtr coll = new Data::VideoCollection(true);
Data::EntryPtr entry = new Data::Entry(coll);
@@ -675,8 +675,8 @@ Tellico::Data::EntryPtr IMDBFetcher::parseEntry(const QString& str_) {
doAlsoKnownAs(str_, entry);
doPlot(str_, entry, m_url);
doLists(str_, entry);
- doPerson(str_, entry, QString::fromLatin1("Director"), QString::fromLatin1("director"));
- doPerson(str_, entry, QString::fromLatin1("Writer"), QString::fromLatin1("writer"));
+ doPerson(str_, entry, TQString::tqfromLatin1("Director"), TQString::tqfromLatin1("director"));
+ doPerson(str_, entry, TQString::tqfromLatin1("Writer"), TQString::tqfromLatin1("writer"));
doRating(str_, entry);
doCast(str_, entry, m_url);
if(m_fetchImages) {
@@ -684,93 +684,93 @@ Tellico::Data::EntryPtr IMDBFetcher::parseEntry(const QString& str_) {
doCover(str_, entry, m_url);
}
- const QString imdb = QString::fromLatin1("imdb");
- if(!coll->hasField(imdb) && m_fields.findIndex(imdb) > -1) {
+ const TQString imdb = TQString::tqfromLatin1("imdb");
+ if(!coll->hasField(imdb) && m_fields.tqfindIndex(imdb) > -1) {
Data::FieldPtr field = new Data::Field(imdb, i18n("IMDB Link"), Data::Field::URL);
field->setCategory(i18n("General"));
coll->addField(field);
}
if(coll->hasField(imdb) && coll->fieldByName(imdb)->type() == Data::Field::URL) {
- m_url.setQuery(QString::null);
+ m_url.setQuery(TQString());
entry->setField(imdb, m_url.url());
}
return entry;
}
-void IMDBFetcher::doTitle(const QString& str_, Data::EntryPtr entry_) {
+void IMDBFetcher::doTitle(const TQString& str_, Data::EntryPtr entry_) {
if(s_titleRx->search(str_) > -1) {
- const QString cap1 = s_titleRx->cap(1);
- // titles always have parentheses
- int pPos = cap1.find('(');
- QString title = cap1.left(pPos).stripWhiteSpace();
+ const TQString cap1 = s_titleRx->cap(1);
+ // titles always have tqparentheses
+ int pPos = cap1.tqfind('(');
+ TQString title = cap1.left(pPos).stripWhiteSpace();
// remove first and last quotes is there
- if(title.startsWith(QChar('"')) && title.endsWith(QChar('"'))) {
+ if(title.startsWith(TQChar('"')) && title.endsWith(TQChar('"'))) {
title = title.mid(1, title.length()-2);
}
- entry_->setField(QString::fromLatin1("title"), title);
- // remove parenthesis
+ entry_->setField(TQString::tqfromLatin1("title"), title);
+ // remove tqparenthesis
uint pPos2 = pPos+1;
while(pPos2 < cap1.length() && cap1[pPos2].isDigit()) {
++pPos2;
}
- QString year = cap1.mid(pPos+1, pPos2-pPos-1);
+ TQString year = cap1.mid(pPos+1, pPos2-pPos-1);
if(!year.isEmpty()) {
- entry_->setField(QString::fromLatin1("year"), year);
+ entry_->setField(TQString::tqfromLatin1("year"), year);
}
}
}
-void IMDBFetcher::doRunningTime(const QString& str_, Data::EntryPtr entry_) {
+void IMDBFetcher::doRunningTime(const TQString& str_, Data::EntryPtr entry_) {
// running time
- QRegExp runtimeRx(QString::fromLatin1("runtime:.*(\\d+)\\s+min"), false);
+ TQRegExp runtimeRx(TQString::tqfromLatin1("runtime:.*(\\d+)\\s+min"), false);
runtimeRx.setMinimal(true);
if(runtimeRx.search(str_) > -1) {
// myDebug() << "running-time = " << runtimeRx.cap(1) << endl;
- entry_->setField(QString::fromLatin1("running-time"), runtimeRx.cap(1));
+ entry_->setField(TQString::tqfromLatin1("running-time"), runtimeRx.cap(1));
}
}
-void IMDBFetcher::doAspectRatio(const QString& str_, Data::EntryPtr entry_) {
- QRegExp rx(QString::fromLatin1("aspect ratio:.*([\\d\\.]+\\s*:\\s*[\\d\\.]+)"), false);
+void IMDBFetcher::doAspectRatio(const TQString& str_, Data::EntryPtr entry_) {
+ TQRegExp rx(TQString::tqfromLatin1("aspect ratio:.*([\\d\\.]+\\s*:\\s*[\\d\\.]+)"), false);
rx.setMinimal(true);
if(rx.search(str_) > -1) {
// myDebug() << "aspect ratio = " << rx.cap(1) << endl;
- entry_->setField(QString::fromLatin1("aspect-ratio"), rx.cap(1).stripWhiteSpace());
+ entry_->setField(TQString::tqfromLatin1("aspect-ratio"), rx.cap(1).stripWhiteSpace());
}
}
-void IMDBFetcher::doAlsoKnownAs(const QString& str_, Data::EntryPtr entry_) {
- if(m_fields.findIndex(QString::fromLatin1("alttitle")) == -1) {
+void IMDBFetcher::doAlsoKnownAs(const TQString& str_, Data::EntryPtr entry_) {
+ if(m_fields.tqfindIndex(TQString::tqfromLatin1("alttitle")) == -1) {
return;
}
// match until next b tag
-// QRegExp akaRx(QString::fromLatin1("also known as(.*)<b(?:\\s.*)?>"));
- QRegExp akaRx(QString::fromLatin1("also known as(.*)<(b[>\\s/]|div)"), false);
+// TQRegExp akaRx(TQString::tqfromLatin1("also known as(.*)<b(?:\\s.*)?>"));
+ TQRegExp akaRx(TQString::tqfromLatin1("also known as(.*)<(b[>\\s/]|div)"), false);
akaRx.setMinimal(true);
if(akaRx.search(str_) > -1 && !akaRx.cap(1).isEmpty()) {
- Data::FieldPtr f = entry_->collection()->fieldByName(QString::fromLatin1("alttitle"));
+ Data::FieldPtr f = entry_->collection()->fieldByName(TQString::tqfromLatin1("alttitle"));
if(!f) {
- f = new Data::Field(QString::fromLatin1("alttitle"), i18n("Alternative Titles"), Data::Field::Table);
+ f = new Data::Field(TQString::tqfromLatin1("alttitle"), i18n("Alternative Titles"), Data::Field::Table);
f->setFormatFlag(Data::Field::FormatTitle);
entry_->collection()->addField(f);
}
// split by <br>, remembering it could become valid xhtml!
- QRegExp brRx(QString::fromLatin1("<br[\\s/]*>"), false);
+ TQRegExp brRx(TQString::tqfromLatin1("<br[\\s/]*>"), false);
brRx.setMinimal(true);
- QStringList list = QStringList::split(brRx, akaRx.cap(1));
+ TQStringList list = TQStringList::split(brRx, akaRx.cap(1));
// lang could be included with [fr]
-// const QRegExp parRx(QString::fromLatin1("\\(.+\\)"));
- const QRegExp brackRx(QString::fromLatin1("\\[\\w+\\]"));
- QStringList values;
- for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) {
- QString s = *it;
+// const TQRegExp parRx(TQString::tqfromLatin1("\\(.+\\)"));
+ const TQRegExp brackRx(TQString::tqfromLatin1("\\[\\w+\\]"));
+ TQStringList values;
+ for(TQStringList::Iterator it = list.begin(); it != list.end(); ++it) {
+ TQString s = *it;
// sometimes, the word "more" gets linked to the releaseinfo page, check that
- if(s.find(QString::fromLatin1("releaseinfo")) > -1) {
+ if(s.tqfind(TQString::tqfromLatin1("releaseinfo")) > -1) {
continue;
}
s.remove(*s_tagRx);
@@ -778,7 +778,7 @@ void IMDBFetcher::doAlsoKnownAs(const QString& str_, Data::EntryPtr entry_) {
s = s.stripWhiteSpace();
// the first value ends up being or starting with the colon after "Also know as"
// I'm too lazy to figure out a better regexp
- if(s.startsWith(QChar(':'))) {
+ if(s.startsWith(TQChar(':'))) {
s = s.mid(1);
}
if(!s.isEmpty()) {
@@ -786,71 +786,71 @@ void IMDBFetcher::doAlsoKnownAs(const QString& str_, Data::EntryPtr entry_) {
}
}
if(!values.isEmpty()) {
- entry_->setField(QString::fromLatin1("alttitle"), values.join(sep));
+ entry_->setField(TQString::tqfromLatin1("alttitle"), values.join(sep));
}
}
}
-void IMDBFetcher::doPlot(const QString& str_, Data::EntryPtr entry_, const KURL& baseURL_) {
+void IMDBFetcher::doPlot(const TQString& str_, Data::EntryPtr entry_, const KURL& baseURL_) {
// plot summaries provided by users are on a separate page
// should those be preferred?
bool useUserSummary = false;
- QString thisPlot;
+ TQString thisPlot;
// match until next opening tag
- QRegExp plotRx(QString::fromLatin1("plot (?:outline|summary):(.*)<[^/].*</"), false);
+ TQRegExp plotRx(TQString::tqfromLatin1("plot (?:outline|summary):(.*)<[^/].*</"), false);
plotRx.setMinimal(true);
- QRegExp plotURLRx(QString::fromLatin1("<a\\s+.*href\\s*=\\s*\".*/title/.*/plotsummary\""), false);
+ TQRegExp plotURLRx(TQString::tqfromLatin1("<a\\s+.*href\\s*=\\s*\".*/title/.*/plotsummary\""), false);
plotURLRx.setMinimal(true);
if(plotRx.search(str_) > -1) {
thisPlot = plotRx.cap(1);
thisPlot.remove(*s_tagRx); // remove HTML tags
- entry_->setField(QString::fromLatin1("plot"), thisPlot);
- // if thisPlot ends with (more) or contains
+ entry_->setField(TQString::tqfromLatin1("plot"), thisPlot);
+ // if thisPlot ends with (more) or tqcontains
// a url that ends with plotsummary, then we'll grab it, otherwise not
- if(plotRx.cap(0).endsWith(QString::fromLatin1("(more)</")) || plotURLRx.search(plotRx.cap(0)) > -1) {
+ if(plotRx.cap(0).endsWith(TQString::tqfromLatin1("(more)</")) || plotURLRx.search(plotRx.cap(0)) > -1) {
useUserSummary = true;
}
}
if(useUserSummary) {
- QRegExp idRx(QString::fromLatin1("title/(tt\\d+)"));
+ TQRegExp idRx(TQString::tqfromLatin1("title/(tt\\d+)"));
idRx.search(baseURL_.path());
KURL plotURL = baseURL_;
- plotURL.setPath(QString::fromLatin1("/title/") + idRx.cap(1) + QString::fromLatin1("/plotsummary"));
+ plotURL.setPath(TQString::tqfromLatin1("/title/") + idRx.cap(1) + TQString::tqfromLatin1("/plotsummary"));
// be quiet about failure
- QString plotPage = FileHandler::readTextFile(plotURL, true);
+ TQString plotPage = FileHandler::readTextFile(plotURL, true);
if(!plotPage.isEmpty()) {
- QRegExp plotRx(QString::fromLatin1("<p\\s+class\\s*=\\s*\"plotpar\">(.*)</p"));
+ TQRegExp plotRx(TQString::tqfromLatin1("<p\\s+class\\s*=\\s*\"plotpar\">(.*)</p"));
plotRx.setMinimal(true);
if(plotRx.search(plotPage) > -1) {
- QString userPlot = plotRx.cap(1);
+ TQString userPlot = plotRx.cap(1);
userPlot.remove(*s_tagRx); // remove HTML tags
- entry_->setField(QString::fromLatin1("plot"), Tellico::decodeHTML(userPlot));
+ entry_->setField(TQString::tqfromLatin1("plot"), Tellico::decodeHTML(userPlot));
}
}
}
}
-void IMDBFetcher::doPerson(const QString& str_, Data::EntryPtr entry_,
- const QString& imdbHeader_, const QString& fieldName_) {
- QRegExp br2Rx(QString::fromLatin1("<br[\\s/]*>\\s*<br[\\s/]*>"), false);
+void IMDBFetcher::doPerson(const TQString& str_, Data::EntryPtr entry_,
+ const TQString& imdbHeader_, const TQString& fieldName_) {
+ TQRegExp br2Rx(TQString::tqfromLatin1("<br[\\s/]*>\\s*<br[\\s/]*>"), false);
br2Rx.setMinimal(true);
- QRegExp divRx(QString::fromLatin1("<[/]*div"), false);
+ TQRegExp divRx(TQString::tqfromLatin1("<[/]*div"), false);
divRx.setMinimal(true);
- QString name = QString::fromLatin1("/name/");
+ TQString name = TQString::tqfromLatin1("/name/");
StringSet people;
- for(int pos = str_.find(imdbHeader_); pos > 0; pos = str_.find(imdbHeader_, pos)) {
+ for(int pos = str_.tqfind(imdbHeader_); pos > 0; pos = str_.tqfind(imdbHeader_, pos)) {
// loop until repeated <br> tags or </div> tag
- const int endPos1 = str_.find(br2Rx, pos);
- const int endPos2 = str_.find(divRx, pos);
- const int endPos = QMIN(endPos1, endPos2); // ok to be -1
+ const int endPos1 = str_.tqfind(br2Rx, pos);
+ const int endPos2 = str_.tqfind(divRx, pos);
+ const int endPos = TQMIN(endPos1, endPos2); // ok to be -1
pos = s_anchorRx->search(str_, pos+1);
while(pos > -1 && pos < endPos) {
- if(s_anchorRx->cap(1).find(name) > -1) {
+ if(s_anchorRx->cap(1).tqfind(name) > -1) {
people.add(s_anchorRx->cap(2).stripWhiteSpace());
}
pos = s_anchorRx->search(str_, pos+1);
@@ -861,50 +861,50 @@ void IMDBFetcher::doPerson(const QString& str_, Data::EntryPtr entry_,
}
}
-void IMDBFetcher::doCast(const QString& str_, Data::EntryPtr entry_, const KURL& baseURL_) {
+void IMDBFetcher::doCast(const TQString& str_, Data::EntryPtr entry_, const KURL& baseURL_) {
// the extended cast list is on a separate page
// that's usually a lot of people
// but since it can be in billing order, the main actors might not
// be in the short list
- QRegExp idRx(QString::fromLatin1("title/(tt\\d+)"));
+ TQRegExp idRx(TQString::tqfromLatin1("title/(tt\\d+)"));
idRx.search(baseURL_.path());
#ifdef IMDB_TEST
- KURL castURL = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/imdb-title-fullcredits.html"));
+ KURL castURL = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/imdb-title-fullcredits.html"));
#else
KURL castURL = baseURL_;
- castURL.setPath(QString::fromLatin1("/title/") + idRx.cap(1) + QString::fromLatin1("/fullcredits"));
+ castURL.setPath(TQString::tqfromLatin1("/title/") + idRx.cap(1) + TQString::tqfromLatin1("/fullcredits"));
#endif
// be quiet about failure and be sure to translate entities
- QString castPage = Tellico::decodeHTML(FileHandler::readTextFile(castURL, true));
+ TQString castPage = Tellico::decodeHTML(FileHandler::readTextFile(castURL, true));
int pos = -1;
// the text to search, depends on which page is being read
- QString castText = castPage;
+ TQString castText = castPage;
if(castText.isEmpty()) {
// fall back to short list
castText = str_;
- pos = castText.find(QString::fromLatin1("cast overview"), 0, false);
+ pos = castText.tqfind(TQString::tqfromLatin1("cast overview"), 0, false);
if(pos == -1) {
- pos = castText.find(QString::fromLatin1("credited cast"), 0, false);
+ pos = castText.tqfind(TQString::tqfromLatin1("credited cast"), 0, false);
}
} else {
// first look for anchor
- QRegExp castAnchorRx(QString::fromLatin1("<a\\s+name\\s*=\\s*\"cast\""), false);
- pos = castText.find(castAnchorRx);
+ TQRegExp castAnchorRx(TQString::tqfromLatin1("<a\\s+name\\s*=\\s*\"cast\""), false);
+ pos = castText.tqfind(castAnchorRx);
if(pos < 0) {
- QRegExp tableClassRx(QString::fromLatin1("<table\\s+class\\s*=\\s*\"cast\""), false);
- pos = castText.find(tableClassRx);
+ TQRegExp tableClassRx(TQString::tqfromLatin1("<table\\s+class\\s*=\\s*\"cast\""), false);
+ pos = castText.tqfind(tableClassRx);
if(pos < 0) {
- // fragile, the word "cast" appears in the title, but need to find
+ // fragile, the word "cast" appears in the title, but need to tqfind
// the one right above the actual cast table
// for TV shows, there's a link on the sidebar for "episodes case"
// so need to not match that one
- pos = castText.find(QString::fromLatin1("cast</"), 0, false);
+ pos = castText.tqfind(TQString::tqfromLatin1("cast</"), 0, false);
if(pos > 9) {
// back up 9 places
- if(castText.mid(pos-9, 9).startsWith(QString::fromLatin1("episodes"))) {
+ if(castText.mid(pos-9, 9).startsWith(TQString::tqfromLatin1("episodes"))) {
// find next cast list
- pos = castText.find(QString::fromLatin1("cast</"), pos+6, false);
+ pos = castText.tqfind(TQString::tqfromLatin1("cast</"), pos+6, false);
}
}
}
@@ -915,22 +915,22 @@ void IMDBFetcher::doCast(const QString& str_, Data::EntryPtr entry_, const KURL&
return;
}
- const QString name = QString::fromLatin1("/name/");
- QRegExp tdRx(QString::fromLatin1("<td[^>]*>(.*)</td>"), false);
+ const TQString name = TQString::tqfromLatin1("/name/");
+ TQRegExp tdRx(TQString::tqfromLatin1("<td[^>]*>(.*)</td>"), false);
tdRx.setMinimal(true);
- QStringList cast;
+ TQStringList cast;
// loop until closing table tag
- const int endPos = castText.find(QString::fromLatin1("</table"), pos, false);
+ const int endPos = castText.tqfind(TQString::tqfromLatin1("</table"), pos, false);
pos = s_anchorRx->search(castText, pos+1);
while(pos > -1 && pos < endPos && static_cast<int>(cast.count()) < m_numCast) {
- if(s_anchorRx->cap(1).find(name) > -1) {
+ if(s_anchorRx->cap(1).tqfind(name) > -1) {
// now search for <td> item with character name
// there's a column with ellipses then the character
const int pos2 = tdRx.search(castText, pos);
if(pos2 > -1 && tdRx.search(castText, pos2+1) > -1) {
cast += s_anchorRx->cap(2).stripWhiteSpace()
- + QString::fromLatin1("::") + tdRx.cap(1).simplifyWhiteSpace().remove(*s_tagRx);
+ + TQString::tqfromLatin1("::") + tdRx.cap(1).simplifyWhiteSpace().remove(*s_tagRx);
} else {
cast += s_anchorRx->cap(2).stripWhiteSpace();
}
@@ -939,52 +939,52 @@ void IMDBFetcher::doCast(const QString& str_, Data::EntryPtr entry_, const KURL&
}
if(!cast.isEmpty()) {
- entry_->setField(QString::fromLatin1("cast"), cast.join(sep));
+ entry_->setField(TQString::tqfromLatin1("cast"), cast.join(sep));
}
}
-void IMDBFetcher::doRating(const QString& str_, Data::EntryPtr entry_) {
- if(m_fields.findIndex(QString::fromLatin1("imdb-rating")) == -1) {
+void IMDBFetcher::doRating(const TQString& str_, Data::EntryPtr entry_) {
+ if(m_fields.tqfindIndex(TQString::tqfromLatin1("imdb-rating")) == -1) {
return;
}
// don't add a colon, since there's a <br> at the end
// some of the imdb images use /10.gif in their path, so check for space or bracket
- QRegExp rx(QString::fromLatin1("[>\\s](\\d+.?\\d*)/10[<//s]"), false);
+ TQRegExp rx(TQString::tqfromLatin1("[>\\s](\\d+.?\\d*)/10[<//s]"), false);
rx.setMinimal(true);
if(rx.search(str_) > -1 && !rx.cap(1).isEmpty()) {
- Data::FieldPtr f = entry_->collection()->fieldByName(QString::fromLatin1("imdb-rating"));
+ Data::FieldPtr f = entry_->collection()->fieldByName(TQString::tqfromLatin1("imdb-rating"));
if(!f) {
- f = new Data::Field(QString::fromLatin1("imdb-rating"), i18n("IMDB Rating"), Data::Field::Rating);
+ f = new Data::Field(TQString::tqfromLatin1("imdb-rating"), i18n("IMDB Rating"), Data::Field::Rating);
f->setCategory(i18n("General"));
- f->setProperty(QString::fromLatin1("maximum"), QString::fromLatin1("10"));
+ f->setProperty(TQString::tqfromLatin1("maximum"), TQString::tqfromLatin1("10"));
entry_->collection()->addField(f);
}
bool ok;
float value = rx.cap(1).toFloat(&ok);
if(ok) {
- entry_->setField(QString::fromLatin1("imdb-rating"), QString::number(value));
+ entry_->setField(TQString::tqfromLatin1("imdb-rating"), TQString::number(value));
}
}
}
-void IMDBFetcher::doCover(const QString& str_, Data::EntryPtr entry_, const KURL& baseURL_) {
+void IMDBFetcher::doCover(const TQString& str_, Data::EntryPtr entry_, const KURL& baseURL_) {
// cover is the img with the "cover" alt text
- QRegExp imgRx(QString::fromLatin1("<img\\s+[^>]*src\\s*=\\s*\"([^\"]*)\"[^>]*>"), false);
+ TQRegExp imgRx(TQString::tqfromLatin1("<img\\s+[^>]*src\\s*=\\s*\"([^\"]*)\"[^>]*>"), false);
imgRx.setMinimal(true);
- QRegExp posterRx(QString::fromLatin1("<a\\s+[^>]*name\\s*=\\s*\"poster\"[^>]*>(.*)</a>"), false);
+ TQRegExp posterRx(TQString::tqfromLatin1("<a\\s+[^>]*name\\s*=\\s*\"poster\"[^>]*>(.*)</a>"), false);
posterRx.setMinimal(true);
- const QString cover = QString::fromLatin1("cover");
+ const TQString cover = TQString::tqfromLatin1("cover");
int pos = posterRx.search(str_);
while(pos > -1) {
if(imgRx.search(posterRx.cap(1)) > -1) {
KURL u(baseURL_, imgRx.cap(1));
- QString id = ImageFactory::addImage(u, true);
+ TQString id = ImageFactory::addImage(u, true);
if(!id.isEmpty()) {
entry_->setField(cover, id);
}
@@ -996,9 +996,9 @@ void IMDBFetcher::doCover(const QString& str_, Data::EntryPtr entry_, const KURL
// didn't find the cover, IMDb also used to put "cover" inside the url
pos = imgRx.search(str_);
while(pos > -1) {
- if(imgRx.cap(0).find(cover, 0, false) > -1) {
+ if(imgRx.cap(0).tqfind(cover, 0, false) > -1) {
KURL u(baseURL_, imgRx.cap(1));
- QString id = ImageFactory::addImage(u, true);
+ TQString id = ImageFactory::addImage(u, true);
if(!id.isEmpty()) {
entry_->setField(cover, id);
}
@@ -1010,79 +1010,79 @@ void IMDBFetcher::doCover(const QString& str_, Data::EntryPtr entry_, const KURL
// end up reparsing whole string, but it's not really that slow
// loook at every anchor tag in the string
-void IMDBFetcher::doLists(const QString& str_, Data::EntryPtr entry_) {
- const QString genre = QString::fromLatin1("/Genres/");
- const QString country = QString::fromLatin1("/Countries/");
- const QString lang = QString::fromLatin1("/Languages/");
- const QString colorInfo = QString::fromLatin1("color-info");
- const QString cert = QString::fromLatin1("certificates=");
- const QString soundMix = QString::fromLatin1("sound-mix=");
- const QString year = QString::fromLatin1("/Years/");
- const QString company = QString::fromLatin1("/company/");
+void IMDBFetcher::doLists(const TQString& str_, Data::EntryPtr entry_) {
+ const TQString genre = TQString::tqfromLatin1("/Genres/");
+ const TQString country = TQString::tqfromLatin1("/Countries/");
+ const TQString lang = TQString::tqfromLatin1("/Languages/");
+ const TQString colorInfo = TQString::tqfromLatin1("color-info");
+ const TQString cert = TQString::tqfromLatin1("certificates=");
+ const TQString soundMix = TQString::tqfromLatin1("sound-mix=");
+ const TQString year = TQString::tqfromLatin1("/Years/");
+ const TQString company = TQString::tqfromLatin1("/company/");
// IIMdb also has links with the word "sections" in them, remove that
// for genres and nationalities
- QStringList genres, countries, langs, certs, tracks, studios;
+ TQStringList genres, countries, langs, certs, tracks, studios;
for(int pos = s_anchorRx->search(str_); pos > -1; pos = s_anchorRx->search(str_, pos+1)) {
- const QString cap1 = s_anchorRx->cap(1);
- if(cap1.find(genre) > -1) {
- if(s_anchorRx->cap(2).find(QString::fromLatin1(" section"), 0, false) == -1) {
+ const TQString cap1 = s_anchorRx->cap(1);
+ if(cap1.tqfind(genre) > -1) {
+ if(s_anchorRx->cap(2).tqfind(TQString::tqfromLatin1(" section"), 0, false) == -1) {
genres += s_anchorRx->cap(2).stripWhiteSpace();
}
- } else if(cap1.find(country) > -1) {
- if(s_anchorRx->cap(2).find(QString::fromLatin1(" section"), 0, false) == -1) {
+ } else if(cap1.tqfind(country) > -1) {
+ if(s_anchorRx->cap(2).tqfind(TQString::tqfromLatin1(" section"), 0, false) == -1) {
countries += s_anchorRx->cap(2).stripWhiteSpace();
}
- } else if(cap1.find(lang) > -1) {
+ } else if(cap1.tqfind(lang) > -1) {
langs += s_anchorRx->cap(2).stripWhiteSpace();
- } else if(cap1.find(colorInfo) > -1) {
+ } else if(cap1.tqfind(colorInfo) > -1) {
// change "black and white" to "black & white"
- entry_->setField(QString::fromLatin1("color"),
- s_anchorRx->cap(2).replace(QString::fromLatin1("and"), QChar('&')).stripWhiteSpace());
- } else if(cap1.find(cert) > -1) {
+ entry_->setField(TQString::tqfromLatin1("color"),
+ s_anchorRx->cap(2).tqreplace(TQString::tqfromLatin1("and"), TQChar('&')).stripWhiteSpace());
+ } else if(cap1.tqfind(cert) > -1) {
certs += s_anchorRx->cap(2).stripWhiteSpace();
- } else if(cap1.find(soundMix) > -1) {
+ } else if(cap1.tqfind(soundMix) > -1) {
tracks += s_anchorRx->cap(2).stripWhiteSpace();
- } else if(cap1.find(company) > -1) {
+ } else if(cap1.tqfind(company) > -1) {
studios += s_anchorRx->cap(2).stripWhiteSpace();
// if year field wasn't set before, do it now
- } else if(entry_->field(QString::fromLatin1("year")).isEmpty() && cap1.find(year) > -1) {
- entry_->setField(QString::fromLatin1("year"), s_anchorRx->cap(2).stripWhiteSpace());
+ } else if(entry_->field(TQString::tqfromLatin1("year")).isEmpty() && cap1.tqfind(year) > -1) {
+ entry_->setField(TQString::tqfromLatin1("year"), s_anchorRx->cap(2).stripWhiteSpace());
}
}
- entry_->setField(QString::fromLatin1("genre"), genres.join(sep));
- entry_->setField(QString::fromLatin1("nationality"), countries.join(sep));
- entry_->setField(QString::fromLatin1("language"), langs.join(sep));
- entry_->setField(QString::fromLatin1("audio-track"), tracks.join(sep));
- entry_->setField(QString::fromLatin1("studio"), studios.join(sep));
+ entry_->setField(TQString::tqfromLatin1("genre"), genres.join(sep));
+ entry_->setField(TQString::tqfromLatin1("nationality"), countries.join(sep));
+ entry_->setField(TQString::tqfromLatin1("language"), langs.join(sep));
+ entry_->setField(TQString::tqfromLatin1("audio-track"), tracks.join(sep));
+ entry_->setField(TQString::tqfromLatin1("studio"), studios.join(sep));
if(!certs.isEmpty()) {
// first try to set default certification
- const QStringList& certsAllowed = entry_->collection()->fieldByName(QString::fromLatin1("certification"))->allowed();
- for(QStringList::ConstIterator it = certs.begin(); it != certs.end(); ++it) {
- QString country = (*it).section(':', 0, 0);
- QString cert = (*it).section(':', 1, 1);
+ const TQStringList& certsAllowed = entry_->collection()->fieldByName(TQString::tqfromLatin1("certification"))->allowed();
+ for(TQStringList::ConstIterator it = certs.begin(); it != certs.end(); ++it) {
+ TQString country = (*it).section(':', 0, 0);
+ TQString cert = (*it).section(':', 1, 1);
if(cert == Latin1Literal("Unrated")) {
- cert = QChar('U');
+ cert = TQChar('U');
}
- cert += QString::fromLatin1(" (") + country + ')';
- if(certsAllowed.findIndex(cert) > -1) {
- entry_->setField(QString::fromLatin1("certification"), cert);
+ cert += TQString::tqfromLatin1(" (") + country + ')';
+ if(certsAllowed.tqfindIndex(cert) > -1) {
+ entry_->setField(TQString::tqfromLatin1("certification"), cert);
break;
}
}
// now add new field for all certifications
- const QString allc = QString::fromLatin1("allcertification");
- if(m_fields.findIndex(allc) > -1) {
+ const TQString allc = TQString::tqfromLatin1("allcertification");
+ if(m_fields.tqfindIndex(allc) > -1) {
Data::FieldPtr f = entry_->collection()->fieldByName(allc);
if(!f) {
f = new Data::Field(allc, i18n("Certifications"), Data::Field::Table);
f->setFlags(Data::Field::AllowGrouped);
entry_->collection()->addField(f);
}
- entry_->setField(QString::fromLatin1("allcertification"), certs.join(sep));
+ entry_->setField(TQString::tqfromLatin1("allcertification"), certs.join(sep));
}
}
}
@@ -1091,8 +1091,8 @@ void IMDBFetcher::updateEntry(Data::EntryPtr entry_) {
// myLog() << "IMDBFetcher::updateEntry() - " << entry_->title() << endl;
// only take first 5
m_limit = 5;
- QString t = entry_->field(QString::fromLatin1("title"));
- KURL link = entry_->field(QString::fromLatin1("imdb"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
+ KURL link = entry_->field(TQString::tqfromLatin1("imdb"));
if(!link.isEmpty() && link.isValid()) {
// check if we want a different host
if(link.host() != m_host) {
@@ -1107,12 +1107,12 @@ void IMDBFetcher::updateEntry(Data::EntryPtr entry_) {
m_url = link;
m_redirected = true; // m_redirected is used as a flag later to tell if we get a single result
m_job = KIO::get(m_url, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
- connect(m_job, SIGNAL(redirection(KIO::Job *, const KURL&)),
- SLOT(slotRedirection(KIO::Job*, const KURL&)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(redirection(KIO::Job *, const KURL&)),
+ TQT_SLOT(slotRedirection(KIO::Job*, const KURL&)));
return;
}
// optimistically try searching for title and rely on Collection::sameEntry() to figure things out
@@ -1123,64 +1123,64 @@ void IMDBFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* IMDBFetcher::configWidget(QWidget* parent_) const {
- return new IMDBFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* IMDBFetcher::configWidget(TQWidget* tqparent_) const {
+ return new IMDBFetcher::ConfigWidget(tqparent_, this);
}
-IMDBFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const IMDBFetcher* fetcher_/*=0*/)
- : Fetch::ConfigWidget(parent_) {
- QGridLayout* l = new QGridLayout(optionsWidget(), 4, 2);
+IMDBFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const IMDBFetcher* fetcher_/*=0*/)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQGridLayout* l = new TQGridLayout(optionsWidget(), 4, 2);
l->setSpacing(4);
l->setColStretch(1, 10);
int row = -1;
- QLabel* label = new QLabel(i18n("Hos&t: "), optionsWidget());
+ TQLabel* label = new TQLabel(i18n("Hos&t: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_hostEdit = new KLineEdit(optionsWidget());
- connect(m_hostEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ connect(m_hostEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_hostEdit, row, 1);
- QString w = i18n("The Internet Movie Database uses several different servers. Choose the one "
+ TQString w = i18n("The Internet Movie Database uses several different servers. Choose the one "
"you wish to use.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_hostEdit, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_hostEdit, w);
label->setBuddy(m_hostEdit);
- label = new QLabel(i18n("&Maximum cast: "), optionsWidget());
+ label = new TQLabel(i18n("&Maximum cast: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_numCast = new KIntSpinBox(0, 99, 1, 10, 10, optionsWidget());
- connect(m_numCast, SIGNAL(valueChanged(const QString&)), SLOT(slotSetModified()));
+ connect(m_numCast, TQT_SIGNAL(valueChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_numCast, row, 1);
w = i18n("The list of cast members may include many people. Set the maximum number returned from the search.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_numCast, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_numCast, w);
label->setBuddy(m_numCast);
- m_fetchImageCheck = new QCheckBox(i18n("Download cover &image"), optionsWidget());
- connect(m_fetchImageCheck, SIGNAL(clicked()), SLOT(slotSetModified()));
+ m_fetchImageCheck = new TQCheckBox(i18n("Download cover &image"), optionsWidget());
+ connect(m_fetchImageCheck, TQT_SIGNAL(clicked()), TQT_SLOT(slotSetModified()));
++row;
l->addMultiCellWidget(m_fetchImageCheck, row, row, 0, 1);
w = i18n("The cover image may be downloaded as well. However, too many large images in the "
"collection may degrade performance.");
- QWhatsThis::add(m_fetchImageCheck, w);
+ TQWhatsThis::add(m_fetchImageCheck, w);
l->setRowStretch(++row, 10);
// now add additional fields widget
- addFieldsWidget(IMDBFetcher::customFields(), fetcher_ ? fetcher_->m_fields : QStringList());
+ addFieldsWidget(IMDBFetcher::customFields(), fetcher_ ? fetcher_->m_fields : TQStringList());
if(fetcher_) {
m_hostEdit->setText(fetcher_->m_host);
m_numCast->setValue(fetcher_->m_numCast);
m_fetchImageCheck->setChecked(fetcher_->m_fetchImages);
} else { //defaults
- m_hostEdit->setText(QString::fromLatin1(IMDB_SERVER));
+ m_hostEdit->setText(TQString::tqfromLatin1(IMDB_SERVER));
m_numCast->setValue(10);
m_fetchImageCheck->setChecked(true);
}
}
void IMDBFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
- QString host = m_hostEdit->text().stripWhiteSpace();
+ TQString host = m_hostEdit->text().stripWhiteSpace();
if(!host.isEmpty()) {
config_.writeEntry("Host", host);
}
@@ -1191,17 +1191,17 @@ void IMDBFetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
slotSetModified(false);
}
-QString IMDBFetcher::ConfigWidget::preferredName() const {
+TQString IMDBFetcher::ConfigWidget::preferredName() const {
return IMDBFetcher::defaultName();
}
//static
Tellico::StringMap IMDBFetcher::customFields() {
StringMap map;
- map[QString::fromLatin1("imdb")] = i18n("IMDB Link");
- map[QString::fromLatin1("imdb-rating")] = i18n("IMDB Rating");
- map[QString::fromLatin1("alttitle")] = i18n("Alternative Titles");
- map[QString::fromLatin1("allcertification")] = i18n("Certifications");
+ map[TQString::tqfromLatin1("imdb")] = i18n("IMDB Link");
+ map[TQString::tqfromLatin1("imdb-rating")] = i18n("IMDB Rating");
+ map[TQString::tqfromLatin1("alttitle")] = i18n("Alternative Titles");
+ map[TQString::tqfromLatin1("allcertification")] = i18n("Certifications");
return map;
}
diff --git a/src/fetch/imdbfetcher.h b/src/fetch/imdbfetcher.h
index 3dc19f2..fd68b62 100644
--- a/src/fetch/imdbfetcher.h
+++ b/src/fetch/imdbfetcher.h
@@ -21,14 +21,14 @@
#include <kurl.h>
#include <kio/job.h>
-#include <qcstring.h> // for QByteArray
-#include <qmap.h>
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqmap.h>
+#include <tqguardedptr.h>
class KLineEdit;
class KIntSpinBox;
-class QCheckBox;
-class QRegExpr;
+class TQCheckBox;
+class TQRegExpr;
namespace Tellico {
namespace Fetch {
@@ -38,16 +38,17 @@ namespace Tellico {
*/
class IMDBFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- IMDBFetcher(QObject* parent, const char* name=0);
+ IMDBFetcher(TQObject* tqparent, const char* name=0);
/**
*/
virtual ~IMDBFetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void continueSearch();
// imdb can search title, person
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person; }
@@ -59,77 +60,77 @@ public:
virtual void updateEntry(Data::EntryPtr entry);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
static StringMap customFields();
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_, const IMDBFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent_, const IMDBFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup& config);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
private:
KLineEdit* m_hostEdit;
- QCheckBox* m_fetchImageCheck;
+ TQCheckBox* m_fetchImageCheck;
KIntSpinBox* m_numCast;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
void slotRedirection(KIO::Job* job, const KURL& toURL);
private:
static void initRegExps();
- static QRegExp* s_tagRx;
- static QRegExp* s_anchorRx;
- static QRegExp* s_anchorTitleRx;
- static QRegExp* s_anchorNameRx;
- static QRegExp* s_titleRx;
-
- void doTitle(const QString& s, Data::EntryPtr e);
- void doRunningTime(const QString& s, Data::EntryPtr e);
- void doAspectRatio(const QString& s, Data::EntryPtr e);
- void doAlsoKnownAs(const QString& s, Data::EntryPtr e);
- void doPlot(const QString& s, Data::EntryPtr e, const KURL& baseURL_);
- void doPerson(const QString& s, Data::EntryPtr e,
- const QString& imdbHeader, const QString& fieldName);
- void doCast(const QString& s, Data::EntryPtr e, const KURL& baseURL_);
- void doLists(const QString& s, Data::EntryPtr e);
- void doRating(const QString& s, Data::EntryPtr e);
- void doCover(const QString& s, Data::EntryPtr e, const KURL& baseURL);
+ static TQRegExp* s_tagRx;
+ static TQRegExp* s_anchorRx;
+ static TQRegExp* s_anchorTitleRx;
+ static TQRegExp* s_anchorNameRx;
+ static TQRegExp* s_titleRx;
+
+ void doTitle(const TQString& s, Data::EntryPtr e);
+ void doRunningTime(const TQString& s, Data::EntryPtr e);
+ void doAspectRatio(const TQString& s, Data::EntryPtr e);
+ void doAlsoKnownAs(const TQString& s, Data::EntryPtr e);
+ void doPlot(const TQString& s, Data::EntryPtr e, const KURL& baseURL_);
+ void doPerson(const TQString& s, Data::EntryPtr e,
+ const TQString& imdbHeader, const TQString& fieldName);
+ void doCast(const TQString& s, Data::EntryPtr e, const KURL& baseURL_);
+ void doLists(const TQString& s, Data::EntryPtr e);
+ void doRating(const TQString& s, Data::EntryPtr e);
+ void doCover(const TQString& s, Data::EntryPtr e, const KURL& baseURL);
void parseSingleTitleResult();
void parseSingleNameResult();
void parseMultipleTitleResults();
- void parseTitleBlock(const QString& str);
+ void parseTitleBlock(const TQString& str);
void parseMultipleNameResults();
- Data::EntryPtr parseEntry(const QString& str);
+ Data::EntryPtr parseEntry(const TQString& str);
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries;
- QMap<int, KURL> m_matches;
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQMap<int, KURL> m_matches;
+ TQGuardedPtr<KIO::Job> m_job;
FetchKey m_key;
- QString m_value;
+ TQString m_value;
bool m_started;
bool m_fetchImages;
- QString m_host;
+ TQString m_host;
int m_numCast;
KURL m_url;
bool m_redirected;
uint m_limit;
- QStringList m_fields;
+ TQStringList m_fields;
- QString m_popularTitles;
- QString m_exactTitles;
- QString m_partialTitles;
+ TQString m_popularTitles;
+ TQString m_exactTitles;
+ TQString m_partialTitles;
enum TitleBlock { Unknown = 0, Popular = 1, Exact = 2, Partial = 3, SinglePerson = 4};
TitleBlock m_currentTitleBlock;
int m_countOffset;
diff --git a/src/fetch/isbndbfetcher.cpp b/src/fetch/isbndbfetcher.cpp
index 5ffc379..92fb084 100644
--- a/src/fetch/isbndbfetcher.cpp
+++ b/src/fetch/isbndbfetcher.cpp
@@ -25,10 +25,10 @@
#include <kstandarddirs.h>
#include <kconfig.h>
-#include <qdom.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qfile.h>
+#include <tqdom.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqfile.h>
namespace {
static const int ISBNDB_RETURNS_PER_REQUEST = 10;
@@ -39,8 +39,8 @@ namespace {
using Tellico::Fetch::ISBNdbFetcher;
-ISBNdbFetcher::ISBNdbFetcher(QObject* parent_, const char* name_)
- : Fetcher(parent_, name_), m_xsltHandler(0),
+ISBNdbFetcher::ISBNdbFetcher(TQObject* tqparent_, const char* name_)
+ : Fetcher(tqparent_, name_), m_xsltHandler(0),
m_limit(ISBNDB_MAX_RETURNS_TOTAL), m_page(1), m_total(-1), m_countOffset(0),
m_job(0), m_started(false) {
}
@@ -50,11 +50,11 @@ ISBNdbFetcher::~ISBNdbFetcher() {
m_xsltHandler = 0;
}
-QString ISBNdbFetcher::defaultName() {
+TQString ISBNdbFetcher::defaultName() {
return i18n("ISBNdb.com");
}
-QString ISBNdbFetcher::source() const {
+TQString ISBNdbFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -66,7 +66,7 @@ void ISBNdbFetcher::readConfigHook(const KConfigGroup& config_) {
Q_UNUSED(config_);
}
-void ISBNdbFetcher::search(FetchKey key_, const QString& value_) {
+void ISBNdbFetcher::search(FetchKey key_, const TQString& value_) {
m_key = key_;
m_value = value_.stripWhiteSpace();
m_started = true;
@@ -76,7 +76,7 @@ void ISBNdbFetcher::search(FetchKey key_, const QString& value_) {
m_countOffset = 0;
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
@@ -94,35 +94,35 @@ void ISBNdbFetcher::doSearch() {
// myDebug() << "ISBNdbFetcher::search() - value = " << value_ << endl;
- KURL u(QString::fromLatin1(ISBNDB_BASE_URL));
- u.addQueryItem(QString::fromLatin1("access_key"), QString::fromLatin1(ISBNDB_APP_ID));
- u.addQueryItem(QString::fromLatin1("results"), QString::fromLatin1("details,authors,subjects,texts"));
- u.addQueryItem(QString::fromLatin1("page_number"), QString::number(m_page));
+ KURL u(TQString::tqfromLatin1(ISBNDB_BASE_URL));
+ u.addQueryItem(TQString::tqfromLatin1("access_key"), TQString::tqfromLatin1(ISBNDB_APP_ID));
+ u.addQueryItem(TQString::tqfromLatin1("results"), TQString::tqfromLatin1("details,authors,subjects,texts"));
+ u.addQueryItem(TQString::tqfromLatin1("page_number"), TQString::number(m_page));
switch(m_key) {
case Title:
- u.addQueryItem(QString::fromLatin1("index1"), QString::fromLatin1("title"));
- u.addQueryItem(QString::fromLatin1("value1"), m_value);
+ u.addQueryItem(TQString::tqfromLatin1("index1"), TQString::tqfromLatin1("title"));
+ u.addQueryItem(TQString::tqfromLatin1("value1"), m_value);
break;
case Person:
// yes, this also queries titles, too, it's a limitation of the isbndb api service
- u.addQueryItem(QString::fromLatin1("index1"), QString::fromLatin1("combined"));
- u.addQueryItem(QString::fromLatin1("value1"), m_value);
+ u.addQueryItem(TQString::tqfromLatin1("index1"), TQString::tqfromLatin1("combined"));
+ u.addQueryItem(TQString::tqfromLatin1("value1"), m_value);
break;
case Keyword:
- u.addQueryItem(QString::fromLatin1("index1"), QString::fromLatin1("full"));
- u.addQueryItem(QString::fromLatin1("value1"), m_value);
+ u.addQueryItem(TQString::tqfromLatin1("index1"), TQString::tqfromLatin1("full"));
+ u.addQueryItem(TQString::tqfromLatin1("value1"), m_value);
break;
case ISBN:
- u.addQueryItem(QString::fromLatin1("index1"), QString::fromLatin1("isbn"));
+ u.addQueryItem(TQString::tqfromLatin1("index1"), TQString::tqfromLatin1("isbn"));
{
// only grab first value
- QString v = m_value.section(QChar(';'), 0);
+ TQString v = m_value.section(TQChar(';'), 0);
v.remove('-');
- u.addQueryItem(QString::fromLatin1("value1"), v);
+ u.addQueryItem(TQString::tqfromLatin1("value1"), v);
}
break;
@@ -134,10 +134,10 @@ void ISBNdbFetcher::doSearch() {
// myDebug() << "ISBNdbFetcher::search() - url: " << u.url() << endl;
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void ISBNdbFetcher::stop() {
@@ -154,8 +154,8 @@ void ISBNdbFetcher::stop() {
emit signalDone(this);
}
-void ISBNdbFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void ISBNdbFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -178,26 +178,26 @@ void ISBNdbFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from isbndbfetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
- t << QCString(m_data, m_data.size()+1);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
+ t << TQCString(m_data, m_data.size()+1);
}
f.close();
#endif
- QDomDocument dom;
+ TQDomDocument dom;
if(!dom.setContent(m_data, false)) {
kdWarning() << "ISBNdbFetcher::slotComplete() - server did not return valid XML." << endl;
return;
}
if(m_total == -1) {
- QDomNode n = dom.documentElement().namedItem(QString::fromLatin1("BookList"));
- QDomElement e = n.toElement();
+ TQDomNode n = dom.documentElement().namedItem(TQString::tqfromLatin1("BookList"));
+ TQDomElement e = n.toElement();
if(!e.isNull()) {
- m_total = e.attribute(QString::fromLatin1("total_results"), QString::number(-1)).toInt();
+ m_total = e.attribute(TQString::tqfromLatin1("total_results"), TQString::number(-1)).toInt();
}
}
@@ -210,7 +210,7 @@ void ISBNdbFetcher::slotComplete(KIO::Job* job_) {
}
// assume result is always utf-8
- QString str = m_xsltHandler->applyStylesheet(QString::fromUtf8(m_data, m_data.size()));
+ TQString str = m_xsltHandler->applyStylesheet(TQString::fromUtf8(m_data, m_data.size()));
Import::TellicoImporter imp(str);
Data::CollPtr coll = imp.collection();
@@ -224,15 +224,15 @@ void ISBNdbFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- QString desc = entry->field(QString::fromLatin1("author"))
- + QChar('/') + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("cr_year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("cr_year"));
- } else if(!entry->field(QString::fromLatin1("pub_year")).isEmpty()){
- desc += QChar('/') + entry->field(QString::fromLatin1("pub_year"));
+ TQString desc = entry->field(TQString::tqfromLatin1("author"))
+ + TQChar('/') + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("cr_year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("cr_year"));
+ } else if(!entry->field(TQString::tqfromLatin1("pub_year")).isEmpty()){
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("pub_year"));
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
++m_numResults;
@@ -241,10 +241,10 @@ void ISBNdbFetcher::slotComplete(KIO::Job* job_) {
// are there any additional results to get?
m_hasMoreResults = m_page * ISBNDB_RETURNS_PER_REQUEST < m_total;
- const int currentTotal = QMIN(m_total, m_limit);
+ const int currentTotal = TQMIN(m_total, m_limit);
if(m_page * ISBNDB_RETURNS_PER_REQUEST < currentTotal) {
int foundCount = (m_page-1) * ISBNDB_RETURNS_PER_REQUEST + coll->entryCount();
- message(i18n("Results from %1: %2/%3").arg(source()).arg(foundCount).arg(m_total), MessageHandler::Status);
+ message(i18n("Results from %1: %2/%3").tqarg(source()).tqarg(foundCount).tqarg(m_total), MessageHandler::tqStatus);
++m_page;
m_countOffset = 0;
doSearch();
@@ -265,32 +265,32 @@ Tellico::Data::EntryPtr ISBNdbFetcher::fetchEntry(uint uid_) {
}
// if the publisher id is set, then we need to grab the real publisher name
- const QString id = entry->field(QString::fromLatin1("pub_id"));
+ const TQString id = entry->field(TQString::tqfromLatin1("pub_id"));
if(!id.isEmpty()) {
- KURL u(QString::fromLatin1(ISBNDB_BASE_URL));
- u.setFileName(QString::fromLatin1("publishers.xml"));
- u.addQueryItem(QString::fromLatin1("access_key"), QString::fromLatin1(ISBNDB_APP_ID));
- u.addQueryItem(QString::fromLatin1("index1"), QString::fromLatin1("publisher_id"));
- u.addQueryItem(QString::fromLatin1("value1"), id);
+ KURL u(TQString::tqfromLatin1(ISBNDB_BASE_URL));
+ u.setFileName(TQString::tqfromLatin1("publishers.xml"));
+ u.addQueryItem(TQString::tqfromLatin1("access_key"), TQString::tqfromLatin1(ISBNDB_APP_ID));
+ u.addQueryItem(TQString::tqfromLatin1("index1"), TQString::tqfromLatin1("publisher_id"));
+ u.addQueryItem(TQString::tqfromLatin1("value1"), id);
- QDomDocument dom = FileHandler::readXMLFile(u, true);
+ TQDomDocument dom = FileHandler::readXMLFile(u, true);
if(!dom.isNull()) {
- QString pub = dom.documentElement().namedItem(QString::fromLatin1("PublisherList"))
- .namedItem(QString::fromLatin1("PublisherData"))
- .namedItem(QString::fromLatin1("Name"))
+ TQString pub = dom.documentElement().namedItem(TQString::tqfromLatin1("PublisherList"))
+ .namedItem(TQString::tqfromLatin1("PublisherData"))
+ .namedItem(TQString::tqfromLatin1("Name"))
.toElement().text();
if(!pub.isEmpty()) {
- entry->setField(QString::fromLatin1("publisher"), pub);
+ entry->setField(TQString::tqfromLatin1("publisher"), pub);
}
}
- entry->setField(QString::fromLatin1("pub_id"), QString());
+ entry->setField(TQString::tqfromLatin1("pub_id"), TQString());
}
return entry;
}
void ISBNdbFetcher::initXSLTHandler() {
- QString xsltfile = locate("appdata", QString::fromLatin1("isbndb2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("isbndb2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "ISBNdbFetcher::initXSLTHandler() - can not locate isbndb2tellico.xsl." << endl;
return;
@@ -314,14 +314,14 @@ void ISBNdbFetcher::updateEntry(Data::EntryPtr entry_) {
// limit to top 5 results
m_limit = 5;
- QString isbn = entry_->field(QString::fromLatin1("isbn"));
+ TQString isbn = entry_->field(TQString::tqfromLatin1("isbn"));
if(!isbn.isEmpty()) {
search(Fetch::ISBN, isbn);
return;
}
// optimistically try searching for title and rely on Collection::sameEntry() to figure things out
- QString t = entry_->field(QString::fromLatin1("title"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
if(!t.isEmpty()) {
m_limit = 10; // raise limit so more possibility of match
search(Fetch::Title, t);
@@ -332,18 +332,18 @@ void ISBNdbFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* ISBNdbFetcher::configWidget(QWidget* parent_) const {
- return new ISBNdbFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* ISBNdbFetcher::configWidget(TQWidget* tqparent_) const {
+ return new ISBNdbFetcher::ConfigWidget(tqparent_, this);
}
-ISBNdbFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const ISBNdbFetcher*/*=0*/)
- : Fetch::ConfigWidget(parent_) {
- QVBoxLayout* l = new QVBoxLayout(optionsWidget());
- l->addWidget(new QLabel(i18n("This source has no options."), optionsWidget()));
+ISBNdbFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const ISBNdbFetcher*/*=0*/)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQVBoxLayout* l = new TQVBoxLayout(optionsWidget());
+ l->addWidget(new TQLabel(i18n("This source has no options."), optionsWidget()));
l->addStretch();
}
-QString ISBNdbFetcher::ConfigWidget::preferredName() const {
+TQString ISBNdbFetcher::ConfigWidget::preferredName() const {
return ISBNdbFetcher::defaultName();
}
diff --git a/src/fetch/isbndbfetcher.h b/src/fetch/isbndbfetcher.h
index e49246a..f5983b2 100644
--- a/src/fetch/isbndbfetcher.h
+++ b/src/fetch/isbndbfetcher.h
@@ -24,8 +24,8 @@ namespace Tellico {
#include <kio/job.h>
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
namespace Tellico {
namespace Fetch {
@@ -35,14 +35,15 @@ namespace Tellico {
*/
class ISBNdbFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- ISBNdbFetcher(QObject* parent = 0, const char* name = 0);
+ ISBNdbFetcher(TQObject* tqparent = 0, const char* name = 0);
~ISBNdbFetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void continueSearch();
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person || k == Keyword || k == ISBN; }
virtual void stop();
@@ -53,20 +54,20 @@ public:
virtual void updateEntry(Data::EntryPtr entry);
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_, const ISBNdbFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent_, const ISBNdbFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup&) {}
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
@@ -80,12 +81,12 @@ private:
int m_numResults;
int m_countOffset;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries;
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQGuardedPtr<KIO::Job> m_job;
FetchKey m_key;
- QString m_value;
+ TQString m_value;
bool m_started;
};
diff --git a/src/fetch/messagehandler.cpp b/src/fetch/messagehandler.cpp
index f3c36a1..5510480 100644
--- a/src/fetch/messagehandler.cpp
+++ b/src/fetch/messagehandler.cpp
@@ -20,8 +20,8 @@
using Tellico::Fetch::ManagerMessage;
// all messages go to manager
-void ManagerMessage::send(const QString& message_, Type type_) {
- Fetch::Manager::self()->updateStatus(message_);
+void ManagerMessage::send(const TQString& message_, Type type_) {
+ Fetch::Manager::self()->updatetqStatus(message_);
// plus errors get a message box
if(type_ == Error) {
KMessageBox::sorry(Kernel::self()->widget(), message_);
@@ -30,6 +30,6 @@ void ManagerMessage::send(const QString& message_, Type type_) {
}
}
-void ManagerMessage::infoList(const QString& message_, const QStringList& list_) {
+void ManagerMessage::infoList(const TQString& message_, const TQStringList& list_) {
KMessageBox::informationList(Kernel::self()->widget(), message_, list_);
}
diff --git a/src/fetch/messagehandler.h b/src/fetch/messagehandler.h
index 0ec9269..804d574 100644
--- a/src/fetch/messagehandler.h
+++ b/src/fetch/messagehandler.h
@@ -14,8 +14,8 @@
#ifndef TELLICO_FETCH_MESSAGEHANDLER_H
#define TELLICO_FETCH_MESSAGEHANDLER_H
-class QString;
-class QStringList;
+class TQString;
+class TQStringList;
namespace Tellico {
namespace Fetch {
@@ -25,13 +25,13 @@ namespace Tellico {
*/
class MessageHandler {
public:
- enum Type { Status, Warning, Error, ListError };
+ enum Type { tqStatus, Warning, Error, ListError };
MessageHandler() {}
virtual ~MessageHandler() {}
- virtual void send(const QString& message, Type type) = 0;
- virtual void infoList(const QString& message, const QStringList& list) = 0;
+ virtual void send(const TQString& message, Type type) = 0;
+ virtual void infoList(const TQString& message, const TQStringList& list) = 0;
};
class ManagerMessage : public MessageHandler {
@@ -39,8 +39,8 @@ public:
ManagerMessage() : MessageHandler() {}
virtual ~ManagerMessage() {}
- virtual void send(const QString& message, Type type);
- virtual void infoList(const QString& message, const QStringList& list);
+ virtual void send(const TQString& message, Type type);
+ virtual void infoList(const TQString& message, const TQStringList& list);
};
} // end namespace
diff --git a/src/fetch/scripts/dark_horse_comics.py b/src/fetch/scripts/dark_horse_comics.py
index 4f3b651..0db83ec 100644
--- a/src/fetch/scripts/dark_horse_comics.py
+++ b/src/fetch/scripts/dark_horse_comics.py
@@ -86,7 +86,7 @@ class BasicTellicoDOM:
entryNode.setAttribute('id', str(self.__currentId))
titleNode = self.__doc.createElement('title')
- titleNode.appendChild(self.__doc.createTextNode(unicode(d['title'], 'latin-1').encode('utf-8')))
+ titleNode.appendChild(self.__doc.createTextNode(tqunicode(d['title'], 'latin-1').encode('utf-8')))
yearNode = self.__doc.createElement('pub_year')
yearNode.appendChild(self.__doc.createTextNode(d['pub_year']))
@@ -101,25 +101,25 @@ class BasicTellicoDOM:
writersNode = self.__doc.createElement('writers')
for g in d['writer']:
writerNode = self.__doc.createElement('writer')
- writerNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8')))
+ writerNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8')))
writersNode.appendChild(writerNode)
genresNode = self.__doc.createElement('genres')
for g in d['genre']:
genreNode = self.__doc.createElement('genre')
- genreNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8')))
+ genreNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8')))
genresNode.appendChild(genreNode)
commentsNode = self.__doc.createElement('comments')
#for g in d['comments']:
- # commentsNode.appendChild(self.__doc.createTextNode(unicode("%s\n\n" % g, 'latin-1').encode('utf-8')))
+ # commentsNode.appendChild(self.__doc.createTextNode(tqunicode("%s\n\n" % g, 'latin-1').encode('utf-8')))
commentsData = string.join(d['comments'], '\n\n')
- commentsNode.appendChild(self.__doc.createTextNode(unicode(commentsData, 'latin-1').encode('utf-8')))
+ commentsNode.appendChild(self.__doc.createTextNode(tqunicode(commentsData, 'latin-1').encode('utf-8')))
artistsNode = self.__doc.createElement('artists')
for k, v in d['artist'].iteritems():
artistNode = self.__doc.createElement('artist')
- artistNode.appendChild(self.__doc.createTextNode(unicode(v, 'latin-1').encode('utf-8')))
+ artistNode.appendChild(self.__doc.createTextNode(tqunicode(v, 'latin-1').encode('utf-8')))
artistsNode.appendChild(artistNode)
pagesNode = self.__doc.createElement('pages')
@@ -132,7 +132,7 @@ class BasicTellicoDOM:
imageNode = self.__doc.createElement('image')
imageNode.setAttribute('format', 'JPEG')
imageNode.setAttribute('id', d['image'][0])
- imageNode.appendChild(self.__doc.createTextNode(unicode(d['image'][1], 'latin-1').encode('utf-8')))
+ imageNode.appendChild(self.__doc.createTextNode(tqunicode(d['image'][1], 'latin-1').encode('utf-8')))
coverNode = self.__doc.createElement('cover')
coverNode.appendChild(self.__doc.createTextNode(d['image'][0]))
@@ -220,7 +220,7 @@ class DarkHorseParser:
Retrieve all links related to the search. self.__data contains HTML content fetched by self.__getHTMLContent()
that need to be parsed.
"""
- matchList = re.findall("""<a *href="%s(?P<page>.*?)">(?P<title>.*?)</a>""" % self.__basePath.replace('?', '\?'), self.__data)
+ matchList = re.findall("""<a *href="%s(?P<page>.*?)">(?P<title>.*?)</a>""" % self.__basePath.tqreplace('?', '\?'), self.__data)
if not matchList: return None
return matchList
diff --git a/src/fetch/scripts/fr.allocine.py b/src/fetch/scripts/fr.allocine.py
index 97a2247..6412ecf 100755
--- a/src/fetch/scripts/fr.allocine.py
+++ b/src/fetch/scripts/fr.allocine.py
@@ -90,23 +90,23 @@ class BasicTellicoDOM:
entryNode.setAttribute('id', str(self.__currentId))
titleNode = self.__doc.createElement('title')
- titleNode.appendChild(self.__doc.createTextNode(unicode(d['title'], 'latin-1').encode('utf-8')))
+ titleNode.appendChild(self.__doc.createTextNode(tqunicode(d['title'], 'latin-1').encode('utf-8')))
otitleNode = self.__doc.createElement('titre-original')
- otitleNode.appendChild(self.__doc.createTextNode(unicode(d['otitle'], 'latin-1').encode('utf-8')))
+ otitleNode.appendChild(self.__doc.createTextNode(tqunicode(d['otitle'], 'latin-1').encode('utf-8')))
yearNode = self.__doc.createElement('year')
- yearNode.appendChild(self.__doc.createTextNode(unicode(d['year'], 'latin-1').encode('utf-8')))
+ yearNode.appendChild(self.__doc.createTextNode(tqunicode(d['year'], 'latin-1').encode('utf-8')))
genresNode = self.__doc.createElement('genres')
for g in d['genres']:
genreNode = self.__doc.createElement('genre')
- genreNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8')))
+ genreNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8')))
genresNode.appendChild(genreNode)
natsNode = self.__doc.createElement('nationalitys')
natNode = self.__doc.createElement('nat')
- natNode.appendChild(self.__doc.createTextNode(unicode(d['nat'], 'latin-1').encode('utf-8')))
+ natNode.appendChild(self.__doc.createTextNode(tqunicode(d['nat'], 'latin-1').encode('utf-8')))
natsNode.appendChild(natNode)
castsNode = self.__doc.createElement('casts')
@@ -114,7 +114,7 @@ class BasicTellicoDOM:
castNode = self.__doc.createElement('cast')
col1Node = self.__doc.createElement('column')
col2Node = self.__doc.createElement('column')
- col1Node.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8')))
+ col1Node.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8')))
castNode.appendChild(col1Node)
castNode.appendChild(col2Node)
castsNode.appendChild(castNode)
@@ -122,17 +122,17 @@ class BasicTellicoDOM:
dirsNode = self.__doc.createElement('directors')
for g in d['dirs']:
dirNode = self.__doc.createElement('director')
- dirNode.appendChild(self.__doc.createTextNode(unicode(g, 'latin-1').encode('utf-8')))
+ dirNode.appendChild(self.__doc.createTextNode(tqunicode(g, 'latin-1').encode('utf-8')))
dirsNode.appendChild(dirNode)
timeNode = self.__doc.createElement('running-time')
- timeNode.appendChild(self.__doc.createTextNode(unicode(d['time'], 'latin-1').encode('utf-8')))
+ timeNode.appendChild(self.__doc.createTextNode(tqunicode(d['time'], 'latin-1').encode('utf-8')))
- allocineNode = self.__doc.createElement(unicode('allocin�-link', 'latin-1').encode('utf-8'))
- allocineNode.appendChild(self.__doc.createTextNode(unicode(d['allocine'], 'latin-1').encode('utf-8')))
+ allocineNode = self.__doc.createElement(tqunicode('allocin�-link', 'latin-1').encode('utf-8'))
+ allocineNode.appendChild(self.__doc.createTextNode(tqunicode(d['allocine'], 'latin-1').encode('utf-8')))
plotNode = self.__doc.createElement('plot')
- plotNode.appendChild(self.__doc.createTextNode(unicode(d['plot'], 'latin-1').encode('utf-8')))
+ plotNode.appendChild(self.__doc.createTextNode(tqunicode(d['plot'], 'latin-1').encode('utf-8')))
if d['image']:
imageNode = self.__doc.createElement('image')
@@ -140,7 +140,7 @@ class BasicTellicoDOM:
imageNode.setAttribute('id', d['image'][0])
imageNode.setAttribute('width', '120')
imageNode.setAttribute('height', '160')
- imageNode.appendChild(self.__doc.createTextNode(unicode(d['image'][1], 'latin-1').encode('utf-8')))
+ imageNode.appendChild(self.__doc.createTextNode(tqunicode(d['image'][1], 'latin-1').encode('utf-8')))
coverNode = self.__doc.createElement('cover')
coverNode.appendChild(self.__doc.createTextNode(d['image'][0]))
diff --git a/src/fetch/scripts/ministerio_de_cultura.py b/src/fetch/scripts/ministerio_de_cultura.py
index 8a768f9..cdbb580 100644
--- a/src/fetch/scripts/ministerio_de_cultura.py
+++ b/src/fetch/scripts/ministerio_de_cultura.py
@@ -53,7 +53,7 @@ SVN Version:
* Removed "Collection" field as I moved to Series/Series Number
Version 0.3.2:
- * Now find 'notas' field related information
+ * Now tqfind 'notas' field related information
* search URL modified to fetch information of exhausted books too
Version 0.3.1:
@@ -155,9 +155,9 @@ class BasicTellicoDOM:
# Convert all strings to UTF-8
for i in d.keys():
if type(d[i]) == types.ListType:
- d[i] = [unicode(d[i][j], 'latin-1').encode('utf-8') for j in range(len(d[i]))]
+ d[i] = [tqunicode(d[i][j], 'latin-1').encode('utf-8') for j in range(len(d[i]))]
elif type(d[i]) == types.StringType:
- d[i] = unicode(d[i], 'latin-1').encode('utf-8')
+ d[i] = tqunicode(d[i], 'latin-1').encode('utf-8')
entryNode = self.__doc.createElement('entry')
entryNode.setAttribute('id', str(self.__currentId))
@@ -281,7 +281,7 @@ class MinisterioCulturaParser:
# Strip out hyphens if kind is ISBN
if kind == ISBN:
- criteria = criteria.replace('-', NULLSTRING)
+ criteria = criteria.tqreplace('-', NULLSTRING)
# Support for multiple search
isbnList = criteria.split(';')
for n in isbnList:
@@ -502,7 +502,7 @@ Tellico cannot connect to: http://www.mcu.es/comun/bases/isbn/ISBN.htm webpage:
# Now retrieve infos
if links:
for entry in links:
- data = self.__fetchBookInfo( url = self.__baseURL + entry.replace(' ', '%20') )
+ data = self.__fetchBookInfo( url = self.__baseURL + entry.tqreplace(' ', '%20') )
node = self.__domTree.addEntry(data)
else:
return None
diff --git a/src/fetch/srufetcher.cpp b/src/fetch/srufetcher.cpp
index 1d7289b..96ca7d4 100644
--- a/src/fetch/srufetcher.cpp
+++ b/src/fetch/srufetcher.cpp
@@ -35,9 +35,9 @@
#include <kaccelmanager.h>
#include <knuminput.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
//#define SRU_DEBUG
@@ -51,12 +51,12 @@ namespace {
using Tellico::Fetch::SRUFetcher;
using Tellico::Fetch::SRUConfigWidget;
-SRUFetcher::SRUFetcher(QObject* parent_, const char* name_)
- : Fetcher(parent_, name_), m_job(0), m_MARCXMLHandler(0), m_MODSHandler(0), m_started(false) {
+SRUFetcher::SRUFetcher(TQObject* tqparent_, const char* name_)
+ : Fetcher(tqparent_, name_), m_job(0), m_MARCXMLHandler(0), m_MODSHandler(0), m_started(false) {
}
-SRUFetcher::SRUFetcher(const QString& name_, const QString& host_, uint port_, const QString& path_,
- QObject* parent_) : Fetcher(parent_),
+SRUFetcher::SRUFetcher(const TQString& name_, const TQString& host_, uint port_, const TQString& path_,
+ TQObject* tqparent_) : Fetcher(tqparent_),
m_host(host_), m_port(port_), m_path(path_),
m_job(0), m_MARCXMLHandler(0), m_MODSHandler(0), m_started(false) {
m_name = name_; // m_name is protected in super class
@@ -69,11 +69,11 @@ SRUFetcher::~SRUFetcher() {
m_MODSHandler = 0;
}
-QString SRUFetcher::defaultName() {
+TQString SRUFetcher::defaultName() {
return i18n("SRU Server");
}
-QString SRUFetcher::source() const {
+TQString SRUFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -92,14 +92,14 @@ void SRUFetcher::readConfigHook(const KConfigGroup& config_) {
if(m_path.isEmpty()) {
m_path = config_.readEntry("Database");
}
- if(!m_path.startsWith(QChar('/'))) {
+ if(!m_path.startsWith(TQChar('/'))) {
m_path.prepend('/');
}
- m_format = config_.readEntry("Format", QString::fromLatin1("mods"));
+ m_format = config_.readEntry("Format", TQString::tqfromLatin1("mods"));
m_fields = config_.readListEntry("Custom Fields");
}
-void SRUFetcher::search(FetchKey key_, const QString& value_) {
+void SRUFetcher::search(FetchKey key_, const TQString& value_) {
if(m_host.isEmpty() || m_path.isEmpty()) {
myDebug() << "SRUFetcher::search() - settings are not set!" << endl;
stop();
@@ -109,35 +109,35 @@ void SRUFetcher::search(FetchKey key_, const QString& value_) {
m_started = true;
#ifdef SRU_DEBUG
- KURL u = KURL::fromPathOrURL(QString::fromLatin1("/home/robby/sru.xml"));
+ KURL u = KURL::fromPathOrURL(TQString::tqfromLatin1("/home/robby/sru.xml"));
#else
KURL u;
- u.setProtocol(QString::fromLatin1("http"));
+ u.setProtocol(TQString::tqfromLatin1("http"));
u.setHost(m_host);
u.setPort(m_port);
u.setPath(m_path);
- u.addQueryItem(QString::fromLatin1("operation"), QString::fromLatin1("searchRetrieve"));
- u.addQueryItem(QString::fromLatin1("version"), QString::fromLatin1("1.1"));
- u.addQueryItem(QString::fromLatin1("maximumRecords"), QString::number(SRU_MAX_RECORDS));
- u.addQueryItem(QString::fromLatin1("recordSchema"), m_format);
+ u.addQueryItem(TQString::tqfromLatin1("operation"), TQString::tqfromLatin1("searchRetrieve"));
+ u.addQueryItem(TQString::tqfromLatin1("version"), TQString::tqfromLatin1("1.1"));
+ u.addQueryItem(TQString::tqfromLatin1("maximumRecords"), TQString::number(SRU_MAX_RECORDS));
+ u.addQueryItem(TQString::tqfromLatin1("recordSchema"), m_format);
const int type = Kernel::self()->collectionType();
- QString str = QChar('"') + value_ + QChar('"');
+ TQString str = TQChar('"') + value_ + TQChar('"');
switch(key_) {
case Title:
- u.addQueryItem(QString::fromLatin1("query"), QString::fromLatin1("dc.title=") + str);
+ u.addQueryItem(TQString::tqfromLatin1("query"), TQString::tqfromLatin1("dc.title=") + str);
break;
case Person:
{
- QString s;
+ TQString s;
if(type == Data::Collection::Book || type == Data::Collection::Bibtex) {
- s = QString::fromLatin1("author=") + str + QString::fromLatin1(" or dc.author=") + str;
+ s = TQString::tqfromLatin1("author=") + str + TQString::tqfromLatin1(" or dc.author=") + str;
} else {
- s = QString::fromLatin1("dc.creator=") + str + QString::fromLatin1(" or dc.editor=") + str;
+ s = TQString::tqfromLatin1("dc.creator=") + str + TQString::tqfromLatin1(" or dc.editor=") + str;
}
- u.addQueryItem(QString::fromLatin1("query"), s);
+ u.addQueryItem(TQString::tqfromLatin1("query"), s);
}
break;
@@ -146,7 +146,7 @@ void SRUFetcher::search(FetchKey key_, const QString& value_) {
str.remove('-');
// limit to first isbn
str = str.section(';', 0, 0);
- u.addQueryItem(QString::fromLatin1("query"), QString::fromLatin1("bath.isbn=") + str);
+ u.addQueryItem(TQString::tqfromLatin1("query"), TQString::tqfromLatin1("bath.isbn=") + str);
break;
case LCCN:
@@ -155,22 +155,22 @@ void SRUFetcher::search(FetchKey key_, const QString& value_) {
str.remove('-');
str = str.section(';', 0, 0);
// also try formalized lccn
- QString lccn = LCCNValidator::formalize(str);
- u.addQueryItem(QString::fromLatin1("query"),
- QString::fromLatin1("bath.lccn=") + str +
- QString::fromLatin1(" or bath.lccn=") + lccn
+ TQString lccn = LCCNValidator::formalize(str);
+ u.addQueryItem(TQString::tqfromLatin1("query"),
+ TQString::tqfromLatin1("bath.lccn=") + str +
+ TQString::tqfromLatin1(" or bath.lccn=") + lccn
);
}
break;
case Keyword:
- u.addQueryItem(QString::fromLatin1("query"), str);
+ u.addQueryItem(TQString::tqfromLatin1("query"), str);
break;
case Raw:
{
- QString key = value_.section('=', 0, 0).stripWhiteSpace();
- QString str = value_.section('=', 1).stripWhiteSpace();
+ TQString key = value_.section('=', 0, 0).stripWhiteSpace();
+ TQString str = value_.section('=', 1).stripWhiteSpace();
u.addQueryItem(key, str);
}
break;
@@ -184,10 +184,10 @@ void SRUFetcher::search(FetchKey key_, const QString& value_) {
// myDebug() << u.prettyURL() << endl;
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void SRUFetcher::stop() {
@@ -203,8 +203,8 @@ void SRUFetcher::stop() {
emit signalDone(this);
}
-void SRUFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void SRUFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -224,24 +224,24 @@ void SRUFetcher::slotComplete(KIO::Job* job_) {
}
Data::CollPtr coll;
- QString msg;
+ TQString msg;
- const QString result = QString::fromUtf8(m_data, m_data.size());
+ const TQString result = TQString::fromUtf8(m_data, m_data.size());
// first check for SRU errors
- const QString& diag = XML::nsZingDiag;
+ const TQString& diag = XML::nsZingDiag;
Import::XMLImporter xmlImporter(result);
- QDomDocument dom = xmlImporter.domDocument();
+ TQDomDocument dom = xmlImporter.domDocument();
- QDomNodeList diagList = dom.elementsByTagNameNS(diag, QString::fromLatin1("diagnostic"));
+ TQDomNodeList diagList = dom.elementsByTagNameNS(diag, TQString::tqfromLatin1("diagnostic"));
for(uint i = 0; i < diagList.count(); ++i) {
- QDomElement elem = diagList.item(i).toElement();
- QDomNodeList nodeList1 = elem.elementsByTagNameNS(diag, QString::fromLatin1("message"));
- QDomNodeList nodeList2 = elem.elementsByTagNameNS(diag, QString::fromLatin1("details"));
+ TQDomElement elem = diagList.item(i).toElement();
+ TQDomNodeList nodeList1 = elem.elementsByTagNameNS(diag, TQString::tqfromLatin1("message"));
+ TQDomNodeList nodeList2 = elem.elementsByTagNameNS(diag, TQString::tqfromLatin1("details"));
for(uint j = 0; j < nodeList1.count(); ++j) {
- QString d = nodeList1.item(j).toElement().text();
+ TQString d = nodeList1.item(j).toElement().text();
if(!d.isEmpty()) {
- QString d2 = nodeList2.item(j).toElement().text();
+ TQString d2 = nodeList2.item(j).toElement().text();
if(!d2.isEmpty()) {
d += " (" + d2 + ')';
}
@@ -252,7 +252,7 @@ void SRUFetcher::slotComplete(KIO::Job* job_) {
}
}
- QString modsResult;
+ TQString modsResult;
if(m_format == Latin1Literal("mods")) {
modsResult = result;
} else if(m_format == Latin1Literal("marcxml") && initMARCXMLHandler()) {
@@ -275,7 +275,7 @@ void SRUFetcher::slotComplete(KIO::Job* job_) {
}
if(coll && !msg.isEmpty()) {
- message(msg, coll->entryCount() == 0 ? MessageHandler::Warning : MessageHandler::Status);
+ message(msg, coll->entryCount() == 0 ? MessageHandler::Warning : MessageHandler::tqStatus);
}
if(!coll) {
@@ -289,46 +289,46 @@ void SRUFetcher::slotComplete(KIO::Job* job_) {
const StringMap customFields = SRUFetcher::customFields();
for(StringMap::ConstIterator it = customFields.begin(); it != customFields.end(); ++it) {
- if(!m_fields.contains(it.key())) {
+ if(!m_fields.tqcontains(it.key())) {
coll->removeField(it.key());
}
}
Data::EntryVec entries = coll->entries();
for(Data::EntryVec::Iterator entry = entries.begin(); entry != entries.end(); ++entry) {
- QString desc;
+ TQString desc;
switch(coll->type()) {
case Data::Collection::Book:
- desc = entry->field(QString::fromLatin1("author"))
- + QChar('/')
- + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("cr_year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("cr_year"));
- } else if(!entry->field(QString::fromLatin1("pub_year")).isEmpty()){
- desc += QChar('/') + entry->field(QString::fromLatin1("pub_year"));
+ desc = entry->field(TQString::tqfromLatin1("author"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("cr_year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("cr_year"));
+ } else if(!entry->field(TQString::tqfromLatin1("pub_year")).isEmpty()){
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("pub_year"));
}
break;
case Data::Collection::Video:
- desc = entry->field(QString::fromLatin1("studio"))
- + QChar('/')
- + entry->field(QString::fromLatin1("director"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"));
+ desc = entry->field(TQString::tqfromLatin1("studio"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("director"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"));
break;
case Data::Collection::Album:
- desc = entry->field(QString::fromLatin1("artist"))
- + QChar('/')
- + entry->field(QString::fromLatin1("label"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"));
+ desc = entry->field(TQString::tqfromLatin1("artist"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("label"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"));
break;
default:
break;
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, entry);
emit signalResultFound(r);
}
@@ -341,20 +341,20 @@ Tellico::Data::EntryPtr SRUFetcher::fetchEntry(uint uid_) {
void SRUFetcher::updateEntry(Data::EntryPtr entry_) {
// myDebug() << "SRUFetcher::updateEntry() - " << source() << ": " << entry_->title() << endl;
- QString isbn = entry_->field(QString::fromLatin1("isbn"));
+ TQString isbn = entry_->field(TQString::tqfromLatin1("isbn"));
if(!isbn.isEmpty()) {
search(Fetch::ISBN, isbn);
return;
}
- QString lccn = entry_->field(QString::fromLatin1("lccn"));
+ TQString lccn = entry_->field(TQString::tqfromLatin1("lccn"));
if(!lccn.isEmpty()) {
search(Fetch::LCCN, lccn);
return;
}
// optimistically try searching for title and rely on Collection::sameEntry() to figure things out
- QString t = entry_->field(QString::fromLatin1("title"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
if(!t.isEmpty()) {
search(Fetch::Title, t);
return;
@@ -369,7 +369,7 @@ bool SRUFetcher::initMARCXMLHandler() {
return true;
}
- QString xsltfile = locate("appdata", QString::fromLatin1("MARC21slim2MODS3.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("MARC21slim2MODS3.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "SRUFetcher::initHandlers() - can not locate MARC21slim2MODS3.xsl." << endl;
return false;
@@ -393,7 +393,7 @@ bool SRUFetcher::initMODSHandler() {
return true;
}
- QString xsltfile = locate("appdata", QString::fromLatin1("mods2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("mods2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "SRUFetcher::initHandlers() - can not locate mods2tellico.xsl." << endl;
return false;
@@ -412,79 +412,79 @@ bool SRUFetcher::initMODSHandler() {
return true;
}
-Tellico::Fetch::Fetcher::Ptr SRUFetcher::libraryOfCongress(QObject* parent_) {
- return new SRUFetcher(i18n("Library of Congress (US)"), QString::fromLatin1("z3950.loc.gov"), 7090,
- QString::fromLatin1("voyager"), parent_);
+Tellico::Fetch::Fetcher::Ptr SRUFetcher::libraryOfCongress(TQObject* tqparent_) {
+ return new SRUFetcher(i18n("Library of Congress (US)"), TQString::tqfromLatin1("z3950.loc.gov"), 7090,
+ TQString::tqfromLatin1("voyager"), tqparent_);
}
// static
Tellico::StringMap SRUFetcher::customFields() {
StringMap map;
- map[QString::fromLatin1("address")] = i18n("Address");
- map[QString::fromLatin1("abstract")] = i18n("Abstract");
+ map[TQString::tqfromLatin1("address")] = i18n("Address");
+ map[TQString::tqfromLatin1("abstract")] = i18n("Abstract");
return map;
}
-Tellico::Fetch::ConfigWidget* SRUFetcher::configWidget(QWidget* parent_) const {
- return new SRUConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* SRUFetcher::configWidget(TQWidget* tqparent_) const {
+ return new SRUConfigWidget(tqparent_, this);
}
-SRUConfigWidget::SRUConfigWidget(QWidget* parent_, const SRUFetcher* fetcher_ /*=0*/)
- : ConfigWidget(parent_) {
- QGridLayout* l = new QGridLayout(optionsWidget(), 4, 2);
+SRUConfigWidget::SRUConfigWidget(TQWidget* tqparent_, const SRUFetcher* fetcher_ /*=0*/)
+ : ConfigWidget(tqparent_) {
+ TQGridLayout* l = new TQGridLayout(optionsWidget(), 4, 2);
l->setSpacing(4);
l->setColStretch(1, 10);
int row = -1;
- QLabel* label = new QLabel(i18n("Hos&t: "), optionsWidget());
+ TQLabel* label = new TQLabel(i18n("Hos&t: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_hostEdit = new GUI::LineEdit(optionsWidget());
- connect(m_hostEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
- connect(m_hostEdit, SIGNAL(textChanged(const QString&)), SIGNAL(signalName(const QString&)));
- connect(m_hostEdit, SIGNAL(textChanged(const QString&)), SLOT(slotCheckHost()));
+ connect(m_hostEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
+ connect(m_hostEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SIGNAL(signalName(const TQString&)));
+ connect(m_hostEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotCheckHost()));
l->addWidget(m_hostEdit, row, 1);
- QString w = i18n("Enter the host name of the server.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_hostEdit, w);
+ TQString w = i18n("Enter the host name of the server.");
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_hostEdit, w);
label->setBuddy(m_hostEdit);
- label = new QLabel(i18n("&Port: "), optionsWidget());
+ label = new TQLabel(i18n("&Port: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_portSpinBox = new KIntSpinBox(0, 999999, 1, SRU_DEFAULT_PORT, 10, optionsWidget());
- connect(m_portSpinBox, SIGNAL(valueChanged(int)), SLOT(slotSetModified()));
+ connect(m_portSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotSetModified()));
l->addWidget(m_portSpinBox, row, 1);
- w = i18n("Enter the port number of the server. The default is %1.").arg(SRU_DEFAULT_PORT);
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_portSpinBox, w);
+ w = i18n("Enter the port number of the server. The default is %1.").tqarg(SRU_DEFAULT_PORT);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_portSpinBox, w);
label->setBuddy(m_portSpinBox);
- label = new QLabel(i18n("Path: "), optionsWidget());
+ label = new TQLabel(i18n("Path: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_pathEdit = new GUI::LineEdit(optionsWidget());
- connect(m_pathEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ connect(m_pathEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_pathEdit, row, 1);
w = i18n("Enter the path to the database used by the server.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_pathEdit, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_pathEdit, w);
label->setBuddy(m_pathEdit);
- label = new QLabel(i18n("Format: "), optionsWidget());
+ label = new TQLabel(i18n("Format: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_formatCombo = new GUI::ComboBox(optionsWidget());
- m_formatCombo->insertItem(QString::fromLatin1("MODS"), QString::fromLatin1("mods"));
- m_formatCombo->insertItem(QString::fromLatin1("MARCXML"), QString::fromLatin1("marcxml"));
- m_formatCombo->insertItem(QString::fromLatin1("Dublin Core"), QString::fromLatin1("dc"));
- connect(m_formatCombo, SIGNAL(activated(int)), SLOT(slotSetModified()));
+ m_formatCombo->insertItem(TQString::tqfromLatin1("MODS"), TQString::tqfromLatin1("mods"));
+ m_formatCombo->insertItem(TQString::tqfromLatin1("MARCXML"), TQString::tqfromLatin1("marcxml"));
+ m_formatCombo->insertItem(TQString::tqfromLatin1("Dublin Core"), TQString::tqfromLatin1("dc"));
+ connect(m_formatCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSetModified()));
l->addWidget(m_formatCombo, row, 1);
w = i18n("Enter the result format used by the server.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_formatCombo, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_formatCombo, w);
label->setBuddy(m_formatCombo);
l->setRowStretch(++row, 1);
// now add additional fields widget
- addFieldsWidget(SRUFetcher::customFields(), fetcher_ ? fetcher_->m_fields : QStringList());
+ addFieldsWidget(SRUFetcher::customFields(), fetcher_ ? fetcher_->m_fields : TQStringList());
if(fetcher_) {
m_hostEdit->setText(fetcher_->m_host);
@@ -496,7 +496,7 @@ SRUConfigWidget::SRUConfigWidget(QWidget* parent_, const SRUFetcher* fetcher_ /*
}
void SRUConfigWidget::saveConfig(KConfigGroup& config_) {
- QString s = m_hostEdit->text().stripWhiteSpace();
+ TQString s = m_hostEdit->text().stripWhiteSpace();
if(!s.isEmpty()) {
config_.writeEntry("Host", s);
}
@@ -516,15 +516,15 @@ void SRUConfigWidget::saveConfig(KConfigGroup& config_) {
slotSetModified(false);
}
-QString SRUConfigWidget::preferredName() const {
- QString s = m_hostEdit->text();
+TQString SRUConfigWidget::preferredName() const {
+ TQString s = m_hostEdit->text();
return s.isEmpty() ? SRUFetcher::defaultName() : s;
}
void SRUConfigWidget::slotCheckHost() {
- QString s = m_hostEdit->text();
+ TQString s = m_hostEdit->text();
// someone might be pasting a full URL, check that
- if(s.find(':') > -1 || s.find('/') > -1) {
+ if(s.tqfind(':') > -1 || s.tqfind('/') > -1) {
KURL u(s);
if(u.isValid()) {
m_hostEdit->setText(u.host());
diff --git a/src/fetch/srufetcher.h b/src/fetch/srufetcher.h
index fd07323..d62b866 100644
--- a/src/fetch/srufetcher.h
+++ b/src/fetch/srufetcher.h
@@ -32,8 +32,8 @@ namespace KIO {
#include "configwidget.h"
#include "../datavectors.h"
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
namespace Tellico {
namespace Fetch {
@@ -48,24 +48,25 @@ class SRUConfigWidget;
*/
class SRUFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
friend class SRUConfigWidget;
public:
/**
*/
- SRUFetcher(QObject* parent, const char* name = 0);
- SRUFetcher(const QString& name, const QString& host, uint port, const QString& dbname,
- QObject* parent);
+ SRUFetcher(TQObject* tqparent, const char* name = 0);
+ SRUFetcher(const TQString& name, const TQString& host, uint port, const TQString& dbname,
+ TQObject* tqparent);
/**
*/
virtual ~SRUFetcher();
/**
*/
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
// only search title, person, isbn, or keyword. No Raw for now.
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person || k == ISBN || k == Keyword || k == LCCN; }
virtual void stop();
@@ -78,43 +79,44 @@ public:
static StringMap customFields();
- virtual ConfigWidget* configWidget(QWidget* parent) const;
+ virtual ConfigWidget* configWidget(TQWidget* tqparent) const;
- static QString defaultName();
+ static TQString defaultName();
- static Fetcher::Ptr libraryOfCongress(QObject* parent);
+ static Fetcher::Ptr libraryOfCongress(TQObject* tqparent);
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
bool initMARCXMLHandler();
bool initMODSHandler();
- QString m_host;
+ TQString m_host;
uint m_port;
- QString m_path;
- QString m_format;
+ TQString m_path;
+ TQString m_format;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries;
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQGuardedPtr<KIO::Job> m_job;
XSLTHandler* m_MARCXMLHandler;
XSLTHandler* m_MODSHandler;
bool m_started;
- QStringList m_fields;
+ TQStringList m_fields;
};
class SRUConfigWidget : public ConfigWidget {
Q_OBJECT
+ TQ_OBJECT
friend class SRUFetcher;
public:
- SRUConfigWidget(QWidget* parent_, const SRUFetcher* fetcher = 0);
+ SRUConfigWidget(TQWidget* tqparent_, const SRUFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup& config);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
private slots:
void slotCheckHost();
diff --git a/src/fetch/yahoofetcher.cpp b/src/fetch/yahoofetcher.cpp
index 002b63b..d625cad 100644
--- a/src/fetch/yahoofetcher.cpp
+++ b/src/fetch/yahoofetcher.cpp
@@ -27,10 +27,10 @@
#include <kconfig.h>
#include <kio/job.h>
-#include <qdom.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qfile.h>
+#include <tqdom.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqfile.h>
namespace {
static const int YAHOO_MAX_RETURNS_TOTAL = 20;
@@ -40,8 +40,8 @@ namespace {
using Tellico::Fetch::YahooFetcher;
-YahooFetcher::YahooFetcher(QObject* parent_, const char* name_)
- : Fetcher(parent_, name_), m_xsltHandler(0),
+YahooFetcher::YahooFetcher(TQObject* tqparent_, const char* name_)
+ : Fetcher(tqparent_, name_), m_xsltHandler(0),
m_limit(YAHOO_MAX_RETURNS_TOTAL), m_job(0), m_started(false) {
}
@@ -50,11 +50,11 @@ YahooFetcher::~YahooFetcher() {
m_xsltHandler = 0;
}
-QString YahooFetcher::defaultName() {
+TQString YahooFetcher::defaultName() {
return i18n("Yahoo! Audio Search");
}
-QString YahooFetcher::source() const {
+TQString YahooFetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -66,7 +66,7 @@ void YahooFetcher::readConfigHook(const KConfigGroup& config_) {
Q_UNUSED(config_);
}
-void YahooFetcher::search(FetchKey key_, const QString& value_) {
+void YahooFetcher::search(FetchKey key_, const TQString& value_) {
m_key = key_;
m_value = value_;
m_started = true;
@@ -83,32 +83,32 @@ void YahooFetcher::continueSearch() {
void YahooFetcher::doSearch() {
// myDebug() << "YahooFetcher::search() - value = " << value_ << endl;
- KURL u(QString::fromLatin1(YAHOO_BASE_URL));
- u.addQueryItem(QString::fromLatin1("appid"), QString::fromLatin1(YAHOO_APP_ID));
- u.addQueryItem(QString::fromLatin1("type"), QString::fromLatin1("all"));
- u.addQueryItem(QString::fromLatin1("output"), QString::fromLatin1("xml"));
- u.addQueryItem(QString::fromLatin1("start"), QString::number(m_start));
- u.addQueryItem(QString::fromLatin1("results"), QString::number(YAHOO_MAX_RETURNS_TOTAL));
+ KURL u(TQString::tqfromLatin1(YAHOO_BASE_URL));
+ u.addQueryItem(TQString::tqfromLatin1("appid"), TQString::tqfromLatin1(YAHOO_APP_ID));
+ u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("all"));
+ u.addQueryItem(TQString::tqfromLatin1("output"), TQString::tqfromLatin1("xml"));
+ u.addQueryItem(TQString::tqfromLatin1("start"), TQString::number(m_start));
+ u.addQueryItem(TQString::tqfromLatin1("results"), TQString::number(YAHOO_MAX_RETURNS_TOTAL));
if(!canFetch(Kernel::self()->collectionType())) {
- message(i18n("%1 does not allow searching for this collection type.").arg(source()), MessageHandler::Warning);
+ message(i18n("%1 does not allow searching for this collection type.").tqarg(source()), MessageHandler::Warning);
stop();
return;
}
switch(m_key) {
case Title:
- u.addQueryItem(QString::fromLatin1("album"), m_value);
+ u.addQueryItem(TQString::tqfromLatin1("album"), m_value);
break;
case Person:
- u.addQueryItem(QString::fromLatin1("artist"), m_value);
+ u.addQueryItem(TQString::tqfromLatin1("artist"), m_value);
break;
// raw is used for the entry updates
case Raw:
-// u.removeQueryItem(QString::fromLatin1("type"));
-// u.addQueryItem(QString::fromLatin1("type"), QString::fromLatin1("phrase"));
+// u.removeQueryItem(TQString::tqfromLatin1("type"));
+// u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("phrase"));
u.setQuery(u.query() + '&' + m_value);
break;
@@ -120,10 +120,10 @@ void YahooFetcher::doSearch() {
// myDebug() << "YahooFetcher::search() - url: " << u.url() << endl;
m_job = KIO::get(u, false, false);
- connect(m_job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(m_job, SIGNAL(result(KIO::Job*)),
- SLOT(slotComplete(KIO::Job*)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job*)),
+ TQT_SLOT(slotComplete(KIO::Job*)));
}
void YahooFetcher::stop() {
@@ -139,8 +139,8 @@ void YahooFetcher::stop() {
emit signalDone(this);
}
-void YahooFetcher::slotData(KIO::Job*, const QByteArray& data_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+void YahooFetcher::slotData(KIO::Job*, const TQByteArray& data_) {
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
@@ -163,11 +163,11 @@ void YahooFetcher::slotComplete(KIO::Job* job_) {
#if 0
kdWarning() << "Remove debug from yahoofetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
- t << QCString(m_data, m_data.size()+1);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
+ t << TQCString(m_data, m_data.size()+1);
}
f.close();
#endif
@@ -181,20 +181,20 @@ void YahooFetcher::slotComplete(KIO::Job* job_) {
}
if(m_total == -1) {
- QDomDocument dom;
+ TQDomDocument dom;
if(!dom.setContent(m_data, false)) {
kdWarning() << "YahooFetcher::slotComplete() - server did not return valid XML." << endl;
return;
}
// total is top level element, with attribute totalResultsAvailable
- QDomElement e = dom.documentElement();
+ TQDomElement e = dom.documentElement();
if(!e.isNull()) {
- m_total = e.attribute(QString::fromLatin1("totalResultsAvailable")).toInt();
+ m_total = e.attribute(TQString::tqfromLatin1("totalResultsAvailable")).toInt();
}
}
// assume yahoo is always utf-8
- QString str = m_xsltHandler->applyStylesheet(QString::fromUtf8(m_data, m_data.size()));
+ TQString str = m_xsltHandler->applyStylesheet(TQString::fromUtf8(m_data, m_data.size()));
Import::TellicoImporter imp(str);
Data::CollPtr coll = imp.collection();
if(!coll) {
@@ -210,13 +210,13 @@ void YahooFetcher::slotComplete(KIO::Job* job_) {
// might get aborted
break;
}
- QString desc = entry->field(QString::fromLatin1("artist"))
- + QChar('/')
- + entry->field(QString::fromLatin1("label"))
- + QChar('/')
- + entry->field(QString::fromLatin1("year"));
+ TQString desc = entry->field(TQString::tqfromLatin1("artist"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("label"))
+ + TQChar('/')
+ + entry->field(TQString::tqfromLatin1("year"));
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, Data::EntryPtr(entry));
emit signalResultFound(r);
}
@@ -232,30 +232,30 @@ Tellico::Data::EntryPtr YahooFetcher::fetchEntry(uint uid_) {
return 0;
}
- KURL imageURL = entry->field(QString::fromLatin1("image"));
+ KURL imageURL = entry->field(TQString::tqfromLatin1("image"));
if(!imageURL.isEmpty()) {
- QString id = ImageFactory::addImage(imageURL, true);
+ TQString id = ImageFactory::addImage(imageURL, true);
if(id.isEmpty()) {
- // rich text causes layout issues
-// emit signalStatus(i18n("<qt>The cover image for <i>%1</i> could not be loaded.</qt>").arg(
-// entry->field(QString::fromLatin1("title"))));
+ // rich text causes tqlayout issues
+// emit signaltqStatus(i18n("<qt>The cover image for <i>%1</i> could not be loaded.</qt>").tqarg(
+// entry->field(TQString::tqfromLatin1("title"))));
message(i18n("The cover image could not be loaded."), MessageHandler::Warning);
} else {
- entry->setField(QString::fromLatin1("cover"), id);
+ entry->setField(TQString::tqfromLatin1("cover"), id);
}
}
getTracks(entry);
// don't want to show image urls in the fetch dialog
- entry->setField(QString::fromLatin1("image"), QString::null);
+ entry->setField(TQString::tqfromLatin1("image"), TQString());
// no need for album id now ?
- entry->setField(QString::fromLatin1("yahoo"), QString::null);
+ entry->setField(TQString::tqfromLatin1("yahoo"), TQString());
return entry;
}
void YahooFetcher::initXSLTHandler() {
- QString xsltfile = locate("appdata", QString::fromLatin1("yahoo2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("yahoo2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "YahooFetcher::initXSLTHandler() - can not locate yahoo2tellico.xsl." << endl;
return;
@@ -276,23 +276,23 @@ void YahooFetcher::initXSLTHandler() {
void YahooFetcher::getTracks(Data::EntryPtr entry_) {
// get album id
- if(!entry_ || entry_->field(QString::fromLatin1("yahoo")).isEmpty()) {
+ if(!entry_ || entry_->field(TQString::tqfromLatin1("yahoo")).isEmpty()) {
return;
}
- const QString albumid = entry_->field(QString::fromLatin1("yahoo"));
+ const TQString albumid = entry_->field(TQString::tqfromLatin1("yahoo"));
- KURL u(QString::fromLatin1(YAHOO_BASE_URL));
- u.setFileName(QString::fromLatin1("songSearch"));
- u.addQueryItem(QString::fromLatin1("appid"), QString::fromLatin1(YAHOO_APP_ID));
- u.addQueryItem(QString::fromLatin1("type"), QString::fromLatin1("all"));
- u.addQueryItem(QString::fromLatin1("output"), QString::fromLatin1("xml"));
+ KURL u(TQString::tqfromLatin1(YAHOO_BASE_URL));
+ u.setFileName(TQString::tqfromLatin1("songSearch"));
+ u.addQueryItem(TQString::tqfromLatin1("appid"), TQString::tqfromLatin1(YAHOO_APP_ID));
+ u.addQueryItem(TQString::tqfromLatin1("type"), TQString::tqfromLatin1("all"));
+ u.addQueryItem(TQString::tqfromLatin1("output"), TQString::tqfromLatin1("xml"));
// go ahesad and ask for all results, since there might well be more than 10 songs on the CD
- u.addQueryItem(QString::fromLatin1("results"), QString::number(50));
- u.addQueryItem(QString::fromLatin1("albumid"), albumid);
+ u.addQueryItem(TQString::tqfromLatin1("results"), TQString::number(50));
+ u.addQueryItem(TQString::tqfromLatin1("albumid"), albumid);
// myDebug() << "YahooFetcher::getTracks() - url: " << u.url() << endl;
- QDomDocument dom = FileHandler::readXMLFile(u, false /*no namespace*/, true /*quiet*/);
+ TQDomDocument dom = FileHandler::readXMLFile(u, false /*no namespace*/, true /*quiet*/);
if(dom.isNull()) {
myDebug() << "YahooFetcher::getTracks() - null dom returned" << endl;
return;
@@ -300,36 +300,36 @@ void YahooFetcher::getTracks(Data::EntryPtr entry_) {
#if 0
kdWarning() << "Remove debug from yahoofetcher.cpp" << endl;
- QFile f(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
- t.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream t(&f);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
t << dom.toString();
}
f.close();
#endif
- const QString track = QString::fromLatin1("track");
+ const TQString track = TQString::tqfromLatin1("track");
- QDomNodeList nodes = dom.documentElement().childNodes();
+ TQDomNodeList nodes = dom.documentElement().childNodes();
for(uint i = 0; i < nodes.count(); ++i) {
- QDomElement e = nodes.item(i).toElement();
+ TQDomElement e = nodes.item(i).toElement();
if(e.isNull()) {
continue;
}
- QString t = e.namedItem(QString::fromLatin1("Title")).toElement().text();
- QString n = e.namedItem(QString::fromLatin1("Track")).toElement().text();
+ TQString t = e.namedItem(TQString::tqfromLatin1("Title")).toElement().text();
+ TQString n = e.namedItem(TQString::tqfromLatin1("Track")).toElement().text();
bool ok;
int trackNum = Tellico::toUInt(n, &ok);
// trackNum might be 0
if(t.isEmpty() || !ok || trackNum < 1) {
continue;
}
- QString a = e.namedItem(QString::fromLatin1("Artist")).toElement().text();
- QString l = e.namedItem(QString::fromLatin1("Length")).toElement().text();
+ TQString a = e.namedItem(TQString::tqfromLatin1("Artist")).toElement().text();
+ TQString l = e.namedItem(TQString::tqfromLatin1("Length")).toElement().text();
int len = Tellico::toUInt(l, &ok);
- QString value = t + "::" + a;
+ TQString value = t + "::" + a;
if(ok && len > 0) {
value += + "::" + Tellico::minutes(len);
}
@@ -338,22 +338,22 @@ void YahooFetcher::getTracks(Data::EntryPtr entry_) {
}
// not zero-based
-QString YahooFetcher::insertValue(const QString& str_, const QString& value_, uint pos_) {
- QStringList list = Data::Field::split(str_, true);
+TQString YahooFetcher::insertValue(const TQString& str_, const TQString& value_, uint pos_) {
+ TQStringList list = Data::Field::split(str_, true);
for(uint i = list.count(); i < pos_; ++i) {
- list += QString::null;
+ list += TQString();
}
bool write = true;
if(!list[pos_-1].isNull()) {
// for some reason, some songs are repeated from yahoo, with 0 length, don't overwrite that
- if(value_.contains(QString::fromLatin1("::")) < 2) { // means no length value
+ if(value_.tqcontains(TQString::tqfromLatin1("::")) < 2) { // means no length value
write = false;
}
}
if(!value_.isEmpty() && write) {
list[pos_-1] = value_;
}
- return list.join(QString::fromLatin1("; "));
+ return list.join(TQString::tqfromLatin1("; "));
}
void YahooFetcher::updateEntry(Data::EntryPtr entry_) {
@@ -361,17 +361,17 @@ void YahooFetcher::updateEntry(Data::EntryPtr entry_) {
// limit to top 5 results
m_limit = 5;
- QString value;
- QString title = entry_->field(QString::fromLatin1("title"));
+ TQString value;
+ TQString title = entry_->field(TQString::tqfromLatin1("title"));
if(!title.isEmpty()) {
- value += QString::fromLatin1("album=") + title;
+ value += TQString::tqfromLatin1("album=") + title;
}
- QString artist = entry_->field(QString::fromLatin1("artist"));
+ TQString artist = entry_->field(TQString::tqfromLatin1("artist"));
if(!artist.isEmpty()) {
if(!value.isEmpty()) {
value += '&';
}
- value += QString::fromLatin1("artist=") + artist;
+ value += TQString::tqfromLatin1("artist=") + artist;
}
if(!value.isEmpty()) {
search(Fetch::Raw, value);
@@ -382,18 +382,18 @@ void YahooFetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* YahooFetcher::configWidget(QWidget* parent_) const {
- return new YahooFetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* YahooFetcher::configWidget(TQWidget* tqparent_) const {
+ return new YahooFetcher::ConfigWidget(tqparent_, this);
}
-YahooFetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const YahooFetcher*/*=0*/)
- : Fetch::ConfigWidget(parent_) {
- QVBoxLayout* l = new QVBoxLayout(optionsWidget());
- l->addWidget(new QLabel(i18n("This source has no options."), optionsWidget()));
+YahooFetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const YahooFetcher*/*=0*/)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQVBoxLayout* l = new TQVBoxLayout(optionsWidget());
+ l->addWidget(new TQLabel(i18n("This source has no options."), optionsWidget()));
l->addStretch();
}
-QString YahooFetcher::ConfigWidget::preferredName() const {
+TQString YahooFetcher::ConfigWidget::preferredName() const {
return YahooFetcher::defaultName();
}
diff --git a/src/fetch/yahoofetcher.h b/src/fetch/yahoofetcher.h
index 7ff5733..d7b2082 100644
--- a/src/fetch/yahoofetcher.h
+++ b/src/fetch/yahoofetcher.h
@@ -22,8 +22,8 @@ namespace Tellico {
#include "configwidget.h"
#include "../datavectors.h"
-#include <qcstring.h> // for QByteArray
-#include <qguardedptr.h>
+#include <tqcstring.h> // for TQByteArray
+#include <tqguardedptr.h>
namespace KIO {
class Job;
@@ -37,20 +37,21 @@ namespace Tellico {
*/
class YahooFetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
/**
*/
- YahooFetcher(QObject* parent, const char* name = 0);
+ YahooFetcher(TQObject* tqparent, const char* name = 0);
/**
*/
virtual ~YahooFetcher();
/**
*/
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void continueSearch();
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person; }
virtual void stop();
@@ -64,39 +65,39 @@ public:
/**
* Returns a widget for modifying the fetcher's config.
*/
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget : public Fetch::ConfigWidget {
public:
- ConfigWidget(QWidget* parent_, const YahooFetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent_, const YahooFetcher* fetcher = 0);
virtual void saveConfig(KConfigGroup&) {}
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
};
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
private slots:
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotComplete(KIO::Job* job);
private:
void initXSLTHandler();
void doSearch();
void getTracks(Data::EntryPtr entry);
- QString insertValue(const QString& str, const QString& value, uint pos);
+ TQString insertValue(const TQString& str, const TQString& value, uint pos);
XSLTHandler* m_xsltHandler;
int m_limit;
int m_start;
int m_total;
- QByteArray m_data;
- QMap<int, Data::EntryPtr> m_entries; // they get modified after collection is created, so can't be const
- QGuardedPtr<KIO::Job> m_job;
+ TQByteArray m_data;
+ TQMap<int, Data::EntryPtr> m_entries; // they get modified after collection is created, so can't be const
+ TQGuardedPtr<KIO::Job> m_job;
FetchKey m_key;
- QString m_value;
+ TQString m_value;
bool m_started;
};
diff --git a/src/fetch/z3950connection.cpp b/src/fetch/z3950connection.cpp
index 27efe51..5bf77ac 100644
--- a/src/fetch/z3950connection.cpp
+++ b/src/fetch/z3950connection.cpp
@@ -31,7 +31,7 @@ extern "C" {
#include <klocale.h>
-#include <qfile.h>
+#include <tqfile.h>
namespace {
static const size_t Z3950_DEFAULT_MAX_RECORDS = 20;
@@ -40,8 +40,8 @@ namespace {
using Tellico::Fetch::Z3950ResultFound;
using Tellico::Fetch::Z3950Connection;
-Z3950ResultFound::Z3950ResultFound(const QString& s) : QCustomEvent(uid())
- , m_result(QDeepCopy<QString>(s)) {
+Z3950ResultFound::Z3950ResultFound(const TQString& s) : TQCustomEvent(uid())
+ , m_result(TQDeepCopy<TQString>(s)) {
++Z3950Connection::resultsLeft;
}
@@ -69,23 +69,23 @@ int Z3950Connection::resultsLeft = 0;
// I'm paranoid about user insertions, so just grab 64
// characters at most
Z3950Connection::Z3950Connection(Z3950Fetcher* fetcher,
- const QString& host,
+ const TQString& host,
uint port,
- const QString& dbname,
- const QString& sourceCharSet,
- const QString& syntax,
- const QString& esn)
- : QThread()
+ const TQString& dbname,
+ const TQString& sourceCharSet,
+ const TQString& syntax,
+ const TQString& esn)
+ : TQThread()
, d(new Private())
, m_connected(false)
, m_aborted(false)
, m_fetcher(fetcher)
- , m_host(QDeepCopy<QString>(host))
+ , m_host(TQDeepCopy<TQString>(host))
, m_port(port)
- , m_dbname(QDeepCopy<QString>(dbname))
- , m_sourceCharSet(QDeepCopy<QString>(sourceCharSet.left(64)))
- , m_syntax(QDeepCopy<QString>(syntax))
- , m_esn(QDeepCopy<QString>(esn))
+ , m_dbname(TQDeepCopy<TQString>(dbname))
+ , m_sourceCharSet(TQDeepCopy<TQString>(sourceCharSet.left(64)))
+ , m_syntax(TQDeepCopy<TQString>(syntax))
+ , m_esn(TQDeepCopy<TQString>(esn))
, m_start(0)
, m_limit(Z3950_DEFAULT_MAX_RECORDS)
, m_hasMore(false) {
@@ -102,13 +102,13 @@ void Z3950Connection::reset() {
m_limit = Z3950_DEFAULT_MAX_RECORDS;
}
-void Z3950Connection::setQuery(const QString& query_) {
- m_pqn = QDeepCopy<QString>(query_);
+void Z3950Connection::setQuery(const TQString& query_) {
+ m_pqn = TQDeepCopy<TQString>(query_);
}
-void Z3950Connection::setUserPassword(const QString& user_, const QString& pword_) {
- m_user = QDeepCopy<QString>(user_);
- m_password = QDeepCopy<QString>(pword_);
+void Z3950Connection::setUserPassword(const TQString& user_, const TQString& pword_) {
+ m_user = TQDeepCopy<TQString>(user_);
+ m_password = TQDeepCopy<TQString>(pword_);
}
void Z3950Connection::run() {
@@ -129,7 +129,7 @@ void Z3950Connection::run() {
if(errcode != 0) {
myDebug() << "Z3950Connection::run() - query error: " << m_pqn << endl;
ZOOM_query_destroy(query);
- QString s = i18n("Query error!");
+ TQString s = i18n("Query error!");
s += ' ' + m_pqn;
done(s, MessageHandler::Error);
return;
@@ -147,16 +147,16 @@ void Z3950Connection::run() {
// to get MODS data, that seems a bit odd...
// esn only makes sense for marc and grs-1
// if syntax is mods, set esn to mods too
- QCString type = "raw";
+ TQCString type = "raw";
if(m_syntax == Latin1Literal("mods")) {
- m_syntax = QString::fromLatin1("xml");
+ m_syntax = TQString::tqfromLatin1("xml");
ZOOM_resultset_option_set(resultSet, "elementSetName", "mods");
type = "xml";
} else {
ZOOM_resultset_option_set(resultSet, "elementSetName", m_esn.latin1());
}
- ZOOM_resultset_option_set(resultSet, "start", QCString().setNum(m_start));
- ZOOM_resultset_option_set(resultSet, "count", QCString().setNum(m_limit-m_start));
+ ZOOM_resultset_option_set(resultSet, "start", TQCString().setNum(m_start));
+ ZOOM_resultset_option_set(resultSet, "count", TQCString().setNum(m_limit-m_start));
// search in default syntax, unless syntax is already set
if(!m_syntax.isEmpty()) {
ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", m_syntax.latin1());
@@ -170,8 +170,8 @@ void Z3950Connection::run() {
ZOOM_query_destroy(query);
m_connected = false;
- QString s = i18n("Connection search error %1: %2").arg(errcode).arg(toString(errmsg));
- if(!QCString(addinfo).isEmpty()) {
+ TQString s = i18n("Connection search error %1: %2").tqarg(errcode).tqarg(toString(errmsg));
+ if(!TQCString(addinfo).isEmpty()) {
s += " (" + toString(addinfo) + ")";
}
myDebug() << "Z3950Connection::run() - " << s << endl;
@@ -181,7 +181,7 @@ void Z3950Connection::run() {
const size_t numResults = ZOOM_resultset_size(resultSet);
- QString newSyntax = m_syntax;
+ TQString newSyntax = m_syntax;
if(numResults > 0) {
myLog() << "Z3950Connection::run() - current syntax is " << m_syntax << " (" << numResults << " results)" << endl;
// so now we know that results exist, might have to check syntax
@@ -190,10 +190,10 @@ void Z3950Connection::run() {
// want raw unless it's mods
ZOOM_record_get(rec, type, &len);
if(len > 0 && m_syntax.isEmpty()) {
- newSyntax = QString::fromLatin1(ZOOM_record_get(rec, "syntax", &len)).lower();
+ newSyntax = TQString::tqfromLatin1(ZOOM_record_get(rec, "syntax", &len)).lower();
myLog() << "Z3950Connection::run() - syntax guess is " << newSyntax << endl;
if(newSyntax == Latin1Literal("mods") || newSyntax == Latin1Literal("xml")) {
- m_syntax = QString::fromLatin1("xml");
+ m_syntax = TQString::tqfromLatin1("xml");
ZOOM_resultset_option_set(resultSet, "elementSetName", "mods");
} else if(newSyntax == Latin1Literal("grs-1")) {
// if it's defaulting to grs-1, go ahead and change it to try to get a marc
@@ -208,7 +208,7 @@ void Z3950Connection::run() {
newSyntax != Latin1Literal("unimarc") &&
newSyntax != Latin1Literal("grs-1")) {
myLog() << "Z3950Connection::run() - changing z39.50 syntax to MODS" << endl;
- newSyntax = QString::fromLatin1("xml");
+ newSyntax = TQString::tqfromLatin1("xml");
ZOOM_resultset_option_set(resultSet, "elementSetName", "mods");
ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", newSyntax.latin1());
rec = ZOOM_resultset_record(resultSet, 0);
@@ -216,28 +216,28 @@ void Z3950Connection::run() {
if(len == 0) {
// change set name back
ZOOM_resultset_option_set(resultSet, "elementSetName", m_esn.latin1());
- newSyntax = QString::fromLatin1("usmarc"); // try usmarc
+ newSyntax = TQString::tqfromLatin1("usmarc"); // try usmarc
myLog() << "Z3950Connection::run() - changing z39.50 syntax to USMARC" << endl;
ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", newSyntax.latin1());
rec = ZOOM_resultset_record(resultSet, 0);
ZOOM_record_get(rec, "raw", &len);
}
if(len == 0) {
- newSyntax = QString::fromLatin1("marc21"); // try marc21
+ newSyntax = TQString::tqfromLatin1("marc21"); // try marc21
myLog() << "Z3950Connection::run() - changing z39.50 syntax to MARC21" << endl;
ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", newSyntax.latin1());
rec = ZOOM_resultset_record(resultSet, 0);
ZOOM_record_get(rec, "raw", &len);
}
if(len == 0) {
- newSyntax = QString::fromLatin1("unimarc"); // try unimarc
+ newSyntax = TQString::tqfromLatin1("unimarc"); // try unimarc
myLog() << "Z3950Connection::run() - changing z39.50 syntax to UNIMARC" << endl;
ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", newSyntax.latin1());
rec = ZOOM_resultset_record(resultSet, 0);
ZOOM_record_get(rec, "raw", &len);
}
if(len == 0) {
- newSyntax = QString::fromLatin1("grs-1"); // try grs-1
+ newSyntax = TQString::tqfromLatin1("grs-1"); // try grs-1
myLog() << "Z3950Connection::run() - changing z39.50 syntax to GRS-1" << endl;
ZOOM_resultset_option_set(resultSet, "preferredRecordSyntax", newSyntax.latin1());
rec = ZOOM_resultset_record(resultSet, 0);
@@ -256,10 +256,10 @@ void Z3950Connection::run() {
// go back to fooling ourselves and calling it mods
if(m_syntax == Latin1Literal("xml")) {
- m_syntax = QString::fromLatin1("mods");
+ m_syntax = TQString::tqfromLatin1("mods");
}
if(newSyntax == Latin1Literal("xml")) {
- newSyntax = QString::fromLatin1("mods");
+ newSyntax = TQString::tqfromLatin1("mods");
}
// save syntax change for next time
if(m_syntax != newSyntax) {
@@ -268,10 +268,10 @@ void Z3950Connection::run() {
}
if(m_sourceCharSet.isEmpty()) {
- m_sourceCharSet = QString::fromLatin1("marc-8");
+ m_sourceCharSet = TQString::tqfromLatin1("marc-8");
}
- const size_t realLimit = QMIN(numResults, m_limit);
+ const size_t realLimit = TQMIN(numResults, m_limit);
for(size_t i = m_start; i < realLimit && !m_aborted; ++i) {
myLog() << "Z3950Connection::run() - grabbing index " << i << endl;
@@ -281,7 +281,7 @@ void Z3950Connection::run() {
continue;
}
int len;
- QString data;
+ TQString data;
if(m_syntax == Latin1Literal("mods")) {
data = toString(ZOOM_record_get(rec, "xml", &len));
} else if(m_syntax == Latin1Literal("grs-1")) { // grs-1
@@ -291,9 +291,9 @@ void Z3950Connection::run() {
#if 0
kdWarning() << "Remove debug from z3950connection.cpp" << endl;
{
- QFile f1(QString::fromLatin1("/tmp/z3950.raw"));
+ TQFile f1(TQString::tqfromLatin1("/tmp/z3950.raw"));
if(f1.open(IO_WriteOnly)) {
- QDataStream t(&f1);
+ TQDataStream t(&f1);
t << ZOOM_record_get(rec, "raw", &len);
}
f1.close();
@@ -302,7 +302,7 @@ void Z3950Connection::run() {
data = toXML(ZOOM_record_get(rec, "raw", &len), m_sourceCharSet);
}
Z3950ResultFound* ev = new Z3950ResultFound(data);
- QApplication::postEvent(m_fetcher, ev);
+ TQApplication::postEvent(m_fetcher, ev);
}
ZOOM_resultset_destroy(resultSet);
@@ -342,8 +342,8 @@ bool Z3950Connection::makeConnection() {
ZOOM_connection_destroy(d->conn);
m_connected = false;
- QString s = i18n("Connection error %1: %2").arg(errcode).arg(toString(errmsg));
- if(!QCString(addinfo).isEmpty()) {
+ TQString s = i18n("Connection error %1: %2").tqarg(errcode).tqarg(toString(errmsg));
+ if(!TQCString(addinfo).isEmpty()) {
s += " (" + toString(addinfo) + ")";
}
myDebug() << "Z3950Connection::makeConnection() - " << s << endl;
@@ -360,7 +360,7 @@ void Z3950Connection::done() {
kapp->postEvent(m_fetcher, new Z3950ConnectionDone(m_hasMore));
}
-void Z3950Connection::done(const QString& msg_, int type_) {
+void Z3950Connection::done(const TQString& msg_, int type_) {
checkPendingEvents();
if(m_aborted) {
kapp->postEvent(m_fetcher, new Z3950ConnectionDone(m_hasMore));
@@ -377,17 +377,17 @@ void Z3950Connection::checkPendingEvents() {
}
inline
-QCString Z3950Connection::toCString(const QString& text_) {
- return iconvRun(text_.utf8(), QString::fromLatin1("utf-8"), m_sourceCharSet);
+TQCString Z3950Connection::toCString(const TQString& text_) {
+ return iconvRun(text_.utf8(), TQString::tqfromLatin1("utf-8"), m_sourceCharSet);
}
inline
-QString Z3950Connection::toString(const QCString& text_) {
- return QString::fromUtf8(iconvRun(text_, m_sourceCharSet, QString::fromLatin1("utf-8")));
+TQString Z3950Connection::toString(const TQCString& text_) {
+ return TQString::fromUtf8(iconvRun(text_, m_sourceCharSet, TQString::tqfromLatin1("utf-8")));
}
// static
-QCString Z3950Connection::iconvRun(const QCString& text_, const QString& fromCharSet_, const QString& toCharSet_) {
+TQCString Z3950Connection::iconvRun(const TQCString& text_, const TQString& fromCharSet_, const TQString& toCharSet_) {
#ifdef HAVE_YAZ
if(text_.isEmpty()) {
return text_;
@@ -400,12 +400,12 @@ QCString Z3950Connection::iconvRun(const QCString& text_, const QString& fromCha
yaz_iconv_t cd = yaz_iconv_open(toCharSet_.latin1(), fromCharSet_.latin1());
if(!cd) {
// maybe it's iso 5426, which we sorta support
- QString charSetLower = fromCharSet_.lower();
+ TQString charSetLower = fromCharSet_.lower();
charSetLower.remove('-').remove(' ');
if(charSetLower == Latin1Literal("iso5426")) {
- return iconvRun(Iso5426Converter::toUtf8(text_).utf8(), QString::fromLatin1("utf-8"), toCharSet_);
+ return iconvRun(Iso5426Converter::toUtf8(text_).utf8(), TQString::tqfromLatin1("utf-8"), toCharSet_);
} else if(charSetLower == Latin1Literal("iso6937")) {
- return iconvRun(Iso6937Converter::toUtf8(text_).utf8(), QString::fromLatin1("utf-8"), toCharSet_);
+ return iconvRun(Iso6937Converter::toUtf8(text_).utf8(), TQString::tqfromLatin1("utf-8"), toCharSet_);
}
kdWarning() << "Z3950Connection::iconvRun() - conversion from " << fromCharSet_
<< " to " << toCharSet_ << " is unsupported" << endl;
@@ -416,7 +416,7 @@ QCString Z3950Connection::iconvRun(const QCString& text_, const QString& fromCha
size_t inlen = text_.length();
size_t outlen = 2 * inlen; // this is enough, right?
- QMemArray<char> result0(outlen);
+ TQMemArray<char> result0(outlen);
char* result = result0.data();
int r = yaz_iconv(cd, const_cast<char**>(&input), &inlen, &result, &outlen);
@@ -430,7 +430,7 @@ QCString Z3950Connection::iconvRun(const QCString& text_, const QString& fromCha
// length is pointer difference
size_t len = result - result0;
- QCString output = QCString(result0, len+1);
+ TQCString output = TQCString(result0, len+1);
// myDebug() << "-------------------------------------------" << endl;
// myDebug() << output << endl;
// myDebug() << "-------------------------------------------" << endl;
@@ -440,25 +440,25 @@ QCString Z3950Connection::iconvRun(const QCString& text_, const QString& fromCha
return text_;
}
-QString Z3950Connection::toXML(const QCString& marc_, const QString& charSet_) {
+TQString Z3950Connection::toXML(const TQCString& marc_, const TQString& charSet_) {
#ifdef HAVE_YAZ
if(marc_.isEmpty()) {
myDebug() << "Z3950Connection::toXML() - empty string" << endl;
- return QString::null;
+ return TQString();
}
yaz_iconv_t cd = yaz_iconv_open("utf-8", charSet_.latin1());
if(!cd) {
// maybe it's iso 5426, which we sorta support
- QString charSetLower = charSet_.lower();
+ TQString charSetLower = charSet_.lower();
charSetLower.remove('-').remove(' ');
if(charSetLower == Latin1Literal("iso5426")) {
- return toXML(Iso5426Converter::toUtf8(marc_).utf8(), QString::fromLatin1("utf-8"));
+ return toXML(Iso5426Converter::toUtf8(marc_).utf8(), TQString::tqfromLatin1("utf-8"));
} else if(charSetLower == Latin1Literal("iso6937")) {
- return toXML(Iso6937Converter::toUtf8(marc_).utf8(), QString::fromLatin1("utf-8"));
+ return toXML(Iso6937Converter::toUtf8(marc_).utf8(), TQString::tqfromLatin1("utf-8"));
}
kdWarning() << "Z3950Connection::toXML() - conversion from " << charSet_ << " is unsupported" << endl;
- return QString::null;
+ return TQString();
}
yaz_marc_t mt = yaz_marc_create();
@@ -474,7 +474,7 @@ QString Z3950Connection::toXML(const QCString& marc_, const QString& charSet_) {
#endif
if(ok && (len < 25 || len > 100000)) {
myDebug() << "Z3950Connection::toXML() - bad length: " << (ok ? len : -1) << endl;
- return QString::null;
+ return TQString();
}
#if YAZ_VERSIONL < 0x030000
@@ -485,12 +485,12 @@ QString Z3950Connection::toXML(const QCString& marc_, const QString& charSet_) {
int r = yaz_marc_decode_buf(mt, marc_, -1, &result, &len);
if(r <= 0) {
myDebug() << "Z3950Connection::toXML() - can't decode buffer" << endl;
- return QString::null;
+ return TQString();
}
- QString output = QString::fromLatin1("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- output += QString::fromUtf8(QCString(result, len+1), len+1);
-// myDebug() << QCString(result) << endl;
+ TQString output = TQString::tqfromLatin1("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+ output += TQString::fromUtf8(TQCString(result, len+1), len+1);
+// myDebug() << TQCString(result) << endl;
// myDebug() << "-------------------------------------------" << endl;
// myDebug() << output << endl;
yaz_iconv_close(cd);
@@ -498,6 +498,6 @@ QString Z3950Connection::toXML(const QCString& marc_, const QString& charSet_) {
return output;
#else // no yaz
- return QString::null;
+ return TQString();
#endif
}
diff --git a/src/fetch/z3950connection.h b/src/fetch/z3950connection.h
index 0929cb7..2c49c37 100644
--- a/src/fetch/z3950connection.h
+++ b/src/fetch/z3950connection.h
@@ -14,9 +14,9 @@
#ifndef TELLICO_FETCH_Z3950CONNECTION_H
#define TELLICO_FETCH_Z3950CONNECTION_H
-#include <qthread.h>
-#include <qevent.h>
-#include <qdeepcopy.h>
+#include <tqthread.h>
+#include <tqevent.h>
+#include <tqdeepcopy.h>
#include <ksharedptr.h>
@@ -24,76 +24,76 @@ namespace Tellico {
namespace Fetch {
class Z3950Fetcher;
-class Z3950ResultFound : public QCustomEvent {
+class Z3950ResultFound : public TQCustomEvent {
public:
- Z3950ResultFound(const QString& s);
+ Z3950ResultFound(const TQString& s);
~Z3950ResultFound();
- const QString& result() const { return m_result; }
+ const TQString& result() const { return m_result; }
static int uid() { return User + 11111; }
private:
- QString m_result;
+ TQString m_result;
};
-class Z3950ConnectionDone : public QCustomEvent {
+class Z3950ConnectionDone : public TQCustomEvent {
public:
- Z3950ConnectionDone(bool more) : QCustomEvent(uid()), m_type(-1), m_hasMore(more) {}
- Z3950ConnectionDone(bool more, const QString& s, int t) : QCustomEvent(uid()), m_msg(QDeepCopy<QString>(s)), m_type(t), m_hasMore(more) {}
+ Z3950ConnectionDone(bool more) : TQCustomEvent(uid()), m_type(-1), m_hasMore(more) {}
+ Z3950ConnectionDone(bool more, const TQString& s, int t) : TQCustomEvent(uid()), m_msg(TQDeepCopy<TQString>(s)), m_type(t), m_hasMore(more) {}
- const QString& message() const { return m_msg; }
+ const TQString& message() const { return m_msg; }
int messageType() const { return m_type; }
bool hasMoreResults() const { return m_hasMore; }
static int uid() { return User + 22222; }
private:
- QString m_msg;
+ TQString m_msg;
int m_type;
bool m_hasMore;
};
-class Z3950SyntaxChange : public QCustomEvent {
+class Z3950SyntaxChange : public TQCustomEvent {
public:
- Z3950SyntaxChange(const QString& s) : QCustomEvent(uid()), m_syntax(QDeepCopy<QString>(s)) {}
- const QString& syntax() const { return m_syntax; }
+ Z3950SyntaxChange(const TQString& s) : TQCustomEvent(uid()), m_syntax(TQDeepCopy<TQString>(s)) {}
+ const TQString& syntax() const { return m_syntax; }
static int uid() { return User + 33333; }
private:
- QString m_syntax;
+ TQString m_syntax;
};
/**
* @author Robby Stephenson
*/
-class Z3950Connection : public QThread {
+class Z3950Connection : public TQThread {
public:
Z3950Connection(Z3950Fetcher* fetcher,
- const QString& host,
+ const TQString& host,
uint port,
- const QString& dbname,
- const QString& sourceCharSet,
- const QString& syntax,
- const QString& esn);
+ const TQString& dbname,
+ const TQString& sourceCharSet,
+ const TQString& syntax,
+ const TQString& esn);
~Z3950Connection();
void reset();
- void setQuery(const QString& query);
- void setUserPassword(const QString& user, const QString& pword);
+ void setQuery(const TQString& query);
+ void setUserPassword(const TQString& user, const TQString& pword);
void run();
void abort() { m_aborted = true; }
private:
- static QCString iconvRun(const QCString& text, const QString& fromCharSet, const QString& toCharSet);
- static QString toXML(const QCString& marc, const QString& fromCharSet);
+ static TQCString iconvRun(const TQCString& text, const TQString& fromCharSet, const TQString& toCharSet);
+ static TQString toXML(const TQCString& marc, const TQString& fromCharSet);
bool makeConnection();
void done();
- void done(const QString& message, int type);
- QCString toCString(const QString& text);
- QString toString(const QCString& text);
+ void done(const TQString& message, int type);
+ TQCString toCString(const TQString& text);
+ TQString toString(const TQCString& text);
void checkPendingEvents();
class Private;
@@ -103,15 +103,15 @@ private:
bool m_aborted;
KSharedPtr<Z3950Fetcher> m_fetcher;
- QString m_host;
+ TQString m_host;
uint m_port;
- QString m_dbname;
- QString m_user;
- QString m_password;
- QString m_sourceCharSet;
- QString m_syntax;
- QString m_pqn;
- QString m_esn;
+ TQString m_dbname;
+ TQString m_user;
+ TQString m_password;
+ TQString m_sourceCharSet;
+ TQString m_syntax;
+ TQString m_pqn;
+ TQString m_esn;
size_t m_start;
size_t m_limit;
bool m_hasMore;
diff --git a/src/fetch/z3950fetcher.cpp b/src/fetch/z3950fetcher.cpp
index 5e045cf..465df5c 100644
--- a/src/fetch/z3950fetcher.cpp
+++ b/src/fetch/z3950fetcher.cpp
@@ -46,21 +46,21 @@
#include <kaccelmanager.h>
#include <kseparator.h>
-#include <qfile.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qwhatsthis.h>
-#include <qdom.h>
+#include <tqfile.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqwhatsthis.h>
+#include <tqdom.h>
namespace {
static const int Z3950_DEFAULT_PORT = 210;
- static const QString Z3950_DEFAULT_ESN = QString::fromLatin1("F");
+ static const TQString Z3950_DEFAULT_ESN = TQString::tqfromLatin1("F");
}
using Tellico::Fetch::Z3950Fetcher;
-Z3950Fetcher::Z3950Fetcher(QObject* parent_, const char* name_)
- : Fetcher(parent_, name_), m_conn(0), m_port(Z3950_DEFAULT_PORT), m_esn(Z3950_DEFAULT_ESN),
+Z3950Fetcher::Z3950Fetcher(TQObject* tqparent_, const char* name_)
+ : Fetcher(tqparent_, name_), m_conn(0), m_port(Z3950_DEFAULT_PORT), m_esn(Z3950_DEFAULT_ESN),
m_started(false), m_done(true), m_MARC21XMLHandler(0),
m_UNIMARCXMLHandler(0), m_MODSHandler(0) {
}
@@ -76,11 +76,11 @@ Z3950Fetcher::~Z3950Fetcher() {
m_conn = 0;
}
-QString Z3950Fetcher::defaultName() {
+TQString Z3950Fetcher::defaultName() {
return i18n("z39.50 Server");
}
-QString Z3950Fetcher::source() const {
+TQString Z3950Fetcher::source() const {
return m_name.isEmpty() ? defaultName() : m_name;
}
@@ -89,7 +89,7 @@ bool Z3950Fetcher::canFetch(int type) const {
}
void Z3950Fetcher::readConfigHook(const KConfigGroup& config_) {
- QString preset = config_.readEntry("Preset");
+ TQString preset = config_.readEntry("Preset");
if(preset.isEmpty()) {
m_host = config_.readEntry("Host");
int p = config_.readNumEntry("Port", Z3950_DEFAULT_PORT);
@@ -103,16 +103,16 @@ void Z3950Fetcher::readConfigHook(const KConfigGroup& config_) {
m_password = config_.readEntry("Password");
} else {
m_preset = preset;
- QString serverFile = locate("appdata", QString::fromLatin1("z3950-servers.cfg"));
+ TQString serverFile = locate("appdata", TQString::tqfromLatin1("z3950-servers.cfg"));
if(!serverFile.isEmpty()) {
KConfig cfg(serverFile, true /* read-only */, false /* read KDE */);
- const QStringList servers = cfg.groupList();
- for(QStringList::ConstIterator server = servers.begin(); server != servers.end(); ++server) {
+ const TQStringList servers = cfg.groupList();
+ for(TQStringList::ConstIterator server = servers.begin(); server != servers.end(); ++server) {
cfg.setGroup(*server);
- const QString id = *server;
+ const TQString id = *server;
if(id == preset) {
- const QString name = cfg.readEntry("Name");
+ const TQString name = cfg.readEntry("Name");
m_host = cfg.readEntry("Host");
m_port = cfg.readNumEntry("Port", Z3950_DEFAULT_PORT);
m_dbname = cfg.readEntry("Database");
@@ -133,7 +133,7 @@ void Z3950Fetcher::saveConfigHook(KConfigGroup& config_) {
config_.sync();
}
-void Z3950Fetcher::search(FetchKey key_, const QString& value_) {
+void Z3950Fetcher::search(FetchKey key_, const TQString& value_) {
#ifdef HAVE_YAZ
m_started = true;
m_done = false;
@@ -146,43 +146,43 @@ void Z3950Fetcher::search(FetchKey key_, const QString& value_) {
m_value = value_;
m_started = true;
- QString svalue = m_value;
- QRegExp rx1(QString::fromLatin1("['\"].*\\1"));
+ TQString svalue = m_value;
+ TQRegExp rx1(TQString::tqfromLatin1("['\"].*\\1"));
if(!rx1.exactMatch(svalue)) {
svalue.prepend('"').append('"');
}
switch(key_) {
case Title:
- m_pqn = QString::fromLatin1("@attr 1=4 ") + svalue;
+ m_pqn = TQString::tqfromLatin1("@attr 1=4 ") + svalue;
break;
case Person:
-// m_pqn = QString::fromLatin1("@or ");
-// m_pqn += QString::fromLatin1("@attr 1=1 \"") + m_value + '"';
- m_pqn = QString::fromLatin1(" @attr 1=1003 ") + svalue;
+// m_pqn = TQString::tqfromLatin1("@or ");
+// m_pqn += TQString::tqfromLatin1("@attr 1=1 \"") + m_value + '"';
+ m_pqn = TQString::tqfromLatin1(" @attr 1=1003 ") + svalue;
break;
case ISBN:
{
m_pqn.truncate(0);
- QString s = m_value;
+ TQString s = m_value;
s.remove('-');
- QStringList isbnList = QStringList::split(QString::fromLatin1("; "), s);
+ TQStringList isbnList = TQStringList::split(TQString::tqfromLatin1("; "), s);
// also going to search for isbn10 values
- for(QStringList::Iterator it = isbnList.begin(); it != isbnList.end(); ++it) {
- if((*it).startsWith(QString::fromLatin1("978"))) {
- QString isbn10 = ISBNValidator::isbn10(*it);
+ for(TQStringList::Iterator it = isbnList.begin(); it != isbnList.end(); ++it) {
+ if((*it).startsWith(TQString::tqfromLatin1("978"))) {
+ TQString isbn10 = ISBNValidator::isbn10(*it);
isbn10.remove('-');
isbnList.insert(it, isbn10);
}
}
const int count = isbnList.count();
if(count > 1) {
- m_pqn = QString::fromLatin1("@or ");
+ m_pqn = TQString::tqfromLatin1("@or ");
}
for(int i = 0; i < count; ++i) {
- m_pqn += QString::fromLatin1(" @attr 1=7 ") + isbnList[i];
+ m_pqn += TQString::tqfromLatin1(" @attr 1=7 ") + isbnList[i];
if(i < count-2) {
- m_pqn += QString::fromLatin1(" @or");
+ m_pqn += TQString::tqfromLatin1(" @or");
}
}
}
@@ -190,21 +190,21 @@ void Z3950Fetcher::search(FetchKey key_, const QString& value_) {
case LCCN:
{
m_pqn.truncate(0);
- QString s = m_value;
+ TQString s = m_value;
s.remove('-');
- QStringList lccnList = QStringList::split(QString::fromLatin1("; "), s);
+ TQStringList lccnList = TQStringList::split(TQString::tqfromLatin1("; "), s);
while(!lccnList.isEmpty()) {
- m_pqn += QString::fromLatin1(" @or @attr 1=9 ") + lccnList.front();
+ m_pqn += TQString::tqfromLatin1(" @or @attr 1=9 ") + lccnList.front();
if(lccnList.count() > 1) {
- m_pqn += QString::fromLatin1(" @or");
+ m_pqn += TQString::tqfromLatin1(" @or");
}
- m_pqn += QString::fromLatin1(" @attr 1=9 ") + LCCNValidator::formalize(lccnList.front());
+ m_pqn += TQString::tqfromLatin1(" @attr 1=9 ") + LCCNValidator::formalize(lccnList.front());
lccnList.pop_front();
}
}
break;
case Keyword:
- m_pqn = QString::fromLatin1("@attr 1=1016 ") + svalue;
+ m_pqn = TQString::tqfromLatin1("@attr 1=1016 ") + svalue;
break;
case Raw:
m_pqn = m_value;
@@ -214,7 +214,7 @@ void Z3950Fetcher::search(FetchKey key_, const QString& value_) {
stop();
return;
}
-// m_pqn = QString::fromLatin1("@attr 1=7 0253333490");
+// m_pqn = TQString::tqfromLatin1("@attr 1=7 0253333490");
myLog() << "Z3950Fetcher::search() - PQN query = " << m_pqn << endl;
if(m_conn) {
@@ -256,7 +256,7 @@ bool Z3950Fetcher::initMARC21Handler() {
return true;
}
- QString xsltfile = locate("appdata", QString::fromLatin1("MARC21slim2MODS3.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("MARC21slim2MODS3.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "Z3950Fetcher::initHandlers() - can not locate MARC21slim2MODS3.xsl." << endl;
return false;
@@ -280,7 +280,7 @@ bool Z3950Fetcher::initUNIMARCHandler() {
return true;
}
- QString xsltfile = locate("appdata", QString::fromLatin1("UNIMARC2MODS3.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("UNIMARC2MODS3.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "Z3950Fetcher::initHandlers() - can not locate UNIMARC2MODS3.xsl." << endl;
return false;
@@ -304,7 +304,7 @@ bool Z3950Fetcher::initMODSHandler() {
return true;
}
- QString xsltfile = locate("appdata", QString::fromLatin1("mods2tellico.xsl"));
+ TQString xsltfile = locate("appdata", TQString::tqfromLatin1("mods2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "Z3950Fetcher::initHandlers() - can not locate mods2tellico.xsl." << endl;
return false;
@@ -342,7 +342,7 @@ void Z3950Fetcher::process() {
m_conn->start();
}
-void Z3950Fetcher::handleResult(const QString& result_) {
+void Z3950Fetcher::handleResult(const TQString& result_) {
if(result_.isEmpty()) {
myDebug() << "Z3950Fetcher::handleResult() - empty record found, maybe the character encoding or record format is wrong?" << endl;
return;
@@ -351,18 +351,18 @@ void Z3950Fetcher::handleResult(const QString& result_) {
#if 0
kdWarning() << "Remove debug from z3950fetcher.cpp" << endl;
{
- QFile f1(QString::fromLatin1("/tmp/marc.xml"));
+ TQFile f1(TQString::tqfromLatin1("/tmp/marc.xml"));
if(f1.open(IO_WriteOnly)) {
// if(f1.open(IO_WriteOnly | IO_Append)) {
- QTextStream t(&f1);
- t.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream t(&f1);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
t << result_;
}
f1.close();
}
#endif
// assume always utf-8
- QString str, msg;
+ TQString str, msg;
Data::CollPtr coll = 0;
// not marc, has to be grs-1
if(m_syntax == Latin1Literal("grs-1")) {
@@ -385,11 +385,11 @@ void Z3950Fetcher::handleResult(const QString& result_) {
#if 0
kdWarning() << "Remove debug from z3950fetcher.cpp" << endl;
{
- QFile f2(QString::fromLatin1("/tmp/mods.xml"));
+ TQFile f2(TQString::tqfromLatin1("/tmp/mods.xml"));
// if(f2.open(IO_WriteOnly)) {
if(f2.open(IO_WriteOnly | IO_Append)) {
- QTextStream t(&f2);
- t.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream t(&f2);
+ t.setEncoding(TQTextStream::UnicodeUTF8);
t << str;
}
f2.close();
@@ -416,21 +416,21 @@ void Z3950Fetcher::handleResult(const QString& result_) {
const StringMap customFields = Z3950Fetcher::customFields();
for(StringMap::ConstIterator it = customFields.begin(); it != customFields.end(); ++it) {
- if(!m_fields.contains(it.key())) {
+ if(!m_fields.tqcontains(it.key())) {
coll->removeField(it.key());
}
}
Data::EntryVec entries = coll->entries();
for(Data::EntryVec::Iterator entry = entries.begin(); entry != entries.end(); ++entry) {
- QString desc = entry->field(QString::fromLatin1("author")) + '/'
- + entry->field(QString::fromLatin1("publisher"));
- if(!entry->field(QString::fromLatin1("cr_year")).isEmpty()) {
- desc += QChar('/') + entry->field(QString::fromLatin1("cr_year"));
- } else if(!entry->field(QString::fromLatin1("pub_year")).isEmpty()){
- desc += QChar('/') + entry->field(QString::fromLatin1("pub_year"));
+ TQString desc = entry->field(TQString::tqfromLatin1("author")) + '/'
+ + entry->field(TQString::tqfromLatin1("publisher"));
+ if(!entry->field(TQString::tqfromLatin1("cr_year")).isEmpty()) {
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("cr_year"));
+ } else if(!entry->field(TQString::tqfromLatin1("pub_year")).isEmpty()){
+ desc += TQChar('/') + entry->field(TQString::tqfromLatin1("pub_year"));
}
- SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(QString::fromLatin1("isbn")));
+ SearchResult* r = new SearchResult(this, entry->title(), desc, entry->field(TQString::tqfromLatin1("isbn")));
m_entries.insert(r->uid, entry);
emit signalResultFound(r);
}
@@ -445,7 +445,7 @@ Tellico::Data::EntryPtr Z3950Fetcher::fetchEntry(uint uid_) {
return m_entries[uid_];
}
-void Z3950Fetcher::customEvent(QCustomEvent* event_) {
+void Z3950Fetcher::customEvent(TQCustomEvent* event_) {
if(!m_conn) {
return;
}
@@ -480,20 +480,20 @@ void Z3950Fetcher::customEvent(QCustomEvent* event_) {
void Z3950Fetcher::updateEntry(Data::EntryPtr entry_) {
// myDebug() << "Z3950Fetcher::updateEntry() - " << source() << ": " << entry_->title() << endl;
- QString isbn = entry_->field(QString::fromLatin1("isbn"));
+ TQString isbn = entry_->field(TQString::tqfromLatin1("isbn"));
if(!isbn.isEmpty()) {
search(Fetch::ISBN, isbn);
return;
}
- QString lccn = entry_->field(QString::fromLatin1("lccn"));
+ TQString lccn = entry_->field(TQString::tqfromLatin1("lccn"));
if(!lccn.isEmpty()) {
search(Fetch::LCCN, lccn);
return;
}
// optimistically try searching for title and rely on Collection::sameEntry() to figure things out
- QString t = entry_->field(QString::fromLatin1("title"));
+ TQString t = entry_->field(TQString::tqfromLatin1("title"));
if(!t.isEmpty()) {
search(Fetch::Title, t);
return;
@@ -503,123 +503,123 @@ void Z3950Fetcher::updateEntry(Data::EntryPtr entry_) {
emit signalDone(this); // always need to emit this if not continuing with the search
}
-Tellico::Fetch::ConfigWidget* Z3950Fetcher::configWidget(QWidget* parent_) const {
- return new Z3950Fetcher::ConfigWidget(parent_, this);
+Tellico::Fetch::ConfigWidget* Z3950Fetcher::configWidget(TQWidget* tqparent_) const {
+ return new Z3950Fetcher::ConfigWidget(tqparent_, this);
}
-Z3950Fetcher::ConfigWidget::ConfigWidget(QWidget* parent_, const Z3950Fetcher* fetcher_/*=0*/)
- : Fetch::ConfigWidget(parent_) {
- QGridLayout* l = new QGridLayout(optionsWidget(), 7, 2);
+Z3950Fetcher::ConfigWidget::ConfigWidget(TQWidget* tqparent_, const Z3950Fetcher* fetcher_/*=0*/)
+ : Fetch::ConfigWidget(tqparent_) {
+ TQGridLayout* l = new TQGridLayout(optionsWidget(), 7, 2);
l->setSpacing(4);
l->setColStretch(1, 10);
int row = -1;
- m_usePreset = new QCheckBox(i18n("Use preset &server:"), optionsWidget());
+ m_usePreset = new TQCheckBox(i18n("Use preset &server:"), optionsWidget());
l->addWidget(m_usePreset, ++row, 0);
- connect(m_usePreset, SIGNAL(toggled(bool)), SLOT(slotTogglePreset(bool)));
+ connect(m_usePreset, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotTogglePreset(bool)));
m_serverCombo = new GUI::ComboBox(optionsWidget());
- connect(m_serverCombo, SIGNAL(activated(int)), SLOT(slotPresetChanged()));
+ connect(m_serverCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotPresetChanged()));
l->addWidget(m_serverCombo, row, 1);
++row;
l->addMultiCellWidget(new KSeparator(optionsWidget()), row, row, 0, 1);
l->setRowSpacing(row, 10);
- QLabel* label = new QLabel(i18n("Hos&t: "), optionsWidget());
+ TQLabel* label = new TQLabel(i18n("Hos&t: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_hostEdit = new GUI::LineEdit(optionsWidget());
- connect(m_hostEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
- connect(m_hostEdit, SIGNAL(textChanged(const QString&)), SIGNAL(signalName(const QString&)));
+ connect(m_hostEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
+ connect(m_hostEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SIGNAL(signalName(const TQString&)));
l->addWidget(m_hostEdit, row, 1);
- QString w = i18n("Enter the host name of the server.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_hostEdit, w);
+ TQString w = i18n("Enter the host name of the server.");
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_hostEdit, w);
label->setBuddy(m_hostEdit);
- label = new QLabel(i18n("&Port: "), optionsWidget());
+ label = new TQLabel(i18n("&Port: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_portSpinBox = new KIntSpinBox(0, 999999, 1, Z3950_DEFAULT_PORT, 10, optionsWidget());
- connect(m_portSpinBox, SIGNAL(valueChanged(int)), SLOT(slotSetModified()));
+ connect(m_portSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotSetModified()));
l->addWidget(m_portSpinBox, row, 1);
- w = i18n("Enter the port number of the server. The default is %1.").arg(Z3950_DEFAULT_PORT);
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_portSpinBox, w);
+ w = i18n("Enter the port number of the server. The default is %1.").tqarg(Z3950_DEFAULT_PORT);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_portSpinBox, w);
label->setBuddy(m_portSpinBox);
- label = new QLabel(i18n("&Database: "), optionsWidget());
+ label = new TQLabel(i18n("&Database: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_databaseEdit = new GUI::LineEdit(optionsWidget());
- connect(m_databaseEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ connect(m_databaseEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_databaseEdit, row, 1);
w = i18n("Enter the database name used by the server.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_databaseEdit, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_databaseEdit, w);
label->setBuddy(m_databaseEdit);
- label = new QLabel(i18n("Ch&aracter set: "), optionsWidget());
+ label = new TQLabel(i18n("Ch&aracter set: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_charSetCombo = new KComboBox(true, optionsWidget());
- m_charSetCombo->insertItem(QString::null);
- m_charSetCombo->insertItem(QString::fromLatin1("marc8"));
- m_charSetCombo->insertItem(QString::fromLatin1("iso-8859-1"));
- m_charSetCombo->insertItem(QString::fromLatin1("utf-8"));
- connect(m_charSetCombo, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ m_charSetCombo->insertItem(TQString());
+ m_charSetCombo->insertItem(TQString::tqfromLatin1("marc8"));
+ m_charSetCombo->insertItem(TQString::tqfromLatin1("iso-8859-1"));
+ m_charSetCombo->insertItem(TQString::tqfromLatin1("utf-8"));
+ connect(m_charSetCombo, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_charSetCombo, row, 1);
w = i18n("Enter the character set encoding used by the z39.50 server. The most likely choice "
"is MARC-8, although ISO-8859-1 is common as well.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_charSetCombo, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_charSetCombo, w);
label->setBuddy(m_charSetCombo);
- label = new QLabel(i18n("&Format: "), optionsWidget());
+ label = new TQLabel(i18n("&Format: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_syntaxCombo = new GUI::ComboBox(optionsWidget());
- m_syntaxCombo->insertItem(i18n("Auto-detect"), QString());
- m_syntaxCombo->insertItem(QString::fromLatin1("MODS"), QString::fromLatin1("mods"));
- m_syntaxCombo->insertItem(QString::fromLatin1("MARC21"), QString::fromLatin1("marc21"));
- m_syntaxCombo->insertItem(QString::fromLatin1("UNIMARC"), QString::fromLatin1("unimarc"));
- m_syntaxCombo->insertItem(QString::fromLatin1("USMARC"), QString::fromLatin1("usmarc"));
- m_syntaxCombo->insertItem(QString::fromLatin1("GRS-1"), QString::fromLatin1("grs-1"));
- connect(m_syntaxCombo, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ m_syntaxCombo->insertItem(i18n("Auto-detect"), TQString());
+ m_syntaxCombo->insertItem(TQString::tqfromLatin1("MODS"), TQString::tqfromLatin1("mods"));
+ m_syntaxCombo->insertItem(TQString::tqfromLatin1("MARC21"), TQString::tqfromLatin1("marc21"));
+ m_syntaxCombo->insertItem(TQString::tqfromLatin1("UNIMARC"), TQString::tqfromLatin1("unimarc"));
+ m_syntaxCombo->insertItem(TQString::tqfromLatin1("USMARC"), TQString::tqfromLatin1("usmarc"));
+ m_syntaxCombo->insertItem(TQString::tqfromLatin1("GRS-1"), TQString::tqfromLatin1("grs-1"));
+ connect(m_syntaxCombo, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_syntaxCombo, row, 1);
w = i18n("Enter the data format used by the z39.50 server. Tellico will attempt to "
"automatically detect the best setting if <i>auto-detect</i> is selected.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_syntaxCombo, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_syntaxCombo, w);
label->setBuddy(m_syntaxCombo);
- label = new QLabel(i18n("&User: "), optionsWidget());
+ label = new TQLabel(i18n("&User: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_userEdit = new GUI::LineEdit(optionsWidget());
m_userEdit->setHint(i18n("Optional"));
- connect(m_userEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ connect(m_userEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_userEdit, row, 1);
w = i18n("Enter the authentication user name used by the z39.50 database. Most servers "
"do not need one.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_userEdit, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_userEdit, w);
label->setBuddy(m_userEdit);
- label = new QLabel(i18n("Pass&word: "), optionsWidget());
+ label = new TQLabel(i18n("Pass&word: "), optionsWidget());
l->addWidget(label, ++row, 0);
m_passwordEdit = new GUI::LineEdit(optionsWidget());
m_passwordEdit->setHint(i18n("Optional"));
- m_passwordEdit->setEchoMode(QLineEdit::Password);
- connect(m_passwordEdit, SIGNAL(textChanged(const QString&)), SLOT(slotSetModified()));
+ m_passwordEdit->setEchoMode(TQLineEdit::Password);
+ connect(m_passwordEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSetModified()));
l->addWidget(m_passwordEdit, row, 1);
w = i18n("Enter the authentication password used by the z39.50 database. Most servers "
"do not need one. The password will be saved in plain text in the Tellico "
"configuration file.");
- QWhatsThis::add(label, w);
- QWhatsThis::add(m_passwordEdit, w);
+ TQWhatsThis::add(label, w);
+ TQWhatsThis::add(m_passwordEdit, w);
label->setBuddy(m_passwordEdit);
l->setRowStretch(++row, 1);
// now add additional fields widget
- addFieldsWidget(Z3950Fetcher::customFields(), fetcher_ ? fetcher_->m_fields : QStringList());
+ addFieldsWidget(Z3950Fetcher::customFields(), fetcher_ ? fetcher_->m_fields : TQStringList());
- loadPresets(fetcher_ ? fetcher_->m_preset : QString::null);
+ loadPresets(fetcher_ ? fetcher_->m_preset : TQString());
if(fetcher_) {
m_hostEdit->setText(fetcher_->m_host);
m_portSpinBox->setValue(fetcher_->m_port);
@@ -646,13 +646,13 @@ Z3950Fetcher::ConfigWidget::~ConfigWidget() {
void Z3950Fetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
if(m_usePreset->isChecked()) {
- QString presetID = m_serverCombo->currentData().toString();
+ TQString presetID = m_serverCombo->currentData().toString();
config_.writeEntry("Preset", presetID);
return;
}
config_.deleteEntry("Preset");
- QString s = m_hostEdit->text().stripWhiteSpace();
+ TQString s = m_hostEdit->text().stripWhiteSpace();
if(!s.isEmpty()) {
config_.writeEntry("Host", s);
}
@@ -689,9 +689,9 @@ void Z3950Fetcher::ConfigWidget::saveConfig(KConfigGroup& config_) {
// static
Tellico::StringMap Z3950Fetcher::customFields() {
StringMap map;
- map[QString::fromLatin1("address")] = i18n("Address");
- map[QString::fromLatin1("abstract")] = i18n("Abstract");
- map[QString::fromLatin1("illustrator")] = i18n("Illustrator");
+ map[TQString::tqfromLatin1("address")] = i18n("Address");
+ map[TQString::tqfromLatin1("abstract")] = i18n("Abstract");
+ map[TQString::tqfromLatin1("illustrator")] = i18n("Illustrator");
return map;
}
@@ -719,15 +719,15 @@ void Z3950Fetcher::ConfigWidget::slotPresetChanged() {
emit signalName(m_serverCombo->currentText());
}
-void Z3950Fetcher::ConfigWidget::loadPresets(const QString& current_) {
- QString lang = KGlobal::locale()->languageList().first();
- QString lang2A;
+void Z3950Fetcher::ConfigWidget::loadPresets(const TQString& current_) {
+ TQString lang = KGlobal::locale()->languageList().first();
+ TQString lang2A;
{
- QString dummy;
+ TQString dummy;
KGlobal::locale()->splitLocale(lang, lang2A, dummy, dummy);
}
- QString serverFile = locate("appdata", QString::fromLatin1("z3950-servers.cfg"));
+ TQString serverFile = locate("appdata", TQString::tqfromLatin1("z3950-servers.cfg"));
if(serverFile.isEmpty()) {
kdWarning() << "Z3950Fetcher::loadPresets() - no z3950 servers file found" << endl;
return;
@@ -736,30 +736,30 @@ void Z3950Fetcher::ConfigWidget::loadPresets(const QString& current_) {
int idx = -1;
KConfig cfg(serverFile, true /* read-only */, false /* read KDE */);
- const QStringList servers = cfg.groupList();
+ const TQStringList servers = cfg.groupList();
// I want the list of servers sorted by name
- QMap<QString, QString> serverNameMap;
- for(QStringList::ConstIterator server = servers.constBegin(); server != servers.constEnd(); ++server) {
+ TQMap<TQString, TQString> serverNameMap;
+ for(TQStringList::ConstIterator server = servers.constBegin(); server != servers.constEnd(); ++server) {
if((*server).isEmpty()) {
myDebug() << "Z3950Fetcher::ConfigWidget::loadPresets() - empty id" << endl;
continue;
}
cfg.setGroup(*server);
- const QString name = cfg.readEntry("Name");
+ const TQString name = cfg.readEntry("Name");
if(!name.isEmpty()) {
serverNameMap.insert(name, *server);
}
}
- for(QMap<QString, QString>::ConstIterator it = serverNameMap.constBegin(); it != serverNameMap.constEnd(); ++it) {
- const QString name = it.key();
- const QString id = it.data();
+ for(TQMap<TQString, TQString>::ConstIterator it = serverNameMap.constBegin(); it != serverNameMap.constEnd(); ++it) {
+ const TQString name = it.key();
+ const TQString id = it.data();
cfg.setGroup(id);
m_serverCombo->insertItem(i18n(name.utf8()), id);
if(current_.isEmpty() && idx == -1) {
// set the initial selection to something depending on the language
- const QStringList locales = cfg.readListEntry("Locale");
- if(locales.findIndex(lang) > -1 || locales.findIndex(lang2A) > -1) {
+ const TQStringList locales = cfg.readListEntry("Locale");
+ if(locales.tqfindIndex(lang) > -1 || locales.tqfindIndex(lang2A) > -1) {
idx = m_serverCombo->count() - 1;
}
} else if(id == current_) {
@@ -771,11 +771,11 @@ void Z3950Fetcher::ConfigWidget::loadPresets(const QString& current_) {
}
}
-QString Z3950Fetcher::ConfigWidget::preferredName() const {
+TQString Z3950Fetcher::ConfigWidget::preferredName() const {
if(m_usePreset->isChecked()) {
return m_serverCombo->currentText();
}
- QString s = m_hostEdit->text();
+ TQString s = m_hostEdit->text();
return s.isEmpty() ? i18n("z39.50 Server") : s;
}
diff --git a/src/fetch/z3950fetcher.h b/src/fetch/z3950fetcher.h
index ec6dca0..a183871 100644
--- a/src/fetch/z3950fetcher.h
+++ b/src/fetch/z3950fetcher.h
@@ -39,7 +39,7 @@ class KComboBox;
#include "configwidget.h"
#include "../datavectors.h"
-#include <qguardedptr.h>
+#include <tqguardedptr.h>
namespace Tellico {
namespace Fetch {
@@ -50,15 +50,16 @@ namespace Tellico {
*/
class Z3950Fetcher : public Fetcher {
Q_OBJECT
+ TQ_OBJECT
public:
- Z3950Fetcher(QObject* parent, const char* name = 0);
+ Z3950Fetcher(TQObject* tqparent, const char* name = 0);
virtual ~Z3950Fetcher();
- virtual QString source() const;
+ virtual TQString source() const;
virtual bool isSearching() const { return m_started; }
- virtual void search(FetchKey key, const QString& value);
+ virtual void search(FetchKey key, const TQString& value);
virtual void continueSearch();
// can search title, person, isbn, or keyword. No UPC or Raw for now.
virtual bool canSearch(FetchKey k) const { return k == Title || k == Person || k == ISBN || k == Keyword || k == LCCN; }
@@ -70,72 +71,73 @@ public:
virtual void saveConfigHook(KConfigGroup& config);
virtual void updateEntry(Data::EntryPtr entry);
- const QString& host() const { return m_host; }
+ const TQString& host() const { return m_host; }
static StringMap customFields();
- virtual Fetch::ConfigWidget* configWidget(QWidget* parent) const;
+ virtual Fetch::ConfigWidget* configWidget(TQWidget* tqparent) const;
class ConfigWidget;
friend class ConfigWidget;
- static QString defaultName();
+ static TQString defaultName();
protected:
- virtual void customEvent(QCustomEvent* event);
+ virtual void customEvent(TQCustomEvent* event);
private:
bool initMARC21Handler();
bool initUNIMARCHandler();
bool initMODSHandler();
void process();
- void handleResult(const QString& result);
+ void handleResult(const TQString& result);
void done();
Z3950Connection* m_conn;
- QString m_host;
+ TQString m_host;
uint m_port;
- QString m_dbname;
- QString m_user;
- QString m_password;
- QString m_sourceCharSet;
- QString m_syntax;
- QString m_pqn; // prefix query notation
- QString m_esn; // element set name
+ TQString m_dbname;
+ TQString m_user;
+ TQString m_password;
+ TQString m_sourceCharSet;
+ TQString m_syntax;
+ TQString m_pqn; // prefix query notation
+ TQString m_esn; // element set name
FetchKey m_key;
- QString m_value;
- QMap<int, Data::EntryPtr> m_entries;
+ TQString m_value;
+ TQMap<int, Data::EntryPtr> m_entries;
bool m_started;
bool m_done;
- QString m_preset;
+ TQString m_preset;
XSLTHandler* m_MARC21XMLHandler;
XSLTHandler* m_UNIMARCXMLHandler;
XSLTHandler* m_MODSHandler;
- QStringList m_fields;
+ TQStringList m_fields;
friend class Z3950Connection;
};
class Z3950Fetcher::ConfigWidget : public Fetch::ConfigWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- ConfigWidget(QWidget* parent, const Z3950Fetcher* fetcher = 0);
+ ConfigWidget(TQWidget* tqparent, const Z3950Fetcher* fetcher = 0);
virtual ~ConfigWidget();
virtual void saveConfig(KConfigGroup& config_);
- virtual QString preferredName() const;
+ virtual TQString preferredName() const;
private slots:
void slotTogglePreset(bool on);
void slotPresetChanged();
private:
- void loadPresets(const QString& current);
+ void loadPresets(const TQString& current);
- QCheckBox* m_usePreset;
+ TQCheckBox* m_usePreset;
GUI::ComboBox* m_serverCombo;
GUI::LineEdit* m_hostEdit;
KIntSpinBox* m_portSpinBox;
@@ -145,7 +147,7 @@ private:
KComboBox* m_charSetCombo;
GUI::ComboBox* m_syntaxCombo;
// have to remember syntax
- QString m_syntax;
+ TQString m_syntax;
};
} // end namespace
diff --git a/src/fetchdialog.cpp b/src/fetchdialog.cpp
index 453b1b3..18a17c8 100644
--- a/src/fetchdialog.cpp
+++ b/src/fetchdialog.cpp
@@ -41,16 +41,16 @@
#include <kaccelmanager.h>
#include <ktextedit.h>
-#include <qlayout.h>
-#include <qhbox.h>
-#include <qvgroupbox.h>
-#include <qsplitter.h>
-#include <qtimer.h>
-#include <qwhatsthis.h>
-#include <qcheckbox.h>
-#include <qvbox.h>
-#include <qtimer.h>
-#include <qimage.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqvgroupbox.h>
+#include <tqsplitter.h>
+#include <tqtimer.h>
+#include <tqwhatsthis.h>
+#include <tqcheckbox.h>
+#include <tqvbox.h>
+#include <tqtimer.h>
+#include <tqimage.h>
#include <config.h>
#ifdef ENABLE_WEBCAM
@@ -82,78 +82,78 @@ class FetchDialog::SearchResultItem : public Tellico::GUI::ListViewItem {
Fetch::SearchResult* m_result;
};
-FetchDialog::FetchDialog(QWidget* parent_, const char* name_)
- : KDialogBase(parent_, name_, false, i18n("Internet Search"), 0),
- m_timer(new QTimer(this)), m_started(false) {
+FetchDialog::FetchDialog(TQWidget* tqparent_, const char* name_)
+ : KDialogBase(tqparent_, name_, false, i18n("Internet Search"), 0),
+ m_timer(new TQTimer(this)), m_started(false) {
m_collType = Kernel::self()->collectionType();
- QWidget* mainWidget = new QWidget(this, "FetchDialog mainWidget");
+ TQWidget* mainWidget = new TQWidget(this, "FetchDialog mainWidget");
setMainWidget(mainWidget);
- QVBoxLayout* topLayout = new QVBoxLayout(mainWidget, 0, KDialog::spacingHint());
+ TQVBoxLayout* topLayout = new TQVBoxLayout(mainWidget, 0, KDialog::spacingHint());
- QVGroupBox* queryBox = new QVGroupBox(i18n("Search Query"), mainWidget, "FetchDialog queryBox");
+ TQVGroupBox* queryBox = new TQVGroupBox(i18n("Search Query"), mainWidget, "FetchDialog queryBox");
topLayout->addWidget(queryBox);
- QHBox* box1 = new QHBox(queryBox, "FetchDialog box1");
+ TQHBox* box1 = new TQHBox(queryBox, "FetchDialog box1");
box1->setSpacing(KDialog::spacingHint());
- QLabel* label = new QLabel(i18n("Start the search", "S&earch:"), box1);
+ TQLabel* label = new TQLabel(i18n("Start the search", "S&earch:"), box1);
m_valueLineEdit = new KLineEdit(box1);
label->setBuddy(m_valueLineEdit);
- QWhatsThis::add(m_valueLineEdit, i18n("Enter a search value. An ISBN search must include the full ISBN."));
+ TQWhatsThis::add(m_valueLineEdit, i18n("Enter a search value. An ISBN search must include the full ISBN."));
m_keyCombo = new GUI::ComboBox(box1);
Fetch::KeyMap map = Fetch::Manager::self()->keyMap();
for(Fetch::KeyMap::ConstIterator it = map.begin(); it != map.end(); ++it) {
m_keyCombo->insertItem(it.data(), it.key());
}
- connect(m_keyCombo, SIGNAL(activated(int)), SLOT(slotKeyChanged(int)));
- QWhatsThis::add(m_keyCombo, i18n("Choose the type of search"));
+ connect(m_keyCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotKeyChanged(int)));
+ TQWhatsThis::add(m_keyCombo, i18n("Choose the type of search"));
m_searchButton = new KPushButton(box1);
m_searchButton->setGuiItem(KGuiItem(i18n(FETCH_STRING_STOP),
- SmallIconSet(QString::fromLatin1("cancel"))));
- connect(m_searchButton, SIGNAL(clicked()), SLOT(slotSearchClicked()));
- QWhatsThis::add(m_searchButton, i18n("Click to start or stop the search"));
+ SmallIconSet(TQString::tqfromLatin1("cancel"))));
+ connect(m_searchButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotSearchClicked()));
+ TQWhatsThis::add(m_searchButton, i18n("Click to start or stop the search"));
// the search button's text changes from search to stop
// I don't want it resizing, so figure out the maximum size and set that
m_searchButton->polish();
- int maxWidth = m_searchButton->sizeHint().width();
- int maxHeight = m_searchButton->sizeHint().height();
+ int maxWidth = m_searchButton->tqsizeHint().width();
+ int maxHeight = m_searchButton->tqsizeHint().height();
m_searchButton->setGuiItem(KGuiItem(i18n(FETCH_STRING_SEARCH),
- SmallIconSet(QString::fromLatin1("find"))));
- maxWidth = QMAX(maxWidth, m_searchButton->sizeHint().width());
- maxHeight = QMAX(maxHeight, m_searchButton->sizeHint().height());
+ SmallIconSet(TQString::tqfromLatin1("tqfind"))));
+ maxWidth = TQMAX(maxWidth, m_searchButton->tqsizeHint().width());
+ maxHeight = TQMAX(maxHeight, m_searchButton->tqsizeHint().height());
m_searchButton->setMinimumWidth(maxWidth);
m_searchButton->setMinimumHeight(maxHeight);
- QHBox* box2 = new QHBox(queryBox);
+ TQHBox* box2 = new TQHBox(queryBox);
box2->setSpacing(KDialog::spacingHint());
- m_multipleISBN = new QCheckBox(i18n("&Multiple ISBN/UPC search"), box2);
- QWhatsThis::add(m_multipleISBN, i18n("Check this box to search for multiple ISBN or UPC values."));
- connect(m_multipleISBN, SIGNAL(toggled(bool)), SLOT(slotMultipleISBN(bool)));
+ m_multipleISBN = new TQCheckBox(i18n("&Multiple ISBN/UPC search"), box2);
+ TQWhatsThis::add(m_multipleISBN, i18n("Check this box to search for multiple ISBN or UPC values."));
+ connect(m_multipleISBN, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotMultipleISBN(bool)));
- m_editISBN = new KPushButton(KGuiItem(i18n("Edit List..."), QString::fromLatin1("text_block")), box2);
+ m_editISBN = new KPushButton(KGuiItem(i18n("Edit List..."), TQString::tqfromLatin1("text_block")), box2);
m_editISBN->setEnabled(false);
- QWhatsThis::add(m_editISBN, i18n("Click to open a text edit box for entering or editing multiple ISBN values."));
- connect(m_editISBN, SIGNAL(clicked()), SLOT(slotEditMultipleISBN()));
+ TQWhatsThis::add(m_editISBN, i18n("Click to open a text edit box for entering or editing multiple ISBN values."));
+ connect(m_editISBN, TQT_SIGNAL(clicked()), TQT_SLOT(slotEditMultipleISBN()));
// add for spacing
- box2->setStretchFactor(new QWidget(box2), 10);
+ box2->setStretchFactor(new TQWidget(box2), 10);
- label = new QLabel(i18n("Search s&ource:"), box2);
+ label = new TQLabel(i18n("Search s&ource:"), box2);
m_sourceCombo = new KComboBox(box2);
label->setBuddy(m_sourceCombo);
Fetch::FetcherVec sources = Fetch::Manager::self()->fetchers(m_collType);
for(Fetch::FetcherVec::Iterator it = sources.begin(); it != sources.end(); ++it) {
m_sourceCombo->insertItem(Fetch::Manager::self()->fetcherIcon(it.data()), (*it).source());
}
- connect(m_sourceCombo, SIGNAL(activated(const QString&)), SLOT(slotSourceChanged(const QString&)));
- QWhatsThis::add(m_sourceCombo, i18n("Select the database to search"));
+ connect(m_sourceCombo, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(slotSourceChanged(const TQString&)));
+ TQWhatsThis::add(m_sourceCombo, i18n("Select the database to search"));
- QSplitter* split = new QSplitter(QSplitter::Vertical, mainWidget);
+ TQSplitter* split = new TQSplitter(Qt::Vertical, mainWidget);
topLayout->addWidget(split);
m_listView = new GUI::ListView(split);
@@ -162,107 +162,107 @@ FetchDialog::FetchDialog(QWidget* parent_, const char* name_)
m_listView->setSorting(10); // greater than number of columns, so not sorting until user clicks column header
m_listView->setShowSortIndicator(true);
m_listView->setAllColumnsShowFocus(true);
- m_listView->setSelectionMode(QListView::Extended);
- m_listView->addColumn(QString::null, 20); // will show a check mark when added
- m_listView->setColumnAlignment(0, Qt::AlignHCenter); // align checkmark in middle
-// m_listView->setColumnWidthMode(0, QListView::Manual);
+ m_listView->setSelectionMode(TQListView::Extended);
+ m_listView->addColumn(TQString(), 20); // will show a check mark when added
+ m_listView->setColumnAlignment(0, TQt::AlignHCenter); // align checkmark in middle
+// m_listView->setColumnWidthMode(0, TQListView::Manual);
m_listView->addColumn(i18n("Title"));
m_listView->addColumn(i18n("Description"));
m_listView->addColumn(i18n("Source"));
m_listView->viewport()->installEventFilter(this);
- connect(m_listView, SIGNAL(selectionChanged()), SLOT(slotShowEntry()));
+ connect(m_listView, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotShowEntry()));
// double clicking should add the entry
- connect(m_listView, SIGNAL(doubleClicked(QListViewItem*)), SLOT(slotAddEntry()));
- QWhatsThis::add(m_listView, i18n("As results are found, they are added to this list. Selecting one "
+ connect(m_listView, TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_SLOT(slotAddEntry()));
+ TQWhatsThis::add(m_listView, i18n("As results are found, they are added to this list. Selecting one "
"will fetch the complete entry and show it in the view below."));
m_entryView = new EntryView(split, "entry_view");
// don't bother creating funky gradient images for compact view
m_entryView->setUseGradientImages(false);
// set the xslt file AFTER setting the gradient image option
- m_entryView->setXSLTFile(QString::fromLatin1("Compact.xsl"));
- QWhatsThis::add(m_entryView->view(), i18n("An entry may be shown here before adding it to the "
+ m_entryView->setXSLTFile(TQString::tqfromLatin1("Compact.xsl"));
+ TQWhatsThis::add(m_entryView->view(), i18n("An entry may be shown here before adding it to the "
"current collection by selecting it in the list above"));
- QHBox* box3 = new QHBox(mainWidget);
+ TQHBox* box3 = new TQHBox(mainWidget);
topLayout->addWidget(box3);
box3->setSpacing(KDialog::spacingHint());
m_addButton = new KPushButton(i18n("&Add Entry"), box3);
m_addButton->setEnabled(false);
m_addButton->setIconSet(UserIconSet(Kernel::self()->collectionTypeName()));
- connect(m_addButton, SIGNAL(clicked()), SLOT(slotAddEntry()));
- QWhatsThis::add(m_addButton, i18n("Add the selected entry to the current collection"));
+ connect(m_addButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddEntry()));
+ TQWhatsThis::add(m_addButton, i18n("Add the selected entry to the current collection"));
- m_moreButton = new KPushButton(KGuiItem(i18n("Get More Results"), SmallIconSet(QString::fromLatin1("find"))), box3);
+ m_moreButton = new KPushButton(KGuiItem(i18n("Get More Results"), SmallIconSet(TQString::tqfromLatin1("tqfind"))), box3);
m_moreButton->setEnabled(false);
- connect(m_moreButton, SIGNAL(clicked()), SLOT(slotMoreClicked()));
- QWhatsThis::add(m_moreButton, i18n("Fetch more results from the current data source"));
+ connect(m_moreButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoreClicked()));
+ TQWhatsThis::add(m_moreButton, i18n("Fetch more results from the current data source"));
KPushButton* clearButton = new KPushButton(KStdGuiItem::clear(), box3);
- connect(clearButton, SIGNAL(clicked()), SLOT(slotClearClicked()));
- QWhatsThis::add(clearButton, i18n("Clear all search fields and results"));
+ connect(clearButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotClearClicked()));
+ TQWhatsThis::add(clearButton, i18n("Clear all search fields and results"));
- QHBox* bottombox = new QHBox(mainWidget, "box");
+ TQHBox* bottombox = new TQHBox(mainWidget, "box");
topLayout->addWidget(bottombox);
bottombox->setSpacing(KDialog::spacingHint());
m_statusBar = new KStatusBar(bottombox, "statusbar");
- m_statusBar->insertItem(QString::null, FETCH_STATUS_ID, 1, false);
+ m_statusBar->insertItem(TQString(), FETCH_STATUS_ID, 1, false);
m_statusBar->setItemAlignment(FETCH_STATUS_ID, AlignLeft | AlignVCenter);
- m_progress = new QProgressBar(m_statusBar, "progress");
+ m_progress = new TQProgressBar(m_statusBar, "progress");
m_progress->setTotalSteps(0);
m_progress->setFixedHeight(fontMetrics().height()+2);
m_progress->hide();
m_statusBar->addWidget(m_progress, 0, true);
KPushButton* closeButton = new KPushButton(KStdGuiItem::close(), bottombox);
- connect(closeButton, SIGNAL(clicked()), SLOT(slotClose()));
+ connect(closeButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotClose()));
- connect(m_timer, SIGNAL(timeout()), SLOT(slotMoveProgress()));
+ connect(m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotMoveProgress()));
- setMinimumWidth(QMAX(minimumWidth(), FETCH_MIN_WIDTH));
- setStatus(i18n("Ready."));
+ setMinimumWidth(TQMAX(minimumWidth(), FETCH_MIN_WIDTH));
+ settqStatus(i18n("Ready."));
- resize(configDialogSize(QString::fromLatin1("Fetch Dialog Options")));
+ resize(configDialogSize(TQString::tqfromLatin1("Fetch Dialog Options")));
KConfigGroup config(kapp->config(), "Fetch Dialog Options");
- QValueList<int> splitList = config.readIntListEntry("Splitter Sizes");
+ TQValueList<int> splitList = config.readIntListEntry("Splitter Sizes");
if(!splitList.empty()) {
split->setSizes(splitList);
}
- connect(Fetch::Manager::self(), SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
- SLOT(slotResultFound(Tellico::Fetch::SearchResult*)));
- connect(Fetch::Manager::self(), SIGNAL(signalStatus(const QString&)),
- SLOT(slotStatus(const QString&)));
- connect(Fetch::Manager::self(), SIGNAL(signalDone()),
- SLOT(slotFetchDone()));
+ connect(Fetch::Manager::self(), TQT_SIGNAL(signalResultFound(Tellico::Fetch::SearchResult*)),
+ TQT_SLOT(slotResultFound(Tellico::Fetch::SearchResult*)));
+ connect(Fetch::Manager::self(), TQT_SIGNAL(signaltqStatus(const TQString&)),
+ TQT_SLOT(slottqStatus(const TQString&)));
+ connect(Fetch::Manager::self(), TQT_SIGNAL(signalDone()),
+ TQT_SLOT(slotFetchDone()));
// make sure to delete results afterwards
m_results.setAutoDelete(true);
KAcceleratorManager::manage(this);
// initialize combos
- QTimer::singleShot(0, this, SLOT(slotInit()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotInit()));
#ifdef ENABLE_WEBCAM
// barcode recognition
m_barcodeRecognitionThread = new barcodeRecognitionThread();
if (m_barcodeRecognitionThread->isWebcamAvailable()) {
- m_barcodePreview = new QLabel(0);
- m_barcodePreview->move( QApplication::desktop()->width() - 350, 30 );
+ m_barcodePreview = new TQLabel(0);
+ m_barcodePreview->move( TQApplication::desktop()->width() - 350, 30 );
m_barcodePreview->setAutoResize( true );
m_barcodePreview->show();
} else {
m_barcodePreview = 0;
}
- connect( m_barcodeRecognitionThread, SIGNAL(recognized(QString)), this, SLOT(slotBarcodeRecognized(QString)) );
- connect( m_barcodeRecognitionThread, SIGNAL(gotImage(QImage&)), this, SLOT(slotBarcodeGotImage(QImage&)) );
+ connect( m_barcodeRecognitionThread, TQT_SIGNAL(recognized(TQString)), this, TQT_SLOT(slotBarcodeRecognized(TQString)) );
+ connect( m_barcodeRecognitionThread, TQT_SIGNAL(gotImage(TQImage&)), this, TQT_SLOT(slotBarcodeGotImage(TQImage&)) );
m_barcodeRecognitionThread->start();
/* //DEBUG
- QImage img( "/home/sebastian/white.png", "PNG" );
+ TQImage img( "/home/sebastian/white.png", "PNG" );
m_barcodeRecognitionThread->recognizeBarcode( img );*/
#endif
}
@@ -279,16 +279,16 @@ FetchDialog::~FetchDialog() {
// we might have downloaded a lot of images we don't need to keep
Data::EntryVec entriesToCheck;
- for(QMap<int, Data::EntryPtr>::Iterator it = m_entries.begin(); it != m_entries.end(); ++it) {
+ for(TQMap<int, Data::EntryPtr>::Iterator it = m_entries.begin(); it != m_entries.end(); ++it) {
entriesToCheck.append(it.data());
}
// no additional entries to check images to keep though
Data::Document::self()->removeImagesNotInCollection(entriesToCheck, Data::EntryVec());
- saveDialogSize(QString::fromLatin1("Fetch Dialog Options"));
+ saveDialogSize(TQString::tqfromLatin1("Fetch Dialog Options"));
KConfigGroup config(kapp->config(), "Fetch Dialog Options");
- config.writeEntry("Splitter Sizes", static_cast<QSplitter*>(m_listView->parentWidget())->sizes());
+ config.writeEntry("Splitter Sizes", static_cast<TQSplitter*>(m_listView->tqparentWidget())->sizes());
config.writeEntry("Search Key", m_keyCombo->currentData().toInt());
config.writeEntry("Search Source", m_sourceCombo->currentText());
}
@@ -296,11 +296,11 @@ FetchDialog::~FetchDialog() {
void FetchDialog::slotSearchClicked() {
m_valueLineEdit->selectAll();
if(m_started) {
- setStatus(i18n("Cancelling the search..."));
+ settqStatus(i18n("Cancelling the search..."));
Fetch::Manager::self()->stop();
slotFetchDone();
} else {
- QString value = m_valueLineEdit->text().simplifyWhiteSpace();
+ TQString value = m_valueLineEdit->text().simplifyWhiteSpace();
if(value != m_oldSearch) {
m_listView->clear();
m_entryView->clear();
@@ -309,9 +309,9 @@ void FetchDialog::slotSearchClicked() {
m_oldSearch = value;
m_started = true;
m_searchButton->setGuiItem(KGuiItem(i18n(FETCH_STRING_STOP),
- SmallIconSet(QString::fromLatin1("cancel"))));
+ SmallIconSet(TQString::tqfromLatin1("cancel"))));
startProgress();
- setStatus(i18n("Searching..."));
+ settqStatus(i18n("Searching..."));
kapp->processEvents();
Fetch::Manager::self()->startSearch(m_sourceCombo->currentText(),
static_cast<Fetch::FetchKey>(m_keyCombo->currentData().toInt()),
@@ -331,45 +331,45 @@ void FetchDialog::slotClearClicked() {
m_moreButton->setEnabled(false);
m_isbnList.clear();
m_statusMessages.clear();
- setStatus(i18n("Ready.")); // because slotFetchDone() writes text
+ settqStatus(i18n("Ready.")); // because slotFetchDone() writes text
}
-void FetchDialog::slotStatus(const QString& status_) {
+void FetchDialog::slottqStatus(const TQString& status_) {
m_statusMessages.push_back(status_);
// if the queue was empty, start the timer
if(m_statusMessages.count() == 1) {
// wait 2 seconds
- QTimer::singleShot(2000, this, SLOT(slotUpdateStatus()));
+ TQTimer::singleShot(2000, this, TQT_SLOT(slotUpdatetqStatus()));
}
}
-void FetchDialog::slotUpdateStatus() {
+void FetchDialog::slotUpdatetqStatus() {
if(m_statusMessages.isEmpty()) {
return;
}
- setStatus(m_statusMessages.front());
+ settqStatus(m_statusMessages.front());
m_statusMessages.pop_front();
if(!m_statusMessages.isEmpty()) {
// wait 2 seconds
- QTimer::singleShot(2000, this, SLOT(slotUpdateStatus()));
+ TQTimer::singleShot(2000, this, TQT_SLOT(slotUpdatetqStatus()));
}
}
-void FetchDialog::setStatus(const QString& text_) {
- m_statusBar->changeItem(QChar(' ') + text_, FETCH_STATUS_ID);
+void FetchDialog::settqStatus(const TQString& text_) {
+ m_statusBar->changeItem(TQChar(' ') + text_, FETCH_STATUS_ID);
}
void FetchDialog::slotFetchDone(bool checkISBN /* = true */) {
// myDebug() << "FetchDialog::slotFetchDone()" << endl;
m_started = false;
m_searchButton->setGuiItem(KGuiItem(i18n(FETCH_STRING_SEARCH),
- SmallIconSet(QString::fromLatin1("find"))));
+ SmallIconSet(TQString::tqfromLatin1("tqfind"))));
stopProgress();
if(m_resultCount == 0) {
- slotStatus(i18n("The search returned no items."));
+ slottqStatus(i18n("The search returned no items."));
} else {
/* TRANSLATORS: This is a plural form, you need to translate both lines (except "_n: ") */
- slotStatus(i18n("The search returned 1 item.",
+ slottqStatus(i18n("The search returned 1 item.",
"The search returned %n items.",
m_resultCount));
}
@@ -385,41 +385,41 @@ void FetchDialog::slotFetchDone(bool checkISBN /* = true */) {
if(m_collType & (Data::Collection::Book | Data::Collection::Bibtex) &&
m_multipleISBN->isChecked() &&
(key == Fetch::ISBN || key == Fetch::UPC)) {
- QStringList values = QStringList::split(QString::fromLatin1("; "),
+ TQStringList values = TQStringList::split(TQString::tqfromLatin1("; "),
m_oldSearch.simplifyWhiteSpace());
- for(QStringList::Iterator it = values.begin(); it != values.end(); ++it) {
+ for(TQStringList::Iterator it = values.begin(); it != values.end(); ++it) {
*it = ISBNValidator::cleanValue(*it);
}
- for(QListViewItemIterator it(m_listView); it.current(); ++it) {
- QString i = ISBNValidator::cleanValue(static_cast<SearchResultItem*>(it.current())->m_result->isbn);
+ for(TQListViewItemIterator it(m_listView); it.current(); ++it) {
+ TQString i = ISBNValidator::cleanValue(static_cast<SearchResultItem*>(it.current())->m_result->isbn);
values.remove(i);
- if(i.length() > 10 && i.startsWith(QString::fromLatin1("978"))) {
+ if(i.length() > 10 && i.startsWith(TQString::tqfromLatin1("978"))) {
values.remove(ISBNValidator::cleanValue(ISBNValidator::isbn10(i)));
}
}
if(!values.isEmpty()) {
- for(QStringList::Iterator it = values.begin(); it != values.end(); ++it) {
+ for(TQStringList::Iterator it = values.begin(); it != values.end(); ++it) {
ISBNValidator::staticFixup(*it);
}
// TODO dialog caption
- KDialogBase* dlg = new KDialogBase(this, "isbn not found dialog", false, QString::null, KDialogBase::Ok);
- QWidget* box = new QWidget(dlg);
- QVBoxLayout* lay = new QVBoxLayout(box, KDialog::marginHint(), KDialog::spacingHint()*2);
- QHBoxLayout* lay2 = new QHBoxLayout(lay);
- QLabel* lab = new QLabel(box);
- lab->setPixmap(KGlobal::iconLoader()->loadIcon(QString::fromLatin1("messagebox_info"),
+ KDialogBase* dlg = new KDialogBase(this, "isbn not found dialog", false, TQString(), KDialogBase::Ok);
+ TQWidget* box = new TQWidget(dlg);
+ TQVBoxLayout* lay = new TQVBoxLayout(box, KDialog::marginHint(), KDialog::spacingHint()*2);
+ TQHBoxLayout* lay2 = new TQHBoxLayout(lay);
+ TQLabel* lab = new TQLabel(box);
+ lab->setPixmap(KGlobal::iconLoader()->loadIcon(TQString::tqfromLatin1("messagebox_info"),
KIcon::NoGroup,
KIcon::SizeMedium));
lay2->addWidget(lab);
- QString s = i18n("No results were found for the following ISBN values:");
- lay2->addWidget(new QLabel(s, box), 10);
+ TQString s = i18n("No results were found for the following ISBN values:");
+ lay2->addWidget(new TQLabel(s, box), 10);
KTextEdit* edit = new KTextEdit(box, "isbn list edit");
lay->addWidget(edit);
- edit->setText(values.join(QChar('\n')));
- QWhatsThis::add(edit, s);
- connect(dlg, SIGNAL(okClicked()), dlg, SLOT(deleteLater()));
+ edit->setText(values.join(TQChar('\n')));
+ TQWhatsThis::add(edit, s);
+ connect(dlg, TQT_SIGNAL(okClicked()), dlg, TQT_SLOT(deleteLater()));
dlg->setMainWidget(box);
- dlg->setMinimumWidth(QMAX(dlg->minimumWidth(), FETCH_MIN_WIDTH*2/3));
+ dlg->setMinimumWidth(TQMAX(dlg->minimumWidth(), FETCH_MIN_WIDTH*2/3));
dlg->show();
}
}
@@ -436,13 +436,13 @@ void FetchDialog::slotResultFound(Tellico::Fetch::SearchResult* result_) {
void FetchDialog::slotAddEntry() {
GUI::CursorSaver cs;
Data::EntryVec vec;
- for(QListViewItemIterator it(m_listView, QListViewItemIterator::Selected); it.current(); ++it) {
+ for(TQListViewItemIterator it(m_listView, TQListViewItemIterator::Selected); it.current(); ++it) {
SearchResultItem* item = static_cast<SearchResultItem*>(it.current());
Fetch::SearchResult* r = item->m_result;
Data::EntryPtr entry = m_entries[r->uid];
if(!entry) {
- setStatus(i18n("Fetching %1...").arg(r->title));
+ settqStatus(i18n("Fetching %1...").tqarg(r->title));
startProgress();
entry = r->fetchEntry();
if(!entry) {
@@ -450,11 +450,11 @@ void FetchDialog::slotAddEntry() {
}
m_entries.insert(r->uid, entry);
stopProgress();
- setStatus(i18n("Ready."));
+ settqStatus(i18n("Ready."));
}
// add a copy, intentionally allowing multiple copies to be added
vec.append(new Data::Entry(*entry));
- item->setPixmap(0, UserIcon(QString::fromLatin1("checkmark")));
+ item->setPixmap(0, UserIcon(TQString::tqfromLatin1("checkmark")));
}
if(!vec.isEmpty()) {
Kernel::self()->addEntries(vec, true);
@@ -469,9 +469,9 @@ void FetchDialog::slotMoreClicked() {
m_started = true;
m_searchButton->setGuiItem(KGuiItem(i18n(FETCH_STRING_STOP),
- SmallIconSet(QString::fromLatin1("cancel"))));
+ SmallIconSet(TQString::tqfromLatin1("cancel"))));
startProgress();
- setStatus(i18n("Searching..."));
+ settqStatus(i18n("Searching..."));
kapp->processEvents();
Fetch::Manager::self()->continueSearch();
}
@@ -494,7 +494,7 @@ void FetchDialog::slotShowEntry() {
SearchResultItem* item = static_cast<SearchResultItem*>(items.getFirst());
Fetch::SearchResult* r = item->m_result;
- setStatus(i18n("Fetching %1...").arg(r->title));
+ settqStatus(i18n("Fetching %1...").tqarg(r->title));
Data::EntryPtr entry = m_entries[r->uid];
if(!entry) {
GUI::CursorSaver cs;
@@ -505,7 +505,7 @@ void FetchDialog::slotShowEntry() {
}
stopProgress();
}
- setStatus(i18n("Ready."));
+ settqStatus(i18n("Ready."));
m_entryView->showEntry(entry);
}
@@ -538,7 +538,7 @@ void FetchDialog::slotInit() {
}
slotKeyChanged(m_keyCombo->currentItem());
- QString source = config.readEntry("Search Source");
+ TQString source = config.readEntry("Search Source");
if(!source.isEmpty()) {
m_sourceCombo->setCurrentItem(source);
}
@@ -553,14 +553,14 @@ void FetchDialog::slotKeyChanged(int idx_) {
if(key == Fetch::ISBN || key == Fetch::UPC || key == Fetch::LCCN) {
m_multipleISBN->setEnabled(true);
if(key == Fetch::ISBN) {
- m_valueLineEdit->setValidator(new ISBNValidator(this));
+ m_valueLineEdit->setValidator(new ISBNValidator(TQT_TQOBJECT(this)));
} else {
- UPCValidator* upc = new UPCValidator(this);
- connect(upc, SIGNAL(signalISBN()), SLOT(slotUPC2ISBN()));
+ UPCValidator* upc = new UPCValidator(TQT_TQOBJECT(this));
+ connect(upc, TQT_SIGNAL(signalISBN()), TQT_SLOT(slotUPC2ISBN()));
m_valueLineEdit->setValidator(upc);
// only want to convert to ISBN if ISBN is accepted by the fetcher
Fetch::KeyMap map = Fetch::Manager::self()->keyMap(m_sourceCombo->currentText());
- upc->setCheckISBN(map.contains(Fetch::ISBN));
+ upc->setCheckISBN(map.tqcontains(Fetch::ISBN));
}
} else {
m_multipleISBN->setChecked(false);
@@ -570,7 +570,7 @@ void FetchDialog::slotKeyChanged(int idx_) {
}
}
-void FetchDialog::slotSourceChanged(const QString& source_) {
+void FetchDialog::slotSourceChanged(const TQString& source_) {
int curr = m_keyCombo->currentData().toInt();
m_keyCombo->clear();
Fetch::KeyMap map = Fetch::Manager::self()->keyMap(source_);
@@ -587,7 +587,7 @@ void FetchDialog::slotMultipleISBN(bool toggle_) {
if(!wasEnabled && m_valueLineEdit->isEnabled()) {
// if we enable it, it probably had multiple isbn values
// the validator doesn't like that, so only keep the first value
- QString val = m_valueLineEdit->text().section(';', 0, 0);
+ TQString val = m_valueLineEdit->text().section(';', 0, 0);
m_valueLineEdit->setText(val);
}
m_editISBN->setEnabled(toggle_);
@@ -596,25 +596,25 @@ void FetchDialog::slotMultipleISBN(bool toggle_) {
void FetchDialog::slotEditMultipleISBN() {
KDialogBase dlg(this, "isbn edit dialog", true, i18n("Edit ISBN/UPC Values"),
KDialogBase::Ok|KDialogBase::Cancel);
- QVBox* box = new QVBox(&dlg);
+ TQVBox* box = new TQVBox(&dlg);
box->setSpacing(10);
- QString s = i18n("<qt>Enter the ISBN or UPC values, one per line.</qt>");
- (void) new QLabel(s, box);
+ TQString s = i18n("<qt>Enter the ISBN or UPC values, one per line.</qt>");
+ (void) new TQLabel(s, box);
m_isbnTextEdit = new KTextEdit(box, "isbn text edit");
- m_isbnTextEdit->setText(m_isbnList.join(QChar('\n')));
- QWhatsThis::add(m_isbnTextEdit, s);
- KPushButton* fromFileBtn = new KPushButton(SmallIconSet(QString::fromLatin1("fileopen")),
+ m_isbnTextEdit->setText(m_isbnList.join(TQChar('\n')));
+ TQWhatsThis::add(m_isbnTextEdit, s);
+ KPushButton* fromFileBtn = new KPushButton(SmallIconSet(TQString::tqfromLatin1("fileopen")),
i18n("&Load From File..."), box);
- QWhatsThis::add(fromFileBtn, i18n("<qt>Load the list from a text file.</qt>"));
- connect(fromFileBtn, SIGNAL(clicked()), SLOT(slotLoadISBNList()));
+ TQWhatsThis::add(fromFileBtn, i18n("<qt>Load the list from a text file.</qt>"));
+ connect(fromFileBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotLoadISBNList()));
dlg.setMainWidget(box);
- dlg.setMinimumWidth(QMAX(dlg.minimumWidth(), FETCH_MIN_WIDTH*2/3));
+ dlg.setMinimumWidth(TQMAX(dlg.minimumWidth(), FETCH_MIN_WIDTH*2/3));
- if(dlg.exec() == QDialog::Accepted) {
- m_isbnList = QStringList::split('\n', m_isbnTextEdit->text());
- const QValidator* val = m_valueLineEdit->validator();
+ if(dlg.exec() == TQDialog::Accepted) {
+ m_isbnList = TQStringList::split('\n', m_isbnTextEdit->text());
+ const TQValidator* val = m_valueLineEdit->validator();
if(val) {
- for(QStringList::Iterator it = m_isbnList.begin(); it != m_isbnList.end(); ++it) {
+ for(TQStringList::Iterator it = m_isbnList.begin(); it != m_isbnList.end(); ++it) {
val->fixup(*it);
if((*it).isEmpty()) {
it = m_isbnList.remove(it);
@@ -630,7 +630,7 @@ void FetchDialog::slotEditMultipleISBN() {
while(m_isbnList.count() > 100) {
m_isbnList.pop_back();
}
- m_valueLineEdit->setText(m_isbnList.join(QString::fromLatin1("; ")));
+ m_valueLineEdit->setText(m_isbnList.join(TQString::tqfromLatin1("; ")));
}
m_isbnTextEdit = 0; // gets auto-deleted
}
@@ -639,10 +639,10 @@ void FetchDialog::slotLoadISBNList() {
if(!m_isbnTextEdit) {
return;
}
- KURL u = KFileDialog::getOpenURL(QString::null, QString::null, this);
+ KURL u = KFileDialog::getOpenURL(TQString(), TQString(), this);
if(u.isValid()) {
m_isbnTextEdit->setText(m_isbnTextEdit->text() + FileHandler::readTextFile(u));
- m_isbnTextEdit->moveCursor(QTextEdit::MoveEnd, false);
+ m_isbnTextEdit->moveCursor(TQTextEdit::MoveEnd, false);
m_isbnTextEdit->scrollToBottom();
}
}
@@ -655,8 +655,8 @@ void FetchDialog::slotUPC2ISBN() {
}
}
-bool FetchDialog::eventFilter(QObject* obj_, QEvent* ev_) {
- if(obj_ == m_listView->viewport() && ev_->type() == QEvent::Resize) {
+bool FetchDialog::eventFilter(TQObject* obj_, TQEvent* ev_) {
+ if(TQT_BASE_OBJECT(obj_) == TQT_BASE_OBJECT(m_listView->viewport()) && ev_->type() == TQEvent::Resize) {
adjustColumnWidth();
}
return false;
@@ -670,17 +670,17 @@ void FetchDialog::adjustColumnWidth() {
int sum1 = 0;
int sum2 = 0;
int w3 = 0;
- for(QListViewItemIterator it(m_listView); it.current(); ++it) {
+ for(TQListViewItemIterator it(m_listView); it.current(); ++it) {
sum1 += it.current()->width(m_listView->fontMetrics(), m_listView, 1);
sum2 += it.current()->width(m_listView->fontMetrics(), m_listView, 2);
- w3 = QMAX(w3, it.current()->width(m_listView->fontMetrics(), m_listView, 3));
+ w3 = TQMAX(w3, it.current()->width(m_listView->fontMetrics(), m_listView, 3));
}
// try to be smart about column width
// column 0 is fixed, the checkmark icon, give it 20
const int w0 = 20;
// column 3 is the source, say max is 25% of viewport
const int vw = m_listView->visibleWidth();
- w3 = static_cast<int>(QMIN(1.1 * w3, 0.25 * vw));
+ w3 = static_cast<int>(TQMIN(1.1 * w3, 0.25 * vw));
// scale averages of col 1 and col 2
const int avg1 = sum1 / m_listView->childCount();
const int avg2 = sum2 / m_listView->childCount();
@@ -712,40 +712,40 @@ void FetchDialog::slotResetCollection() {
}
}
-void FetchDialog::slotBarcodeRecognized( QString string )
+void FetchDialog::slotBarcodeRecognized( TQString string )
{
// attention: this slot is called in the context of another thread => do not use GUI-functions!
- QCustomEvent *e = new QCustomEvent( QEvent::User );
- QString *data = new QString( string );
+ TQCustomEvent *e = new TQCustomEvent( TQEvent::User );
+ TQString *data = new TQString( string );
e->setData( data );
- qApp->postEvent( this, e ); // the event loop will call FetchDialog::customEvent() in the context of the GUI thread
+ tqApp->postEvent( this, e ); // the event loop will call FetchDialog::customEvent() in the context of the GUI thread
}
-void FetchDialog::slotBarcodeGotImage( QImage &img )
+void FetchDialog::slotBarcodeGotImage( TQImage &img )
{
// attention: this slot is called in the context of another thread => do not use GUI-functions!
- QCustomEvent *e = new QCustomEvent( QEvent::User+1 );
- QImage *data = new QImage( img.copy() );
+ TQCustomEvent *e = new TQCustomEvent( TQEvent::User+1 );
+ TQImage *data = new TQImage( img.copy() );
e->setData( data );
- qApp->postEvent( this, e ); // the event loop will call FetchDialog::customEvent() in the context of the GUI thread
+ tqApp->postEvent( this, e ); // the event loop will call FetchDialog::customEvent() in the context of the GUI thread
}
-void FetchDialog::customEvent( QCustomEvent *e )
+void FetchDialog::customEvent( TQCustomEvent *e )
{
if (!e)
return;
- if ((e->type() == QEvent::User) && e->data()) {
+ if ((e->type() == TQEvent::User) && e->data()) {
// slotBarcodeRecognized() queued call
- QString temp = *(QString*)(e->data());
- delete (QString*)(e->data());
- qApp->beep();
+ TQString temp = *(TQString*)(e->data());
+ delete (TQString*)(e->data());
+ tqApp->beep();
m_valueLineEdit->setText( temp );
m_searchButton->animateClick();
}
- if ((e->type() == QEvent::User+1) && e->data()) {
+ if ((e->type() == TQEvent::User+1) && e->data()) {
// slotBarcodegotImage() queued call
- QImage temp = *(QImage*)(e->data());
- delete (QImage*)(e->data());
+ TQImage temp = *(TQImage*)(e->data());
+ delete (TQImage*)(e->data());
m_barcodePreview->setPixmap( temp );
}
}
diff --git a/src/fetchdialog.h b/src/fetchdialog.h
index eef4bdc..d690515 100644
--- a/src/fetchdialog.h
+++ b/src/fetchdialog.h
@@ -18,7 +18,7 @@
#include <kdialogbase.h>
-#include <qguardedptr.h>
+#include <tqguardedptr.h>
namespace Tellico {
class EntryView;
@@ -41,9 +41,9 @@ class KLineEdit;
class KPushButton;
class KStatusBar;
class KTextEdit;
-class QProgressBar;
-class QTimer;
-class QCheckBox;
+class TQProgressBar;
+class TQTimer;
+class TQCheckBox;
namespace Tellico {
@@ -53,19 +53,20 @@ namespace Tellico {
*/
class FetchDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor
*/
- FetchDialog(QWidget* parent, const char* name = 0);
+ FetchDialog(TQWidget* tqparent, const char* name = 0);
~FetchDialog();
public slots:
void slotResetCollection();
protected:
- bool eventFilter(QObject* obj, QEvent* ev);
+ bool eventFilter(TQObject* obj, TQEvent* ev);
private slots:
void slotSearchClicked();
@@ -75,28 +76,28 @@ private slots:
void slotShowEntry();
void slotMoveProgress();
- void slotStatus(const QString& status);
- void slotUpdateStatus();
+ void slottqStatus(const TQString& status);
+ void slotUpdatetqStatus();
void slotFetchDone(bool checkISBN = true);
void slotResultFound(Tellico::Fetch::SearchResult* result);
void slotKeyChanged(int);
- void slotSourceChanged(const QString& source);
+ void slotSourceChanged(const TQString& source);
void slotMultipleISBN(bool toggle);
void slotEditMultipleISBN();
void slotInit();
void slotLoadISBNList();
void slotUPC2ISBN();
- void slotBarcodeRecognized(QString);
- void slotBarcodeGotImage(QImage&);
+ void slotBarcodeRecognized(TQString);
+ void slotBarcodeGotImage(TQImage&);
private:
void startProgress();
void stopProgress();
- void setStatus(const QString& text);
+ void settqStatus(const TQString& text);
void adjustColumnWidth();
- void customEvent( QCustomEvent *e );
+ void customEvent( TQCustomEvent *e );
class SearchResultItem;
@@ -104,25 +105,25 @@ private:
GUI::ComboBox* m_keyCombo;
KLineEdit* m_valueLineEdit;
KPushButton* m_searchButton;
- QCheckBox* m_multipleISBN;
+ TQCheckBox* m_multipleISBN;
KPushButton* m_editISBN;
GUI::ListView* m_listView;
EntryView* m_entryView;
KPushButton* m_addButton;
KPushButton* m_moreButton;
KStatusBar* m_statusBar;
- QProgressBar* m_progress;
- QTimer* m_timer;
- QGuardedPtr<KTextEdit> m_isbnTextEdit;
- QLabel *m_barcodePreview;
+ TQProgressBar* m_progress;
+ TQTimer* m_timer;
+ TQGuardedPtr<KTextEdit> m_isbnTextEdit;
+ TQLabel *m_barcodePreview;
bool m_started;
int m_resultCount;
- QString m_oldSearch;
- QStringList m_isbnList;
- QStringList m_statusMessages;
- QMap<int, Data::EntryPtr> m_entries;
- QPtrList<Fetch::SearchResult> m_results;
+ TQString m_oldSearch;
+ TQStringList m_isbnList;
+ TQStringList m_statusMessages;
+ TQMap<int, Data::EntryPtr> m_entries;
+ TQPtrList<Fetch::SearchResult> m_results;
int m_collType;
barcodeRecognition::barcodeRecognitionThread *m_barcodeRecognitionThread;
diff --git a/src/fetcherconfigdialog.cpp b/src/fetcherconfigdialog.cpp
index 99d4bbe..1e1a3e3 100644
--- a/src/fetcherconfigdialog.cpp
+++ b/src/fetcherconfigdialog.cpp
@@ -20,14 +20,14 @@
#include <kcombobox.h>
#include <kiconloader.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qhgroupbox.h>
-#include <qwidgetstack.h>
-#include <qwhatsthis.h>
-#include <qhbox.h>
-#include <qvgroupbox.h>
-#include <qcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqhgroupbox.h>
+#include <tqwidgetstack.h>
+#include <tqwhatsthis.h>
+#include <tqhbox.h>
+#include <tqvgroupbox.h>
+#include <tqcheckbox.h>
namespace {
static const int FETCHER_CONFIG_MIN_WIDTH = 600;
@@ -35,8 +35,8 @@ namespace {
using Tellico::FetcherConfigDialog;
-FetcherConfigDialog::FetcherConfigDialog(QWidget* parent_)
- : KDialogBase(parent_, "fetcher dialog", true, i18n("Data Source Properties"),
+FetcherConfigDialog::FetcherConfigDialog(TQWidget* tqparent_)
+ : KDialogBase(tqparent_, "fetcher dialog", true, i18n("Data Source Properties"),
KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help)
, m_newSource(true)
, m_useDefaultName(true)
@@ -44,9 +44,9 @@ FetcherConfigDialog::FetcherConfigDialog(QWidget* parent_)
init(Fetch::Unknown);
}
-FetcherConfigDialog::FetcherConfigDialog(const QString& sourceName_, Fetch::Type type_, bool updateOverwrite_,
- Fetch::ConfigWidget* configWidget_, QWidget* parent_)
- : KDialogBase(parent_, "fetcher dialog", true, i18n("Data Source Properties"),
+FetcherConfigDialog::FetcherConfigDialog(const TQString& sourceName_, Fetch::Type type_, bool updateOverwrite_,
+ Fetch::ConfigWidget* configWidget_, TQWidget* tqparent_)
+ : KDialogBase(tqparent_, "fetcher dialog", true, i18n("Data Source Properties"),
KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help)
, m_newSource(false)
, m_useDefaultName(false)
@@ -58,70 +58,70 @@ FetcherConfigDialog::FetcherConfigDialog(const QString& sourceName_, Fetch::Type
void FetcherConfigDialog::init(Fetch::Type type_) {
setMinimumWidth(FETCHER_CONFIG_MIN_WIDTH);
- setHelp(QString::fromLatin1("data-sources-options"));
+ setHelp(TQString::tqfromLatin1("data-sources-options"));
- QWidget* widget = new QWidget(this);
- QBoxLayout* topLayout = new QHBoxLayout(widget, KDialog::spacingHint());
+ TQWidget* widget = new TQWidget(this);
+ TQBoxLayout* topLayout = new TQHBoxLayout(widget, KDialog::spacingHint());
- QBoxLayout* vlay1 = new QVBoxLayout(topLayout, KDialog::spacingHint());
- m_iconLabel = new QLabel(widget);
+ TQBoxLayout* vlay1 = new TQVBoxLayout(topLayout, KDialog::spacingHint());
+ m_iconLabel = new TQLabel(widget);
if(type_ == Fetch::Unknown) {
- m_iconLabel->setPixmap(KGlobal::iconLoader()->loadIcon(QString::fromLatin1("network"), KIcon::Panel, 64));
+ m_iconLabel->setPixmap(KGlobal::iconLoader()->loadIcon(TQString::tqfromLatin1("network"), KIcon::Panel, 64));
} else {
m_iconLabel->setPixmap(Fetch::Manager::self()->fetcherIcon(type_, KIcon::Panel, 64));
}
vlay1->addWidget(m_iconLabel);
vlay1->addStretch(1);
- QBoxLayout* vlay2 = new QVBoxLayout(topLayout, KDialog::spacingHint());
+ TQBoxLayout* vlay2 = new TQVBoxLayout(topLayout, KDialog::spacingHint());
- QGridLayout* gl = new QGridLayout(vlay2, 2, 2, KDialog::spacingHint());
+ TQGridLayout* gl = new TQGridLayout(vlay2, 2, 2, KDialog::spacingHint());
int row = -1;
- QLabel* label = new QLabel(i18n("&Source name: "), widget);
+ TQLabel* label = new TQLabel(i18n("&Source name: "), widget);
gl->addWidget(label, ++row, 0);
- QString w = i18n("The name identifies the data source and should be unique and informative.");
- QWhatsThis::add(label, w);
+ TQString w = i18n("The name identifies the data source and should be unique and informative.");
+ TQWhatsThis::add(label, w);
m_nameEdit = new KLineEdit(widget);
gl->addWidget(m_nameEdit, row, 1);
m_nameEdit->setFocus();
- QWhatsThis::add(m_nameEdit, w);
+ TQWhatsThis::add(m_nameEdit, w);
label->setBuddy(m_nameEdit);
- connect(m_nameEdit, SIGNAL(textChanged(const QString&)), SLOT(slotNameChanged(const QString&)));
+ connect(m_nameEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotNameChanged(const TQString&)));
if(m_newSource) {
- label = new QLabel(i18n("Source &type: "), widget);
+ label = new TQLabel(i18n("Source &type: "), widget);
} else {
// since the label doesn't have a buddy, we don't want an accel,
// but also want to reuse string we already have
- label = new QLabel(i18n("Source &type: ").remove('&'), widget);
+ label = new TQLabel(i18n("Source &type: ").remove('&'), widget);
}
gl->addWidget(label, ++row, 0);
w = i18n("Tellico supports several different data sources.");
- QWhatsThis::add(label, w);
+ TQWhatsThis::add(label, w);
if(m_newSource) {
m_typeCombo = new GUI::ComboBox(widget);
gl->addWidget(m_typeCombo, row, 1);
- QWhatsThis::add(m_typeCombo, w);
+ TQWhatsThis::add(m_typeCombo, w);
label->setBuddy(m_typeCombo);
} else {
m_typeCombo = 0;
- QLabel* lab = new QLabel(Fetch::Manager::typeName(type_), widget);
+ TQLabel* lab = new TQLabel(Fetch::Manager::typeName(type_), widget);
gl->addWidget(lab, row, 1);
- QWhatsThis::add(lab, w);
+ TQWhatsThis::add(lab, w);
}
- m_cbOverwrite = new QCheckBox(i18n("Updating from source should overwrite user data"), widget);
+ m_cbOverwrite = new TQCheckBox(i18n("Updating from source should overwrite user data"), widget);
++row;
gl->addMultiCellWidget(m_cbOverwrite, row, row, 0, 1);
w = i18n("If checked, updating entries will overwrite any existing information.");
- QWhatsThis::add(m_cbOverwrite, w);
+ TQWhatsThis::add(m_cbOverwrite, w);
if(m_newSource) {
- m_stack = new QWidgetStack(widget);
+ m_stack = new TQWidgetStack(widget);
vlay2->addWidget(m_stack);
- connect(m_typeCombo, SIGNAL(activated(int)), SLOT(slotNewSourceSelected(int)));
+ connect(m_typeCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotNewSourceSelected(int)));
int z3950_idx = 0;
const Fetch::TypePairList typeList = Fetch::Manager::self()->typeList();
@@ -139,15 +139,15 @@ void FetcherConfigDialog::init(Fetch::Type type_) {
} else {
m_stack = 0;
// just add config widget and reparent
- m_configWidget->reparent(widget, QPoint());
+ m_configWidget->reparent(widget, TQPoint());
vlay2->addWidget(m_configWidget);
- connect(m_configWidget, SIGNAL(signalName(const QString&)), SLOT(slotPossibleNewName(const QString&)));
+ connect(m_configWidget, TQT_SIGNAL(signalName(const TQString&)), TQT_SLOT(slotPossibleNewName(const TQString&)));
}
setMainWidget(widget);
}
-QString FetcherConfigDialog::sourceName() const {
+TQString FetcherConfigDialog::sourceName() const {
return m_nameEdit->text();
}
@@ -200,18 +200,18 @@ void FetcherConfigDialog::slotNewSourceSelected(int idx_) {
slotNewSourceSelected(0);
return;
}
- connect(cw, SIGNAL(signalName(const QString&)), SLOT(slotPossibleNewName(const QString&)));
+ connect(cw, TQT_SIGNAL(signalName(const TQString&)), TQT_SLOT(slotPossibleNewName(const TQString&)));
m_configWidgets.insert(idx_, cw);
m_stack->addWidget(cw);
m_stack->raiseWidget(cw);
slotPossibleNewName(cw->preferredName());
}
-void FetcherConfigDialog::slotNameChanged(const QString&) {
+void FetcherConfigDialog::slotNameChanged(const TQString&) {
m_useDefaultName = false;
}
-void FetcherConfigDialog::slotPossibleNewName(const QString& name_) {
+void FetcherConfigDialog::slotPossibleNewName(const TQString& name_) {
if(name_.isEmpty()) {
return;
}
diff --git a/src/fetcherconfigdialog.h b/src/fetcherconfigdialog.h
index 6384102..5150c29 100644
--- a/src/fetcherconfigdialog.h
+++ b/src/fetcherconfigdialog.h
@@ -19,11 +19,11 @@
#include <kdialogbase.h>
-#include <qintdict.h>
+#include <tqintdict.h>
class KLineEdit;
-class QCheckBox;
-class QWidgetStack;
+class TQCheckBox;
+class TQWidgetStack;
namespace Tellico {
namespace GUI {
@@ -35,21 +35,22 @@ namespace Tellico {
*/
class FetcherConfigDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- FetcherConfigDialog(QWidget* parent);
- FetcherConfigDialog(const QString& sourceName, Fetch::Type type, bool updateOverwrite,
- Fetch::ConfigWidget* configWidget, QWidget* parent);
+ FetcherConfigDialog(TQWidget* tqparent);
+ FetcherConfigDialog(const TQString& sourceName, Fetch::Type type, bool updateOverwrite,
+ Fetch::ConfigWidget* configWidget, TQWidget* tqparent);
- QString sourceName() const;
+ TQString sourceName() const;
Fetch::Type sourceType() const;
bool updateOverwrite() const;
Fetch::ConfigWidget* configWidget() const;
private slots:
void slotNewSourceSelected(int idx);
- void slotNameChanged(const QString& name);
- void slotPossibleNewName(const QString& name);
+ void slotNameChanged(const TQString& name);
+ void slotPossibleNewName(const TQString& name);
private:
void init(Fetch::Type type);
@@ -57,12 +58,12 @@ private:
bool m_newSource : 1;
bool m_useDefaultName : 1;
Fetch::ConfigWidget* m_configWidget;
- QLabel* m_iconLabel;
+ TQLabel* m_iconLabel;
KLineEdit* m_nameEdit;
GUI::ComboBox* m_typeCombo;
- QCheckBox* m_cbOverwrite;
- QWidgetStack* m_stack;
- QIntDict<Fetch::ConfigWidget> m_configWidgets;
+ TQCheckBox* m_cbOverwrite;
+ TQWidgetStack* m_stack;
+ TQIntDict<Fetch::ConfigWidget> m_configWidgets;
};
} // end namespace
diff --git a/src/field.cpp b/src/field.cpp
index 206062a..a5ab6a6 100644
--- a/src/field.cpp
+++ b/src/field.cpp
@@ -21,22 +21,22 @@
#include <klocale.h>
#include <kglobal.h>
-#include <qstringlist.h>
-#include <qregexp.h>
-#include <qdatetime.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
+#include <tqdatetime.h>
namespace {
- static const QRegExp comma_split = QRegExp(QString::fromLatin1("\\s*,\\s*"));
+ static const TQRegExp comma_split = TQRegExp(TQString::tqfromLatin1("\\s*,\\s*"));
}
using Tellico::Data::Field;
//these get overwritten, but are here since they're static
-QStringList Field::s_articlesApos;
-QRegExp Field::s_delimiter = QRegExp(QString::fromLatin1("\\s*;\\s*"));
+TQStringList Field::s_articlesApos;
+TQRegExp Field::s_delimiter = TQRegExp(TQString::tqfromLatin1("\\s*;\\s*"));
// this constructor is for anything but Choice type
-Field::Field(const QString& name_, const QString& title_, Type type_/*=Line*/)
+Field::Field(const TQString& name_, const TQString& title_, Type type_/*=Line*/)
: KShared(), m_name(name_), m_title(title_), m_category(i18n("General")), m_desc(title_),
m_type(type_), m_flags(0), m_formatFlag(FormatNone) {
@@ -54,21 +54,21 @@ Field::Field(const QString& name_, const QString& title_, Type type_/*=Line*/)
m_flags = AllowMultiple;
if(m_type == Table2) {
m_type = Table;
- setProperty(QString::fromLatin1("columns"), QChar('2'));
+ setProperty(TQString::tqfromLatin1("columns"), TQChar('2'));
} else {
- setProperty(QString::fromLatin1("columns"), QChar('1'));
+ setProperty(TQString::tqfromLatin1("columns"), TQChar('1'));
}
} else if(m_type == Date) { // hidden from user
m_formatFlag = FormatDate;
} else if(m_type == Rating) {
- setProperty(QString::fromLatin1("minimum"), QChar('1'));
- setProperty(QString::fromLatin1("maximum"), QChar('5'));
+ setProperty(TQString::tqfromLatin1("minimum"), TQChar('1'));
+ setProperty(TQString::tqfromLatin1("maximum"), TQChar('5'));
}
m_id = getID();
}
// if this constructor is called, the type is necessarily Choice
-Field::Field(const QString& name_, const QString& title_, const QStringList& allowed_)
+Field::Field(const TQString& name_, const TQString& title_, const TQStringList& allowed_)
: KShared(), m_name(name_), m_title(title_), m_category(i18n("General")), m_desc(title_),
m_type(Field::Choice), m_allowed(allowed_), m_flags(0), m_formatFlag(FormatNone) {
m_id = getID();
@@ -83,7 +83,7 @@ Field::Field(const Field& field_)
m_allowed = field_.allowed();
} else if(m_type == Table2) {
m_type = Table;
- setProperty(QString::fromLatin1("columns"), QChar('2'));
+ setProperty(TQString::tqfromLatin1("columns"), TQChar('2'));
}
m_id = getID();
}
@@ -101,7 +101,7 @@ Field& Field::operator=(const Field& field_) {
m_allowed = field_.allowed();
} else if(m_type == Table2) {
m_type = Table;
- setProperty(QString::fromLatin1("columns"), QChar('2'));
+ setProperty(TQString::tqfromLatin1("columns"), TQChar('2'));
}
m_flags = field_.flags();
m_formatFlag = field_.formatFlag();
@@ -113,7 +113,7 @@ Field& Field::operator=(const Field& field_) {
Field::~Field() {
}
-void Field::setTitle(const QString& title_) {
+void Field::setTitle(const TQString& title_) {
m_title = title_;
if(isSingleCategory()) {
m_category = title_;
@@ -123,16 +123,16 @@ void Field::setTitle(const QString& title_) {
void Field::setType(Field::Type type_) {
m_type = type_;
if(m_type != Field::Choice) {
- m_allowed = QStringList();
+ m_allowed = TQStringList();
}
if(m_type == Table || m_type == Table2) {
m_flags |= AllowMultiple;
if(m_type == Table2) {
m_type = Table;
- setProperty(QString::fromLatin1("columns"), QChar('2'));
+ setProperty(TQString::tqfromLatin1("columns"), TQChar('2'));
}
- if(property(QString::fromLatin1("columns")).isEmpty()) {
- setProperty(QString::fromLatin1("columns"), QChar('1'));
+ if(property(TQString::tqfromLatin1("columns")).isEmpty()) {
+ setProperty(TQString::tqfromLatin1("columns"), TQChar('1'));
}
}
if(isSingleCategory()) {
@@ -144,7 +144,7 @@ void Field::setType(Field::Type type_) {
}
}
-void Field::setCategory(const QString& category_) {
+void Field::setCategory(const TQString& category_) {
if(!isSingleCategory()) {
m_category = category_;
}
@@ -166,13 +166,13 @@ void Field::setFormatFlag(FormatFlag flag_) {
}
}
-const QString& Field::defaultValue() const {
- return property(QString::fromLatin1("default"));
+const TQString& Field::defaultValue() const {
+ return property(TQString::tqfromLatin1("default"));
}
-void Field::setDefaultValue(const QString& value_) {
- if(m_type != Choice || m_allowed.findIndex(value_) > -1) {
- setProperty(QString::fromLatin1("default"), value_);
+void Field::setDefaultValue(const TQString& value_) {
+ if(m_type != Choice || m_allowed.tqfindIndex(value_) > -1) {
+ setProperty(TQString::tqfromLatin1("default"), value_);
}
}
@@ -187,9 +187,9 @@ Tellico::Data::FieldVec Field::dependsOn(CollPtr coll_) const {
return vec;
}
- const QStringList fieldNames = dependsOn();
+ const TQStringList fieldNames = dependsOn();
// do NOT call recursively!
- for(QStringList::ConstIterator it = fieldNames.begin(); it != fieldNames.end(); ++it) {
+ for(TQStringList::ConstIterator it = fieldNames.begin(); it != fieldNames.end(); ++it) {
FieldPtr field = coll_->fieldByName(*it);
if(!field) {
// allow the user to also use field titles
@@ -202,27 +202,27 @@ Tellico::Data::FieldVec Field::dependsOn(CollPtr coll_) const {
return vec;
}
-QStringList Field::dependsOn() const {
- QStringList list;
+TQStringList Field::dependsOn() const {
+ TQStringList list;
if(m_type != Dependent) {
return list;
}
- QRegExp rx(QString::fromLatin1("%\\{(.+)\\}"));
+ TQRegExp rx(TQString::tqfromLatin1("%\\{(.+)\\}"));
rx.setMinimal(true);
// do NOT call recursively!
- for(int pos = m_desc.find(rx); pos > -1; pos = m_desc.find(rx, pos+3)) {
+ for(int pos = m_desc.tqfind(rx); pos > -1; pos = m_desc.tqfind(rx, pos+3)) {
list << rx.cap(1);
}
return list;
}
-QString Field::format(const QString& value_, FormatFlag flag_) {
+TQString Field::format(const TQString& value_, FormatFlag flag_) {
if(value_.isEmpty()) {
return value_;
}
- QString text;
+ TQString text;
switch(flag_) {
case FormatTitle:
text = formatTitle(value_);
@@ -243,12 +243,12 @@ QString Field::format(const QString& value_, FormatFlag flag_) {
return text;
}
-QString Field::formatTitle(const QString& title_) {
- QString newTitle = title_;
+TQString Field::formatTitle(const TQString& title_) {
+ TQString newTitle = title_;
// special case for multi-column tables, assume user never has '::' in a value
- const QString colonColon = QString::fromLatin1("::");
- QString tail;
- if(newTitle.find(colonColon) > -1) {
+ const TQString colonColon = TQString::tqfromLatin1("::");
+ TQString tail;
+ if(newTitle.tqfind(colonColon) > -1) {
tail = colonColon + newTitle.section(colonColon, 1);
newTitle = newTitle.section(colonColon, 0, 0);
}
@@ -258,18 +258,18 @@ QString Field::formatTitle(const QString& title_) {
}
if(Config::autoFormat()) {
- const QString lower = newTitle.lower();
+ const TQString lower = newTitle.lower();
// TODO if the title has ",the" at the end, put it at the front
- const QStringList& articles = Config::articleList();
- for(QStringList::ConstIterator it = articles.begin(); it != articles.end(); ++it) {
+ const TQStringList& articles = Config::articleList();
+ for(TQStringList::ConstIterator it = articles.begin(); it != articles.end(); ++it) {
// assume white space is already stripped
// the articles are already in lower-case
- if(lower.startsWith(*it + QChar(' '))) {
- QRegExp regexp(QChar('^') + QRegExp::escape(*it) + QString::fromLatin1("\\s*"), false);
+ if(lower.startsWith(*it + TQChar(' '))) {
+ TQRegExp regexp(TQChar('^') + TQRegExp::escape(*it) + TQString::tqfromLatin1("\\s*"), false);
// can't just use *it since it's in lower-case
- QString article = newTitle.left((*it).length());
- newTitle = newTitle.replace(regexp, QString::null)
- .append(QString::fromLatin1(", "))
+ TQString article = newTitle.left((*it).length());
+ newTitle = newTitle.tqreplace(regexp, TQString())
+ .append(TQString::tqfromLatin1(", "))
.append(article);
break;
}
@@ -277,50 +277,50 @@ QString Field::formatTitle(const QString& title_) {
}
// also, arbitrarily impose rule that a space must follow every comma
- newTitle.replace(comma_split, QString::fromLatin1(", "));
+ newTitle.tqreplace(comma_split, TQString::tqfromLatin1(", "));
return newTitle + tail;
}
-QString Field::formatName(const QString& name_, bool multiple_/*=true*/) {
- static const QRegExp spaceComma(QString::fromLatin1("[\\s,]"));
- static const QString colonColon = QString::fromLatin1("::");
+TQString Field::formatName(const TQString& name_, bool multiple_/*=true*/) {
+ static const TQRegExp spaceComma(TQString::tqfromLatin1("[\\s,]"));
+ static const TQString colonColon = TQString::tqfromLatin1("::");
// the ending look-ahead is so that a space is not added at the end
- static const QRegExp periodSpace(QString::fromLatin1("\\.\\s*(?=.)"));
+ static const TQRegExp periodSpace(TQString::tqfromLatin1("\\.\\s*(?=.)"));
- QStringList entries;
+ TQStringList entries;
if(multiple_) {
// split by semi-colon, optionally preceded or followed by white spacee
- entries = QStringList::split(s_delimiter, name_, false);
+ entries = TQStringList::split(s_delimiter, name_, false);
} else {
entries << name_;
}
- QRegExp lastWord;
+ TQRegExp lastWord;
lastWord.setCaseSensitive(false);
- QStringList names;
- for(QStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it) {
- QString name = *it;
+ TQStringList names;
+ for(TQStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it) {
+ TQString name = *it;
// special case for 2-column tables, assume user never has '::' in a value
- QString tail;
- if(name.find(colonColon) > -1) {
+ TQString tail;
+ if(name.tqfind(colonColon) > -1) {
tail = colonColon + name.section(colonColon, 1);
name = name.section(colonColon, 0, 0);
}
- name.replace(periodSpace, QString::fromLatin1(". "));
+ name.tqreplace(periodSpace, TQString::tqfromLatin1(". "));
if(Config::autoCapitalization()) {
name = capitalize(name);
}
// split the name by white space and commas
- QStringList words = QStringList::split(spaceComma, name, false);
- lastWord.setPattern(QChar('^') + QRegExp::escape(words.last()) + QChar('$'));
+ TQStringList words = TQStringList::split(spaceComma, name, false);
+ lastWord.setPattern(TQChar('^') + TQRegExp::escape(words.last()) + TQChar('$'));
// if it contains a comma already and the last word is not a suffix, don't format it
- if(!Config::autoFormat() || (name.find(',') > -1 && Config::nameSuffixList().grep(lastWord).isEmpty())) {
+ if(!Config::autoFormat() || (name.tqfind(',') > -1 && Config::nameSuffixList().grep(lastWord).isEmpty())) {
// arbitrarily impose rule that no spaces before a comma and
// a single space after every comma
- name.replace(comma_split, QString::fromLatin1(", "));
+ name.tqreplace(comma_split, TQString::tqfromLatin1(", "));
names << name + tail;
continue;
}
@@ -329,48 +329,48 @@ QString Field::formatName(const QString& name_, bool multiple_/*=true*/) {
if(words.count() > 1) {
// if the last word is a suffix, it has to be kept with last name
if(Config::nameSuffixList().grep(lastWord).count() > 0) {
- words.prepend(words.last().append(QChar(',')));
+ words.prepend(words.last().append(TQChar(',')));
words.remove(words.fromLast());
}
// now move the word
// adding comma here when there had been a suffix is because it was originally split with space or comma
- words.prepend(words.last().append(QChar(',')));
+ words.prepend(words.last().append(TQChar(',')));
words.remove(words.fromLast());
// update last word regexp
- lastWord.setPattern(QChar('^') + QRegExp::escape(words.last()) + QChar('$'));
+ lastWord.setPattern(TQChar('^') + TQRegExp::escape(words.last()) + TQChar('$'));
// this is probably just something for me, limited to english
while(Config::surnamePrefixList().grep(lastWord).count() > 0) {
words.prepend(words.last());
words.remove(words.fromLast());
- lastWord.setPattern(QChar('^') + QRegExp::escape(words.last()) + QChar('$'));
+ lastWord.setPattern(TQChar('^') + TQRegExp::escape(words.last()) + TQChar('$'));
}
- names << words.join(QChar(' ')) + tail;
+ names << words.join(TQChar(' ')) + tail;
} else {
names << name + tail;
}
}
- return names.join(QString::fromLatin1("; "));
+ return names.join(TQString::tqfromLatin1("; "));
}
-QString Field::formatDate(const QString& date_) {
+TQString Field::formatDate(const TQString& date_) {
// internally, this is "year-month-day"
// any of the three may be empty
// if they're not digits, return the original string
bool empty = true;
// for empty year, use current
// for empty month or date, use 1
- QStringList s = QStringList::split('-', date_, true);
+ TQStringList s = TQStringList::split('-', date_, true);
bool ok = true;
- int y = s.count() > 0 ? s[0].toInt(&ok) : QDate::currentDate().year();
+ int y = s.count() > 0 ? s[0].toInt(&ok) : TQDate::tqcurrentDate().year();
if(ok) {
empty = false;
} else {
- y = QDate::currentDate().year();
+ y = TQDate::tqcurrentDate().year();
}
int m = s.count() > 1 ? s[1].toInt(&ok) : 1;
if(ok) {
@@ -385,86 +385,86 @@ QString Field::formatDate(const QString& date_) {
d = 1;
}
// rather use ISO date formatting than locale formatting for now. Primarily, it makes sorting just work.
- return empty ? date_ : QDate(y, m, d).toString(Qt::ISODate);
+ return empty ? date_ : TQString(TQDate(y, m, d).toString(Qt::ISODate));
// use short form
// return KGlobal::locale()->formatDate(date, true);
}
-QString Field::capitalize(QString str_) {
+TQString Field::capitalize(TQString str_) {
// regexp to split words
- static const QRegExp rx(QString::fromLatin1("[-\\s,.;]"));
+ static const TQRegExp rx(TQString::tqfromLatin1("[-\\s,.;]"));
if(str_.isEmpty()) {
return str_;
}
// first letter is always capitalized
- str_.replace(0, 1, str_.at(0).upper());
+ str_.tqreplace(0, 1, str_.tqat(0).upper());
// special case for french words like l'espace
- int pos = str_.find(rx, 1);
+ int pos = str_.tqfind(rx, 1);
int nextPos;
- QRegExp wordRx;
+ TQRegExp wordRx;
wordRx.setCaseSensitive(false);
- QStringList notCap = Config::noCapitalizationList();
+ TQStringList notCap = Config::noCapitalizationList();
// don't capitalize the surname prefixes
// does this hold true everywhere other than english?
notCap += Config::surnamePrefixList();
- QString word = str_.mid(0, pos);
+ TQString word = str_.mid(0, pos);
// now check to see if words starts with apostrophe list
- for(QStringList::ConstIterator it = s_articlesApos.begin(); it != s_articlesApos.end(); ++it) {
+ for(TQStringList::ConstIterator it = s_articlesApos.begin(); it != s_articlesApos.end(); ++it) {
if(word.lower().startsWith(*it)) {
uint l = (*it).length();
- str_.replace(l, 1, str_.at(l).upper());
+ str_.tqreplace(l, 1, str_.tqat(l).upper());
break;
}
}
while(pos > -1) {
// also need to compare against list of non-capitalized words
- nextPos = str_.find(rx, pos+1);
+ nextPos = str_.tqfind(rx, pos+1);
if(nextPos == -1) {
nextPos = str_.length();
}
word = str_.mid(pos+1, nextPos-pos-1);
bool aposMatch = false;
// now check to see if words starts with apostrophe list
- for(QStringList::ConstIterator it = s_articlesApos.begin(); it != s_articlesApos.end(); ++it) {
+ for(TQStringList::ConstIterator it = s_articlesApos.begin(); it != s_articlesApos.end(); ++it) {
if(word.lower().startsWith(*it)) {
uint l = (*it).length();
- str_.replace(pos+l+1, 1, str_.at(pos+l+1).upper());
+ str_.tqreplace(pos+l+1, 1, str_.tqat(pos+l+1).upper());
aposMatch = true;
break;
}
}
if(!aposMatch) {
- wordRx.setPattern(QChar('^') + QRegExp::escape(word) + QChar('$'));
+ wordRx.setPattern(TQChar('^') + TQRegExp::escape(word) + TQChar('$'));
if(notCap.grep(wordRx).isEmpty() && nextPos-pos > 1) {
- str_.replace(pos+1, 1, str_.at(pos+1).upper());
+ str_.tqreplace(pos+1, 1, str_.tqat(pos+1).upper());
}
}
- pos = str_.find(rx, pos+1);
+ pos = str_.tqfind(rx, pos+1);
}
return str_;
}
-QString Field::sortKeyTitle(const QString& title_) {
- const QString lower = title_.lower();
- const QStringList& articles = Config::articleList();
- for(QStringList::ConstIterator it = articles.begin(); it != articles.end(); ++it) {
+TQString Field::sortKeyTitle(const TQString& title_) {
+ const TQString lower = title_.lower();
+ const TQStringList& articles = Config::articleList();
+ for(TQStringList::ConstIterator it = articles.begin(); it != articles.end(); ++it) {
// assume white space is already stripped
// the articles are already in lower-case
- if(lower.startsWith(*it + QChar(' '))) {
+ if(lower.startsWith(*it + TQChar(' '))) {
return title_.mid((*it).length() + 1);
}
}
// check apostrophes, too
- for(QStringList::ConstIterator it = s_articlesApos.begin(); it != s_articlesApos.end(); ++it) {
+ for(TQStringList::ConstIterator it = s_articlesApos.begin(); it != s_articlesApos.end(); ++it) {
if(lower.startsWith(*it)) {
return title_.mid((*it).length());
}
@@ -474,10 +474,10 @@ QString Field::sortKeyTitle(const QString& title_) {
// articles should all be in lower-case
void Field::articlesUpdated() {
- const QStringList articles = Config::articleList();
+ const TQStringList articles = Config::articleList();
s_articlesApos.clear();
- for(QStringList::ConstIterator it = articles.begin(); it != articles.end(); ++it) {
- if((*it).endsWith(QChar('\''))) {
+ for(TQStringList::ConstIterator it = articles.begin(); it != articles.end(); ++it) {
+ if((*it).endsWith(TQChar('\''))) {
s_articlesApos += (*it);
}
}
@@ -503,9 +503,9 @@ Field::FieldMap Field::typeMap() {
}
// just for formatting's sake
-QStringList Field::typeTitles() {
+TQStringList Field::typeTitles() {
const FieldMap& map = typeMap();
- QStringList list;
+ TQStringList list;
list.append(map[Field::Line]);
list.append(map[Field::Para]);
list.append(map[Field::Choice]);
@@ -520,20 +520,20 @@ QStringList Field::typeTitles() {
return list;
}
-QStringList Field::split(const QString& string_, bool allowEmpty_) {
- return string_.isEmpty() ? QStringList() : QStringList::split(s_delimiter, string_, allowEmpty_);
+TQStringList Field::split(const TQString& string_, bool allowEmpty_) {
+ return string_.isEmpty() ? TQStringList() : TQStringList::split(s_delimiter, string_, allowEmpty_);
}
-void Field::addAllowed(const QString& value_) {
+void Field::addAllowed(const TQString& value_) {
if(m_type != Choice) {
return;
}
- if(m_allowed.findIndex(value_) == -1) {
+ if(m_allowed.tqfindIndex(value_) == -1) {
m_allowed += value_;
}
}
-void Field::setProperty(const QString& key_, const QString& value_) {
+void Field::setProperty(const TQString& key_, const TQString& value_) {
m_properties.insert(key_, value_);
}
@@ -547,30 +547,30 @@ void Field::convertOldRating(Data::FieldPtr field_) {
}
if(field_->name() != Latin1Literal("rating")
- && field_->property(QString::fromLatin1("rating")) != Latin1Literal("true")) {
+ && field_->property(TQString::tqfromLatin1("rating")) != Latin1Literal("true")) {
return; // nothing to do
}
int min = 10;
int max = 1;
bool ok;
- const QStringList& allow = field_->allowed();
- for(QStringList::ConstIterator it = allow.begin(); it != allow.end(); ++it) {
+ const TQStringList& allow = field_->allowed();
+ for(TQStringList::ConstIterator it = allow.begin(); it != allow.end(); ++it) {
int n = Tellico::toUInt(*it, &ok);
if(!ok) {
return; // no need to convert
}
- min = QMIN(min, n);
- max = QMAX(max, n);
+ min = TQMIN(min, n);
+ max = TQMAX(max, n);
}
- max = QMIN(max, 10);
+ max = TQMIN(max, 10);
if(min >= max) {
min = 1;
max = 5;
}
- field_->setProperty(QString::fromLatin1("minimum"), QString::number(min));
- field_->setProperty(QString::fromLatin1("maximum"), QString::number(max));
- field_->setProperty(QString::fromLatin1("rating"), QString::null);
+ field_->setProperty(TQString::tqfromLatin1("minimum"), TQString::number(min));
+ field_->setProperty(TQString::tqfromLatin1("maximum"), TQString::number(max));
+ field_->setProperty(TQString::tqfromLatin1("rating"), TQString());
field_->setType(Rating);
}
@@ -580,15 +580,15 @@ long Field::getID() {
return ++id;
}
-void Field::stripArticles(QString& value) {
- const QStringList articles = Config::articleList();
+void Field::stripArticles(TQString& value) {
+ const TQStringList articles = Config::articleList();
if(articles.isEmpty()) {
return;
}
- for(QStringList::ConstIterator it = articles.begin(); it != articles.end(); ++it) {
- QRegExp rx(QString::fromLatin1("\\b") + *it + QString::fromLatin1("\\b"));
+ for(TQStringList::ConstIterator it = articles.begin(); it != articles.end(); ++it) {
+ TQRegExp rx(TQString::tqfromLatin1("\\b") + *it + TQString::tqfromLatin1("\\b"));
value.remove(rx);
}
value = value.stripWhiteSpace();
- value.remove(QRegExp(QString::fromLatin1(",$")));
+ value.remove(TQRegExp(TQString::tqfromLatin1(",$")));
}
diff --git a/src/field.h b/src/field.h
index c9f00da..653b466 100644
--- a/src/field.h
+++ b/src/field.h
@@ -16,9 +16,9 @@
#include "datavectors.h"
-#include <qstringlist.h>
-#include <qstring.h>
-#include <qregexp.h>
+#include <tqstringlist.h>
+#include <tqstring.h>
+#include <tqregexp.h>
namespace Tellico {
namespace Data {
@@ -35,21 +35,21 @@ class Field : public KShared {
public:
/**
* The possible field types. A Line is represented by a KLineEdit,
- * a Para is a QMultiLineEdit encompassing multiple lines, a Choice is
+ * a Para is a TQMultiLineEdit encompassing multiple lines, a Choice is
* limited to set values shown in a KComboBox, and a Bool is either true
- * or not and is thus a QCheckBox. A Number type is an integer, though it used
+ * or not and is thus a TQCheckBox. A Number type is an integer, though it used
* to be a Year. A ReadOnly is a hidden value. A URL is obvious, too.
* A Table looks like a small spreadsheet with one column, and a Table2
- * type has two columns. An Image points to a QImage. A Dependent field
+ * type has two columns. An Image points to a TQImage. A Dependent field
* depends on the values of other attributes. A Date contains a date.
*
* Don't forget to change Field::typeMap().
*
* @see KLineEdit
- * @see QTextEdit
+ * @see TQTextEdit
* @see KComboBox
- * @see QCheckBox
- * @see QTable
+ * @see TQCheckBox
+ * @see TQTable
**/
enum Type {
Undef = 0,
@@ -70,7 +70,7 @@ public:
// if you add your own field type, best to start at a high number
// say 100, to ensure uniqueness
};
- typedef QMap<Field::Type, QString> FieldMap;
+ typedef TQMap<Field::Type, TQString> FieldMap;
/**
* The field flags. The properties should be bit-wise OR'd together.
@@ -114,7 +114,7 @@ public:
* @param title The field title
* @param type The field type
*/
- Field(const QString& name, const QString& title, Type type = Line);
+ Field(const TQString& name, const TQString& title, Type type = Line);
/**
* The constructor for Choice types attributes.
* By default, the field category is set to "General", and should be modified
@@ -124,7 +124,7 @@ public:
* @param title The field title
* @param allowed The allowed values of the field
*/
- Field(const QString& name, const QString& title, const QStringList& allowed);
+ Field(const TQString& name, const TQString& title, const TQStringList& allowed);
/**
* The copy constructor
*/
@@ -149,56 +149,56 @@ public:
*
* @return The field name
*/
- const QString& name() const { return m_name; }
+ const TQString& name() const { return m_name; }
/**
* Sets the name of the field. This should only be changed before the field is added
* to a collection, i.e. before any entries use it, etc.
*
* @param name The field name
*/
- void setName(const QString& name) { m_name = name; }
+ void setName(const TQString& name) { m_name = name; }
/**
* Returns the title of the field.
*
* @return The field title
*/
- const QString& title() const { return m_title; }
+ const TQString& title() const { return m_title; }
/**
* Sets the title of the field.
*
* @param title The field title
*/
- void setTitle(const QString& title);
+ void setTitle(const TQString& title);
/**
* Returns the category of the field.
*
* @return The field category
*/
- const QString& category() const { return m_category; }
+ const TQString& category() const { return m_category; }
/**
* Sets the category of the field.
*
* @param category The field category
*/
- void setCategory(const QString& category);
+ void setCategory(const TQString& category);
/**
* Returns the name of the field.
*
* @return The field name
*/
- const QStringList& allowed() const { return m_allowed; }
+ const TQStringList& allowed() const { return m_allowed; }
/**
* Sets the allowed values of the field.
*
* @param allowed The allowed values
*/
- void setAllowed(const QStringList& allowed) { m_allowed = allowed; }
+ void setAllowed(const TQStringList& allowed) { m_allowed = allowed; }
/**
* Add a value to the allowed list
*
* @param value The value to allow
*/
- void addAllowed(const QString& value);
+ void addAllowed(const TQString& value);
/**
* Returns the type of the field.
*
@@ -241,25 +241,25 @@ public:
*
* @return The field description
*/
- const QString& description() const { return m_desc; }
+ const TQString& description() const { return m_desc; }
/**
* Sets the description of the field.
*
* @param desc The field description
*/
- void setDescription(const QString& desc) { m_desc = desc; }
+ void setDescription(const TQString& desc) { m_desc = desc; }
/**
* Returns the default value for the field.
*
* @return The field default value
*/
- const QString& defaultValue() const;
+ const TQString& defaultValue() const;
/**
* Sets the default value of the field.
*
* @param value The field default value
*/
- void setDefaultValue(const QString& value);
+ void setDefaultValue(const TQString& value);
/**
* Some attributes are always a category by themselves.
*
@@ -272,7 +272,7 @@ public:
* @param key The property key
* @param value The property value
*/
- void setProperty(const QString& key, const QString& value);
+ void setProperty(const TQString& key, const TQString& value);
/**
* Sets all the extended properties. Any existing ones get erased.
*
@@ -285,7 +285,7 @@ public:
* @param key The property key
* @returnThe property value
*/
- const QString& property(const QString& key) const { return m_properties[key]; }
+ const TQString& property(const TQString& key) const { return m_properties[key]; }
/**
* Return the list of properties.
*
@@ -297,7 +297,7 @@ public:
* Returns an empty vector for non-Dpendent fields
*/
FieldVec dependsOn(CollPtr coll) const;
- QStringList dependsOn() const;
+ TQStringList dependsOn() const;
/*************************** STATIC **********************************/
@@ -305,7 +305,7 @@ public:
* A wrapper method around all the format functions. The flags
* determine which is called on the string.
*/
- static QString format(const QString& value, FormatFlag flag);
+ static TQString format(const TQString& value, FormatFlag flag);
/**
* A convenience function to format a string as a title.
* At the moment, this means that some articles such as "the" are placed
@@ -313,7 +313,7 @@ public:
*
* @param title The string to be formatted
*/
- static QString formatTitle(const QString& title);
+ static TQString formatTitle(const TQString& title);
/**
* A convenience function to format a string as a personal name.
* At the moment, this means that the name is split at the last white space,
@@ -324,23 +324,23 @@ public:
* @param name The string to be formatted
* @param multiple A boolean indicating if the string can contain multiple values
*/
- static QString formatName(const QString& name, bool multiple=true);
+ static TQString formatName(const TQString& name, bool multiple=true);
/**
* A convenience function to format a string as a date.
*
* @param date The string to be formatted
*/
- static QString formatDate(const QString& date);
+ static TQString formatDate(const TQString& date);
/**
* Helper method to fix capitalization.
*
* @param str String to fix
*/
- static QString capitalize(QString str);
+ static TQString capitalize(TQString str);
/**
* Return the key to be used for sorting titles
*/
- static QString sortKeyTitle(const QString& title);
+ static TQString sortKeyTitle(const TQString& title);
/**
* Returns a mapping of the FieldType enum to translated titles for the types.
*/
@@ -348,23 +348,23 @@ public:
/**
* Returns a list of the titles of the field types.
*/
- static QStringList typeTitles();
+ static TQStringList typeTitles();
/**
* Splits a string into multiple values;
*
* @param string The string to be split
*/
- static QStringList split(const QString& string, bool allowEmpty);
+ static TQStringList split(const TQString& string, bool allowEmpty);
/**
* Returns the delimiter used to split field values
*
* @return The delimeter regexp
*/
- static const QRegExp& delimiter() { return s_delimiter; }
+ static const TQRegExp& delimiter() { return s_delimiter; }
/**
* reset if the field is a rating field used for syntax version 7 and earlier */
static void convertOldRating(Data::FieldPtr field);
- static void stripArticles(QString& value);
+ static void stripArticles(TQString& value);
static void articlesUpdated();
private:
@@ -375,19 +375,19 @@ private:
static long getID();
long m_id;
- QString m_name;
- QString m_title;
- QString m_category;
- QString m_desc;
+ TQString m_name;
+ TQString m_title;
+ TQString m_category;
+ TQString m_desc;
Type m_type;
- QStringList m_allowed;
+ TQStringList m_allowed;
int m_flags;
FormatFlag m_formatFlag;
StringMap m_properties;
// need to remember articles with apostrophes for capitalization
- static QStringList s_articlesApos;
- static QRegExp s_delimiter;
+ static TQStringList s_articlesApos;
+ static TQRegExp s_delimiter;
};
} // end namespace
diff --git a/src/fieldcompletion.cpp b/src/fieldcompletion.cpp
index cfaf894..ecd208f 100644
--- a/src/fieldcompletion.cpp
+++ b/src/fieldcompletion.cpp
@@ -19,17 +19,17 @@ using Tellico::FieldCompletion;
FieldCompletion::FieldCompletion(bool multiple_) : KCompletion(), m_multiple(multiple_) {
}
-QString FieldCompletion::makeCompletion(const QString& string_) {
+TQString FieldCompletion::makeCompletion(const TQString& string_) {
if(completionMode() == KGlobalSettings::CompletionNone) {
m_beginText.truncate(0);
- return QString::null;
+ return TQString();
}
if(!m_multiple) {
return KCompletion::makeCompletion(string_);
}
- static QRegExp rx = Data::Field::delimiter();
+ static TQRegExp rx = Data::Field::delimiter();
int pos = rx.searchRev(string_);
if(pos == -1) {
m_beginText.truncate(0);
@@ -37,7 +37,7 @@ QString FieldCompletion::makeCompletion(const QString& string_) {
}
pos += rx.matchedLength();
- QString final = string_.mid(pos);
+ TQString final = string_.mid(pos);
m_beginText = string_.mid(0, pos);
return m_beginText + KCompletion::makeCompletion(final);
}
@@ -47,15 +47,15 @@ void FieldCompletion::clear() {
KCompletion::clear();
}
-void FieldCompletion::postProcessMatch(QString* match_) const {
+void FieldCompletion::postProcessMatch(TQString* match_) const {
if(m_multiple) {
match_->prepend(m_beginText);
}
}
-void FieldCompletion::postProcessMatches(QStringList* matches_) const {
+void FieldCompletion::postProcessMatches(TQStringList* matches_) const {
if(m_multiple) {
- for(QStringList::Iterator it = matches_->begin(); it != matches_->end(); ++it) {
+ for(TQStringList::Iterator it = matches_->begin(); it != matches_->end(); ++it) {
(*it).prepend(m_beginText);
}
}
diff --git a/src/fieldcompletion.h b/src/fieldcompletion.h
index 14296f3..3d79dfb 100644
--- a/src/fieldcompletion.h
+++ b/src/fieldcompletion.h
@@ -23,22 +23,23 @@ namespace Tellico {
*/
class FieldCompletion : public KCompletion {
Q_OBJECT
+ TQ_OBJECT
public:
FieldCompletion(bool multiple);
void setMultiple(bool m) { m_multiple = m; }
- virtual QString makeCompletion(const QString& string);
+ virtual TQString makeCompletion(const TQString& string);
virtual void clear();
protected:
- virtual void postProcessMatch(QString* match) const;
- virtual void postProcessMatches(QStringList* matches) const;
+ virtual void postProcessMatch(TQString* match) const;
+ virtual void postProcessMatches(TQStringList* matches) const;
virtual void postProcessMatches(KCompletionMatches* matches) const;
private:
bool m_multiple;
- QString m_beginText;
+ TQString m_beginText;
};
} // end namespace
diff --git a/src/filehandler.cpp b/src/filehandler.cpp
index ce5501a..900257a 100644
--- a/src/filehandler.cpp
+++ b/src/filehandler.cpp
@@ -30,16 +30,16 @@
#include <kio/chmodjob.h>
#include <kfilterdev.h>
-#include <qdom.h>
-#include <qfile.h>
+#include <tqdom.h>
+#include <tqfile.h>
using Tellico::FileHandler;
-class FileHandler::ItemDeleter : public QObject {
+class FileHandler::ItemDeleter : public TQObject {
public:
- ItemDeleter(KIO::Job* job, KFileItem* item) : QObject(), m_job(job), m_item(item) {
+ ItemDeleter(KIO::Job* job, KFileItem* item) : TQObject(), m_job(job), m_item(item) {
FileHandler::s_deleterList.append(this);
- connect(job, SIGNAL(result(KIO::Job*)), SLOT(deleteLater()));
+ connect(job, TQT_SIGNAL(result(KIO::Job*)), TQT_SLOT(deleteLater()));
}
~ItemDeleter() {
FileHandler::s_deleterList.removeRef(this);
@@ -47,11 +47,11 @@ public:
delete m_item; m_item = 0;
}
private:
- QGuardedPtr<KIO::Job> m_job;
+ TQGuardedPtr<KIO::Job> m_job;
KFileItem* m_item;
};
-QPtrList<FileHandler::ItemDeleter> FileHandler::s_deleterList;
+TQPtrList<FileHandler::ItemDeleter> FileHandler::s_deleterList;
FileHandler::FileRef::FileRef(const KURL& url_, bool quiet_, bool allowCompressed_) : m_device(0), m_isValid(false) {
if(url_.isEmpty()) {
@@ -60,18 +60,18 @@ FileHandler::FileRef::FileRef(const KURL& url_, bool quiet_, bool allowCompresse
if(!Tellico::NetAccess::download(url_, m_filename, Kernel::self()->widget())) {
myDebug() << "FileRef::FileRef() - can't download " << url_ << endl;
- QString s = KIO::NetAccess::lastErrorString();
+ TQString s = KIO::NetAccess::lastErrorString();
if(!s.isEmpty()) {
myDebug() << s << endl;
}
if(!quiet_) {
- Kernel::self()->sorry(i18n(errorLoad).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorLoad).tqarg(url_.fileName()));
}
return;
}
/*
- QFile* file = new QFile(m_filename);
+ TQFile* file = new TQFile(m_filename);
if(file->exists()) {
m_isValid = true;
m_device = file;
@@ -82,7 +82,7 @@ FileHandler::FileRef::FileRef(const KURL& url_, bool quiet_, bool allowCompresse
if(allowCompressed_) {
m_device = KFilterDev::deviceForFile(m_filename);
} else {
- m_device = new QFile(m_filename);
+ m_device = TQT_TQIODEVICE(new TQFile(m_filename));
}
m_isValid = true;
}
@@ -107,7 +107,7 @@ bool FileHandler::FileRef::open(bool quiet_) {
if(!quiet_) {
KURL u;
u.setPath(fileName());
- Kernel::self()->sorry(i18n(errorLoad).arg(u.fileName()));
+ Kernel::self()->sorry(i18n(errorLoad).tqarg(u.fileName()));
}
delete m_device;
m_device = 0;
@@ -121,52 +121,52 @@ FileHandler::FileRef* FileHandler::fileRef(const KURL& url_, bool quiet_) {
return new FileRef(url_, quiet_);
}
-QString FileHandler::readTextFile(const KURL& url_, bool quiet_/*=false*/, bool useUTF8_ /*false*/, bool compress_/*=false*/) {
+TQString FileHandler::readTextFile(const KURL& url_, bool quiet_/*=false*/, bool useUTF8_ /*false*/, bool compress_/*=false*/) {
FileRef f(url_, quiet_, compress_);
if(!f.isValid()) {
- return QString::null;
+ return TQString();
}
if(f.open(quiet_)) {
- QTextStream stream(f.file());
+ TQTextStream stream(f.file());
if(useUTF8_) {
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
}
return stream.read();
}
- return QString();
+ return TQString();
}
-QDomDocument FileHandler::readXMLFile(const KURL& url_, bool processNamespace_, bool quiet_) {
+TQDomDocument FileHandler::readXMLFile(const KURL& url_, bool processNamespace_, bool quiet_) {
FileRef f(url_, quiet_);
if(!f.isValid()) {
- return QDomDocument();
+ return TQDomDocument();
}
- QDomDocument doc;
- QString errorMsg;
+ TQDomDocument doc;
+ TQString errorMsg;
int errorLine, errorColumn;
if(!f.open(quiet_)) {
- return QDomDocument();
+ return TQDomDocument();
}
if(!doc.setContent(f.file(), processNamespace_, &errorMsg, &errorLine, &errorColumn)) {
if(!quiet_) {
- QString details = i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn);
- details += QString::fromLatin1("\n");
- details += i18n("The error message from Qt is:");
- details += QString::fromLatin1("\n\t") + errorMsg;
- GUI::CursorSaver cs(Qt::arrowCursor);
- KMessageBox::detailedSorry(Kernel::self()->widget(), i18n(errorLoad).arg(url_.fileName()), details);
+ TQString details = i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn);
+ details += TQString::tqfromLatin1("\n");
+ details += i18n("The error message from TQt is:");
+ details += TQString::tqfromLatin1("\n\t") + errorMsg;
+ GUI::CursorSaver cs(TQt::arrowCursor);
+ KMessageBox::detailedSorry(Kernel::self()->widget(), i18n(errorLoad).tqarg(url_.fileName()), details);
}
- return QDomDocument();
+ return TQDomDocument();
}
return doc;
}
-QByteArray FileHandler::readDataFile(const KURL& url_, bool quiet_) {
+TQByteArray FileHandler::readDataFile(const KURL& url_, bool quiet_) {
FileRef f(url_, quiet_);
if(!f.isValid()) {
- return QByteArray();
+ return TQByteArray();
}
f.open(quiet_);
@@ -184,11 +184,11 @@ Tellico::Data::Image* FileHandler::readImageFile(const KURL& url_, bool quiet_,
tmpFile.setAutoDelete(true);
KIO::Job* job = KIO::file_copy(url_, tmpURL, -1, true /* overwrite */);
- job->addMetaData(QString::fromLatin1("referrer"), referrer_.url());
+ job->addMetaData(TQString::tqfromLatin1("referrer"), referrer_.url());
if(!KIO::NetAccess::synchronousRun(job, Kernel::self()->widget())) {
if(!quiet_) {
- Kernel::self()->sorry(i18n(errorLoad).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorLoad).tqarg(url_.fileName()));
}
return 0;
}
@@ -203,7 +203,7 @@ Tellico::Data::Image* FileHandler::readImageFile(const KURL& url_, bool quiet_)
Data::Image* img = new Data::Image(f.fileName());
if(img->isNull() && !quiet_) {
- QString str = i18n("Tellico is unable to load the image - %1.").arg(url_.fileName());
+ TQString str = i18n("Tellico is unable to load the image - %1.").tqarg(url_.fileName());
Kernel::self()->sorry(str);
}
return img;
@@ -216,9 +216,9 @@ bool FileHandler::queryExists(const KURL& url_) {
// we always overwrite the current URL without asking
if(url_ != Kernel::self()->URL()) {
- GUI::CursorSaver cs(Qt::arrowCursor);
- QString str = i18n("A file named \"%1\" already exists. "
- "Are you sure you want to overwrite it?").arg(url_.fileName());
+ GUI::CursorSaver cs(TQt::arrowCursor);
+ TQString str = i18n("A file named \"%1\" already exists. "
+ "Are you sure you want to overwrite it?").tqarg(url_.fileName());
int want_continue = KMessageBox::warningContinueCancel(Kernel::self()->widget(), str,
i18n("Overwrite File?"),
i18n("Overwrite"));
@@ -229,7 +229,7 @@ bool FileHandler::queryExists(const KURL& url_) {
}
KURL backup(url_);
- backup.setPath(backup.path() + QString::fromLatin1("~"));
+ backup.setPath(backup.path() + TQString::tqfromLatin1("~"));
bool success = true;
if(url_.isLocalFile()) {
@@ -237,7 +237,7 @@ bool FileHandler::queryExists(const KURL& url_) {
// the user is always reset to the current user
KFileItemList list;
int perm = -1;
- QString grp;
+ TQString grp;
if(KIO::NetAccess::exists(url_, false, Kernel::self()->widget())) {
KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url_, true);
perm = item.permissions();
@@ -250,7 +250,7 @@ bool FileHandler::queryExists(const KURL& url_) {
success = KSaveFile::backupFile(url_.path());
if(!list.isEmpty()) {
// have to leave the user alone
- KIO::Job* job = KIO::chmod(list, perm, 0, QString(), grp, true, false);
+ KIO::Job* job = KIO::chmod(list, perm, 0, TQString(), grp, true, false);
new ItemDeleter(job, list.first());
}
} else {
@@ -259,12 +259,12 @@ bool FileHandler::queryExists(const KURL& url_) {
false /* resume */, Kernel::self()->widget());
}
if(!success) {
- Kernel::self()->sorry(i18n(errorWrite).arg(url_.fileName() + '~'));
+ Kernel::self()->sorry(i18n(errorWrite).tqarg(url_.fileName() + '~'));
}
return success;
}
-bool FileHandler::writeTextURL(const KURL& url_, const QString& text_, bool encodeUTF8_, bool force_, bool quiet_) {
+bool FileHandler::writeTextURL(const KURL& url_, const TQString& text_, bool encodeUTF8_, bool force_, bool quiet_) {
if((!force_ && !queryExists(url_)) || text_.isNull()) {
if(text_.isNull()) {
myDebug() << "FileHandler::writeTextURL() - null string for " << url_ << endl;
@@ -277,7 +277,7 @@ bool FileHandler::writeTextURL(const KURL& url_, const QString& text_, bool enco
// the user is always reset to the current user
KFileItemList list;
int perm = -1;
- QString grp;
+ TQString grp;
if(KIO::NetAccess::exists(url_, false, Kernel::self()->widget())) {
KFileItem* item = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, url_, true);
list.append(item);
@@ -288,14 +288,14 @@ bool FileHandler::writeTextURL(const KURL& url_, const QString& text_, bool enco
KSaveFile f(url_.path());
if(f.status() != 0) {
if(!quiet_) {
- Kernel::self()->sorry(i18n(errorWrite).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorWrite).tqarg(url_.fileName()));
}
return false;
}
bool success = FileHandler::writeTextFile(f, text_, encodeUTF8_);
if(!list.isEmpty()) {
// have to leave the user alone
- KIO::Job* job = KIO::chmod(list, perm, 0, QString(), grp, true, false);
+ KIO::Job* job = KIO::chmod(list, perm, 0, TQString(), grp, true, false);
new ItemDeleter(job, list.first());
}
return success;
@@ -307,7 +307,7 @@ bool FileHandler::writeTextURL(const KURL& url_, const QString& text_, bool enco
if(f.status() != 0) {
tempfile.unlink();
if(!quiet_) {
- Kernel::self()->sorry(i18n(errorWrite).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorWrite).tqarg(url_.fileName()));
}
return false;
}
@@ -318,7 +318,7 @@ bool FileHandler::writeTextURL(const KURL& url_, const QString& text_, bool enco
if(!uploaded) {
tempfile.unlink();
if(!quiet_) {
- Kernel::self()->sorry(i18n(errorUpload).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorUpload).tqarg(url_.fileName()));
}
success = false;
}
@@ -328,12 +328,12 @@ bool FileHandler::writeTextURL(const KURL& url_, const QString& text_, bool enco
return success;
}
-bool FileHandler::writeTextFile(KSaveFile& f_, const QString& text_, bool encodeUTF8_) {
- QTextStream* t = f_.textStream();
+bool FileHandler::writeTextFile(KSaveFile& f_, const TQString& text_, bool encodeUTF8_) {
+ TQTextStream* t = f_.textStream();
if(encodeUTF8_) {
- t->setEncoding(QTextStream::UnicodeUTF8);
+ t->setEncoding(TQTextStream::UnicodeUTF8);
} else {
- t->setEncoding(QTextStream::Locale);
+ t->setEncoding(TQTextStream::Locale);
}
// kdDebug() << "-----------------------------" << endl
// << text_ << endl
@@ -348,7 +348,7 @@ bool FileHandler::writeTextFile(KSaveFile& f_, const QString& text_, bool encode
return success;
}
-bool FileHandler::writeDataURL(const KURL& url_, const QByteArray& data_, bool force_, bool quiet_) {
+bool FileHandler::writeDataURL(const KURL& url_, const TQByteArray& data_, bool force_, bool quiet_) {
if(!force_ && !queryExists(url_)) {
return false;
}
@@ -358,7 +358,7 @@ bool FileHandler::writeDataURL(const KURL& url_, const QByteArray& data_, bool f
// the user is always reset to the current user
KFileItemList list;
int perm = -1;
- QString grp;
+ TQString grp;
if(KIO::NetAccess::exists(url_, false, Kernel::self()->widget())) {
KFileItem* item = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, url_, true);
list.append(item);
@@ -369,14 +369,14 @@ bool FileHandler::writeDataURL(const KURL& url_, const QByteArray& data_, bool f
KSaveFile f(url_.path());
if(f.status() != 0) {
if(!quiet_) {
- Kernel::self()->sorry(i18n(errorWrite).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorWrite).tqarg(url_.fileName()));
}
return false;
}
bool success = FileHandler::writeDataFile(f, data_);
if(!list.isEmpty()) {
// have to leave the user alone
- KIO::Job* job = KIO::chmod(list, perm, 0, QString(), grp, true, false);
+ KIO::Job* job = KIO::chmod(list, perm, 0, TQString(), grp, true, false);
new ItemDeleter(job, list.first());
}
return success;
@@ -387,7 +387,7 @@ bool FileHandler::writeDataURL(const KURL& url_, const QByteArray& data_, bool f
KSaveFile f(tempfile.name());
if(f.status() != 0) {
if(!quiet_) {
- Kernel::self()->sorry(i18n(errorWrite).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorWrite).tqarg(url_.fileName()));
}
return false;
}
@@ -396,7 +396,7 @@ bool FileHandler::writeDataURL(const KURL& url_, const QByteArray& data_, bool f
if(success) {
success = KIO::NetAccess::upload(tempfile.name(), url_, Kernel::self()->widget());
if(!success && !quiet_) {
- Kernel::self()->sorry(i18n(errorUpload).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorUpload).tqarg(url_.fileName()));
}
}
tempfile.unlink();
@@ -404,9 +404,9 @@ bool FileHandler::writeDataURL(const KURL& url_, const QByteArray& data_, bool f
return success;
}
-bool FileHandler::writeDataFile(KSaveFile& f_, const QByteArray& data_) {
+bool FileHandler::writeDataFile(KSaveFile& f_, const TQByteArray& data_) {
// myDebug() << "FileHandler::writeDataFile()" << endl;
- QDataStream* s = f_.dataStream();
+ TQDataStream* s = f_.dataStream();
s->writeRawBytes(data_.data(), data_.size());
return f_.close();
}
diff --git a/src/filehandler.h b/src/filehandler.h
index 9000478..d4c6af0 100644
--- a/src/filehandler.h
+++ b/src/filehandler.h
@@ -14,9 +14,9 @@
#ifndef FILEHANDLER_H
#define FILEHANDLER_H
-#include <qstring.h>
-#include <qcstring.h> // needed for QByteArray
-#include <qptrlist.h>
+#include <tqstring.h>
+#include <tqcstring.h> // needed for TQByteArray
+#include <tqptrlist.h>
class KURL;
class KSaveFile;
@@ -25,8 +25,8 @@ namespace KIO {
class Job;
}
-class QDomDocument;
-class QIODevice;
+class TQDomDocument;
+class TQIODevice;
namespace Tellico {
class ImageFactory;
@@ -51,16 +51,16 @@ public:
class FileRef {
public:
bool open(bool quiet=false);
- QIODevice* file() const { return m_device; }
- const QString& fileName() const { return m_filename; }
+ TQIODevice* file() const { return m_device; }
+ const TQString& fileName() const { return m_filename; }
bool isValid() const { return m_isValid; }
~FileRef();
private:
friend class FileHandler;
FileRef(const KURL& url, bool quiet=false, bool allowCompressed=false);
- QIODevice* m_device;
- QString m_filename;
+ TQIODevice* m_device;
+ TQString m_filename;
bool m_isValid;
};
friend class FileRef;
@@ -83,24 +83,24 @@ public:
* @param allowCompressed Whether to check if the file is compressed or not
* @return A string containing the contents of a file
*/
- static QString readTextFile(const KURL& url, bool quiet=false, bool useUTF8=false, bool allowCompressed=false);
+ static TQString readTextFile(const KURL& url, bool quiet=false, bool useUTF8=false, bool allowCompressed=false);
/**
- * Read contents of an XML file into a QDomDocument.
+ * Read contents of an XML file into a TQDomDocument.
*
* @param url The URL of the file
* @param processNamespace Whether to process the namespace of the XML file
* @param quiet Whether error messages should be shown
- * @return A QDomDocument containing the contents of a file
+ * @return A TQDomDocument containing the contents of a file
*/
- static QDomDocument readXMLFile(const KURL& url, bool processNamespace, bool quiet=false);
+ static TQDomDocument readXMLFile(const KURL& url, bool processNamespace, bool quiet=false);
/**
- * Read contents of a data file into a QByteArray.
+ * Read contents of a data file into a TQByteArray.
*
* @param url The URL of the file
* @param quiet Whether error messages should be shown
- * @return A QByteArray of the file's contents
+ * @return A TQByteArray of the file's contents
*/
- static QByteArray readDataFile(const KURL& url, bool quiet=false);
+ static TQByteArray readDataFile(const KURL& url, bool quiet=false);
/**
* Writes the contents of a string to a url. If the file already exists, a "~" is appended
* and the existing file is moved. If the file is remote, a temporary file is written and
@@ -112,7 +112,7 @@ public:
* @param force Whether to force the write
* @return A boolean indicating success
*/
- static bool writeTextURL(const KURL& url, const QString& text, bool encodeUTF8, bool force=false, bool quiet=false);
+ static bool writeTextURL(const KURL& url, const TQString& text, bool encodeUTF8, bool force=false, bool quiet=false);
/**
* Writes data to a url. If the file already exists, a "~" is appended
* and the existing file is moved. If the file is remote, a temporary file is written and
@@ -123,7 +123,7 @@ public:
* @param force Whether to force the write
* @return A boolean indicating success
*/
- static bool writeDataURL(const KURL& url, const QByteArray& data, bool force=false, bool quiet=false);
+ static bool writeDataURL(const KURL& url, const TQByteArray& data, bool force=false, bool quiet=false);
/**
* Checks to see if a URL exists already, and if so, queries the user.
*
@@ -136,7 +136,7 @@ public:
private:
class ItemDeleter;
friend class ItemDeleter;
- static QPtrList<ItemDeleter> s_deleterList;
+ static TQPtrList<ItemDeleter> s_deleterList;
/**
* Read contents of a file into an image. It's private since everything should use the
@@ -156,7 +156,7 @@ private:
* @param encodeUTF8 Whether to use UTF-8 encoding, or Locale
* @return A boolean indicating success
*/
- static bool writeTextFile(KSaveFile& file, const QString& text, bool encodeUTF8);
+ static bool writeTextFile(KSaveFile& file, const TQString& text, bool encodeUTF8);
/**
* Writes data to a file.
*
@@ -164,7 +164,7 @@ private:
* @param data The data
* @return A boolean indicating success
*/
- static bool writeDataFile(KSaveFile& file, const QByteArray& data);
+ static bool writeDataFile(KSaveFile& file, const TQByteArray& data);
};
} // end namespace
diff --git a/src/filter.cpp b/src/filter.cpp
index 9672937..1a0c67c 100644
--- a/src/filter.cpp
+++ b/src/filter.cpp
@@ -16,7 +16,7 @@
#include "tellico_debug.h"
-#include <qregexp.h>
+#include <tqregexp.h>
using Tellico::Filter;
using Tellico::FilterRule;
@@ -24,7 +24,7 @@ using Tellico::FilterRule;
FilterRule::FilterRule() : m_function(FuncEquals) {
}
-FilterRule::FilterRule(const QString& fieldName_, const QString& pattern_, Function func_)
+FilterRule::FilterRule(const TQString& fieldName_, const TQString& pattern_, Function func_)
: m_fieldName(fieldName_), m_function(func_), m_pattern(pattern_) {
}
@@ -35,9 +35,9 @@ bool FilterRule::matches(Data::EntryPtr entry_) const {
case FuncNotEquals:
return !equals(entry_);
case FuncContains:
- return contains(entry_);
+ return tqcontains(entry_);
case FuncNotContains:
- return !contains(entry_);
+ return !tqcontains(entry_);
case FuncRegExp:
return matchesRegExp(entry_);
case FuncNotRegExp:
@@ -52,52 +52,52 @@ bool FilterRule::matches(Data::EntryPtr entry_) const {
bool FilterRule::equals(Data::EntryPtr entry_) const {
// empty field name means search all
if(m_fieldName.isEmpty()) {
- QStringList list = entry_->fieldValues() + entry_->formattedFieldValues();
- for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
- if(QString::compare((*it).lower(), m_pattern.lower()) == 0) {
+ TQStringList list = entry_->fieldValues() + entry_->formattedFieldValues();
+ for(TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
+ if(TQString::compare((*it).lower(), m_pattern.lower()) == 0) {
return true;
}
}
} else {
- return QString::compare(entry_->field(m_fieldName).lower(), m_pattern.lower()) == 0
- || QString::compare(entry_->formattedField(m_fieldName).lower(), m_pattern.lower()) == 0;
+ return TQString::compare(entry_->field(m_fieldName).lower(), m_pattern.lower()) == 0
+ || TQString::compare(entry_->formattedField(m_fieldName).lower(), m_pattern.lower()) == 0;
}
return false;
}
-bool FilterRule::contains(Data::EntryPtr entry_) const {
+bool FilterRule::tqcontains(Data::EntryPtr entry_) const {
// empty field name means search all
if(m_fieldName.isEmpty()) {
- QStringList list = entry_->fieldValues() + entry_->formattedFieldValues();
+ TQStringList list = entry_->fieldValues() + entry_->formattedFieldValues();
// match is true if any strings match
- for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
- if((*it).find(m_pattern, 0, false) >= 0) {
+ for(TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
+ if((*it).tqfind(m_pattern, 0, false) >= 0) {
return true;
}
}
} else {
- return entry_->field(m_fieldName).find(m_pattern, 0, false) >= 0
- || entry_->formattedField(m_fieldName).find(m_pattern, 0, false) >= 0;
+ return entry_->field(m_fieldName).tqfind(m_pattern, 0, false) >= 0
+ || entry_->formattedField(m_fieldName).tqfind(m_pattern, 0, false) >= 0;
}
return false;
}
bool FilterRule::matchesRegExp(Data::EntryPtr entry_) const {
- QRegExp rx(m_pattern, false);
+ TQRegExp rx(m_pattern, false);
// empty field name means search all
if(m_fieldName.isEmpty()) {
- QStringList list = entry_->fieldValues() + entry_->formattedFieldValues();
- for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
- if((*it).find(rx) >= 0) {
+ TQStringList list = entry_->fieldValues() + entry_->formattedFieldValues();
+ for(TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
+ if((*it).tqfind(rx) >= 0) {
return true;
break;
}
}
} else {
- return entry_->field(m_fieldName).find(rx) >= 0
- || entry_->formattedField(m_fieldName).find(rx) >= 0;
+ return entry_->field(m_fieldName).tqfind(rx) >= 0
+ || entry_->formattedField(m_fieldName).tqfind(rx) >= 0;
}
return false;
@@ -106,8 +106,8 @@ bool FilterRule::matchesRegExp(Data::EntryPtr entry_) const {
/*******************************************************/
-Filter::Filter(const Filter& other_) : QPtrList<FilterRule>(), KShared(), m_op(other_.op()), m_name(other_.name()) {
- for(QPtrListIterator<FilterRule> it(other_); it.current(); ++it) {
+Filter::Filter(const Filter& other_) : TQPtrList<FilterRule>(), KShared(), m_op(other_.op()), m_name(other_.name()) {
+ for(TQPtrListIterator<FilterRule> it(other_); it.current(); ++it) {
append(new FilterRule(*it.current()));
}
setAutoDelete(true);
@@ -119,7 +119,7 @@ bool Filter::matches(Data::EntryPtr entry_) const {
}
bool match = false;
- for(QPtrListIterator<FilterRule> it(*this); it.current(); ++it) {
+ for(TQPtrListIterator<FilterRule> it(*this); it.current(); ++it) {
if(it.current()->matches(entry_)) {
if(m_op == Filter::MatchAny) {
return true;
diff --git a/src/filter.h b/src/filter.h
index 57997bf..d269c92 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -18,8 +18,8 @@
#include <ksharedptr.h>
-#include <qptrlist.h>
-#include <qstring.h>
+#include <tqptrlist.h>
+#include <tqstring.h>
namespace Tellico {
namespace Data {
@@ -44,7 +44,7 @@ public:
};
FilterRule();
- FilterRule(const QString& fieldName, const QString& text, Function func);
+ FilterRule(const TQString& fieldName, const TQString& text, Function func);
/**
* A rule is empty if the pattern text is empty
@@ -69,28 +69,28 @@ public:
/**
* Return field name
*/
- const QString& fieldName() const { return m_fieldName; }
+ const TQString& fieldName() const { return m_fieldName; }
/**
* Set field name
*/
- void setFieldName(const QString& fieldName) { m_fieldName = fieldName; }
+ void setFieldName(const TQString& fieldName) { m_fieldName = fieldName; }
/**
* Return pattern
*/
- const QString& pattern() const { return m_pattern; }
+ const TQString& pattern() const { return m_pattern; }
/**
* Set pattern
*/
-// void setPattern(const QString& pattern) { m_pattern = pattern; }
+// void setPattern(const TQString& pattern) { m_pattern = pattern; }
private:
bool equals(Data::EntryPtr entry) const;
- bool contains(Data::EntryPtr entry) const;
+ bool tqcontains(Data::EntryPtr entry) const;
bool matchesRegExp(Data::EntryPtr entry) const;
- QString m_fieldName;
+ TQString m_fieldName;
Function m_function;
- QString m_pattern;
+ TQString m_pattern;
};
/**
@@ -98,7 +98,7 @@ private:
*
* @author Robby Stephenson
*/
-class Filter : public QPtrList<FilterRule>, public KShared {
+class Filter : public TQPtrList<FilterRule>, public KShared {
public:
enum FilterOp {
@@ -107,23 +107,23 @@ public:
};
typedef KSharedPtr<Filter> Ptr;
- Filter(FilterOp op) : QPtrList<FilterRule>(), m_op(op) { setAutoDelete(true); }
+ Filter(FilterOp op) : TQPtrList<FilterRule>(), m_op(op) { setAutoDelete(true); }
Filter(const Filter& other);
void setMatch(FilterOp op) { m_op = op; }
FilterOp op() const { return m_op; }
bool matches(Data::EntryPtr entry) const;
- void setName(const QString& name) { m_name = name; }
- const QString& name() const { return m_name; }
+ void setName(const TQString& name) { m_name = name; }
+ const TQString& name() const { return m_name; }
- uint count() const { return QPtrList<FilterRule>::count(); } // disambiguate
+ uint count() const { return TQPtrList<FilterRule>::count(); } // disambiguate
private:
Filter& operator=(const Filter& other);
FilterOp m_op;
- QString m_name;
+ TQString m_name;
};
} // end namespace
diff --git a/src/filterdialog.cpp b/src/filterdialog.cpp
index ab65490..d2cecd8 100644
--- a/src/filterdialog.cpp
+++ b/src/filterdialog.cpp
@@ -11,7 +11,7 @@
* *
***************************************************************************/
-// The layout borrows heavily from kmsearchpatternedit.cpp in kmail
+// The tqlayout borrows heavily from kmsearchpatternedit.cpp in kmail
// which is authored by Marc Mutz <[email protected]> under the GPL
#include "filterdialog.h"
@@ -29,21 +29,21 @@
#include <kregexpeditorinterface.h>
#include <kiconloader.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qradiobutton.h>
-#include <qvbuttongroup.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qlabel.h>
-#include <qapplication.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqradiobutton.h>
+#include <tqvbuttongroup.h>
+#include <tqhbox.h>
+#include <tqvbox.h>
+#include <tqlabel.h>
+#include <tqapplication.h>
using Tellico::FilterRuleWidget;
using Tellico::FilterRuleWidgetLister;
using Tellico::FilterDialog;
-FilterRuleWidget::FilterRuleWidget(FilterRule* rule_, QWidget* parent_, const char* name_/*=0*/)
- : QHBox(parent_, name_), m_editRegExp(0), m_editRegExpDialog(0) {
+FilterRuleWidget::FilterRuleWidget(FilterRule* rule_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : TQHBox(tqparent_, name_), m_editRegExp(0), m_editRegExpDialog(0) {
initLists();
initWidget();
@@ -65,7 +65,7 @@ void FilterRuleWidget::initLists() {
if(m_ruleFuncList.isEmpty()) {
// also see FilterRule::matches() and FilterRule::Function
// if you change the following strings!
- m_ruleFuncList.append(i18n("contains"));
+ m_ruleFuncList.append(i18n("tqcontains"));
m_ruleFuncList.append(i18n("does not contain"));
m_ruleFuncList.append(i18n("equals"));
m_ruleFuncList.append(i18n("does not equal"));
@@ -78,18 +78,18 @@ void FilterRuleWidget::initWidget() {
setSpacing(4);
m_ruleField = new KComboBox(this);
- connect(m_ruleField, SIGNAL(activated(int)), SIGNAL(signalModified()));
- connect(m_ruleField, SIGNAL(activated(int)), SLOT(slotRuleFieldChanged(int)));
+ connect(m_ruleField, TQT_SIGNAL(activated(int)), TQT_SIGNAL(signalModified()));
+ connect(m_ruleField, TQT_SIGNAL(activated(int)), TQT_SLOT(slotRuleFieldChanged(int)));
m_ruleFunc = new KComboBox(this);
- connect(m_ruleFunc, SIGNAL(activated(int)), SIGNAL(signalModified()));
+ connect(m_ruleFunc, TQT_SIGNAL(activated(int)), TQT_SIGNAL(signalModified()));
m_ruleValue = new KLineEdit(this);
- connect(m_ruleValue, SIGNAL(textChanged(const QString&)), SIGNAL(signalModified()));
+ connect(m_ruleValue, TQT_SIGNAL(textChanged(const TQString&)), TQT_SIGNAL(signalModified()));
- if(!KTrader::self()->query(QString::fromLatin1("KRegExpEditor/KRegExpEditor")).isEmpty()) {
+ if(!KTrader::self()->query(TQString::tqfromLatin1("KRegExpEditor/KRegExpEditor")).isEmpty()) {
m_editRegExp = new KPushButton(i18n("Edit..."), this);
- connect(m_editRegExp, SIGNAL(clicked()), this, SLOT(slotEditRegExp()));
- connect(m_ruleFunc, SIGNAL(activated(int)), this, SLOT(slotRuleFunctionChanged(int)));
+ connect(m_editRegExp, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditRegExp()));
+ connect(m_ruleFunc, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotRuleFunctionChanged(int)));
slotRuleFunctionChanged(m_ruleFunc->currentItem());
}
@@ -101,22 +101,22 @@ void FilterRuleWidget::initWidget() {
m_ruleFunc->insertStringList(m_ruleFuncList);
// m_ruleFunc->adjustSize();
-// connect(m_ruleField, SIGNAL(textChanged(const QString &)),
-// this, SIGNAL(fieldChanged(const QString &)));
-// connect(m_ruleValue, SIGNAL(textChanged(const QString &)),
-// this, SIGNAL(contentsChanged(const QString &)));
+// connect(m_ruleField, TQT_SIGNAL(textChanged(const TQString &)),
+// this, TQT_SIGNAL(fieldChanged(const TQString &)));
+// connect(m_ruleValue, TQT_SIGNAL(textChanged(const TQString &)),
+// this, TQT_SIGNAL(contentsChanged(const TQString &)));
}
void FilterRuleWidget::slotEditRegExp() {
if(m_editRegExpDialog == 0) {
- m_editRegExpDialog = KParts::ComponentFactory::createInstanceFromQuery<QDialog>(QString::fromLatin1("KRegExpEditor/KRegExpEditor"),
- QString::null, this);
+ m_editRegExpDialog = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>(TQString::tqfromLatin1("KRegExpEditor/KRegExpEditor"),
+ TQString(), TQT_TQOBJECT(this));
}
- KRegExpEditorInterface* iface = static_cast<KRegExpEditorInterface *>(m_editRegExpDialog->qt_cast(QString::fromLatin1("KRegExpEditorInterface")));
+ KRegExpEditorInterface* iface = static_cast<KRegExpEditorInterface *>(m_editRegExpDialog->qt_cast(TQString::tqfromLatin1("KRegExpEditorInterface")));
if(iface) {
iface->setRegExp(m_ruleValue->text());
- if(m_editRegExpDialog->exec() == QDialog::Accepted) {
+ if(m_editRegExpDialog->exec() == TQDialog::Accepted) {
m_ruleValue->setText(iface->regExp());
}
}
@@ -124,7 +124,7 @@ void FilterRuleWidget::slotEditRegExp() {
void FilterRuleWidget::slotRuleFieldChanged(int which_) {
Q_UNUSED(which_);
- QString fieldTitle = m_ruleField->currentText();
+ TQString fieldTitle = m_ruleField->currentText();
if(fieldTitle.isEmpty() || fieldTitle[0] == '<') {
m_ruleValue->setCompletionObject(0);
return;
@@ -172,7 +172,7 @@ void FilterRuleWidget::setRule(const FilterRule* rule_) {
}
Tellico::FilterRule* FilterRuleWidget::rule() const {
- QString field; // empty string
+ TQString field; // empty string
if(m_ruleField->currentItem() > 0) { // 0 is "All Fields", field is empty
field = Kernel::self()->fieldNameByTitle(m_ruleField->currentText());
}
@@ -207,8 +207,8 @@ namespace {
static const int FILTER_MAX_RULES = 8;
}
-FilterRuleWidgetLister::FilterRuleWidgetLister(QWidget* parent_, const char* name_)
- : KWidgetLister(FILTER_MIN_RULE_WIDGETS, FILTER_MAX_RULES, parent_, name_) {
+FilterRuleWidgetLister::FilterRuleWidgetLister(TQWidget* tqparent_, const char* name_)
+ : KWidgetLister(FILTER_MIN_RULE_WIDGETS, FILTER_MAX_RULES, tqparent_, name_) {
// slotClear();
}
@@ -229,11 +229,11 @@ void FilterRuleWidgetLister::setFilter(Filter::Ptr filter_) {
}
// set the right number of widgets
- setNumberOfShownWidgetsTo(QMAX(count, mMinWidgets));
+ setNumberOfShownWidgetsTo(TQMAX(count, mMinWidgets));
// load the actions into the widgets
- QPtrListIterator<QWidget> wIt(mWidgetList);
- for(QPtrListIterator<FilterRule> rIt(*filter_); rIt.current() && wIt.current(); ++rIt, ++wIt) {
+ TQPtrListIterator<TQWidget> wIt(mWidgetList);
+ for(TQPtrListIterator<FilterRule> rIt(*filter_); rIt.current() && wIt.current(); ++rIt, ++wIt) {
static_cast<FilterRuleWidget*>(*wIt)->setRule(*rIt);
}
for( ; wIt.current(); ++wIt) { // clear any remaining
@@ -253,19 +253,19 @@ void FilterRuleWidgetLister::setFocus() {
}
}
-QWidget* FilterRuleWidgetLister::createWidget(QWidget* parent_) {
- QWidget* w = new FilterRuleWidget(static_cast<Tellico::FilterRule*>(0), parent_);
- connect(w, SIGNAL(signalModified()), SIGNAL(signalModified()));
+TQWidget* FilterRuleWidgetLister::createWidget(TQWidget* tqparent_) {
+ TQWidget* w = new FilterRuleWidget(static_cast<Tellico::FilterRule*>(0), tqparent_);
+ connect(w, TQT_SIGNAL(signalModified()), TQT_SIGNAL(signalModified()));
return w;
}
-void FilterRuleWidgetLister::clearWidget(QWidget* widget_) {
+void FilterRuleWidgetLister::clearWidget(TQWidget* widget_) {
if(widget_) {
static_cast<FilterRuleWidget*>(widget_)->reset();
}
}
-const QPtrList<QWidget>& FilterRuleWidgetLister::widgetList() const {
+const TQPtrList<TQWidget>& FilterRuleWidgetLister::widgetList() const {
return mWidgetList;
}
@@ -277,8 +277,8 @@ namespace {
// modal dialog so I don't have to worry about updating stuff
// don't show apply button if not saving, i.e. just modifying existing filter
-FilterDialog::FilterDialog(Mode mode_, QWidget* parent_, const char* name_/*=0*/)
- : KDialogBase(parent_, name_, true,
+FilterDialog::FilterDialog(Mode mode_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : KDialogBase(tqparent_, name_, true,
(mode_ == CreateFilter ? i18n("Advanced Filter") : i18n("Modify Filter")),
(mode_ == CreateFilter ? Help|Ok|Apply|Cancel : Help|Ok|Cancel),
Ok, false),
@@ -287,46 +287,46 @@ FilterDialog::FilterDialog(Mode mode_, QWidget* parent_, const char* name_/*=0*/
}
void FilterDialog::init() {
- QWidget* page = new QWidget(this);
+ TQWidget* page = new TQWidget(this);
setMainWidget(page);
- QVBoxLayout* topLayout = new QVBoxLayout(page, 0, KDialog::spacingHint());
+ TQVBoxLayout* topLayout = new TQVBoxLayout(page, 0, KDialog::spacingHint());
- QGroupBox* m_matchGroup = new QGroupBox(1, Qt::Horizontal, i18n("Filter Criteria"), page);
+ TQGroupBox* m_matchGroup = new TQGroupBox(1, Qt::Horizontal, i18n("Filter Criteria"), page);
topLayout->addWidget(m_matchGroup);
- QVButtonGroup* bg = new QVButtonGroup(m_matchGroup);
- bg->setFrameShape(QFrame::NoFrame);
+ TQVButtonGroup* bg = new TQVButtonGroup(m_matchGroup);
+ bg->setFrameShape(TQFrame::NoFrame);
bg->setInsideMargin(0);
- m_matchAll = new QRadioButton(i18n("Match a&ll of the following"), bg);
- m_matchAny = new QRadioButton(i18n("Match an&y of the following"), bg);
+ m_matchAll = new TQRadioButton(i18n("Match a&ll of the following"), bg);
+ m_matchAny = new TQRadioButton(i18n("Match an&y of the following"), bg);
m_matchAll->setChecked(true);
- connect(bg, SIGNAL(clicked(int)), SLOT(slotFilterChanged()));
+ connect(bg, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotFilterChanged()));
m_ruleLister = new FilterRuleWidgetLister(m_matchGroup);
- connect(m_ruleLister, SIGNAL(widgetRemoved()), SLOT(slotShrink()));
- connect(m_ruleLister, SIGNAL(signalModified()), SLOT(slotFilterChanged()));
+ connect(m_ruleLister, TQT_SIGNAL(widgetRemoved()), TQT_SLOT(slotShrink()));
+ connect(m_ruleLister, TQT_SIGNAL(signalModified()), TQT_SLOT(slotFilterChanged()));
m_ruleLister->setFocus();
- QHBoxLayout* blay = new QHBoxLayout(topLayout);
- blay->addWidget(new QLabel(i18n("Filter name:"), page));
+ TQHBoxLayout* blay = new TQHBoxLayout(topLayout);
+ blay->addWidget(new TQLabel(i18n("Filter name:"), page));
m_filterName = new KLineEdit(page);
blay->addWidget(m_filterName);
- connect(m_filterName, SIGNAL(textChanged(const QString&)), SLOT(slotFilterChanged()));
+ connect(m_filterName, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotFilterChanged()));
// only when creating a new filter can it be saved
if(m_mode == CreateFilter) {
- m_saveFilter = new KPushButton(SmallIconSet(QString::fromLatin1("filter")), i18n("&Save Filter"), page);
+ m_saveFilter = new KPushButton(SmallIconSet(TQString::tqfromLatin1("filter")), i18n("&Save Filter"), page);
blay->addWidget(m_saveFilter);
m_saveFilter->setEnabled(false);
- connect(m_saveFilter, SIGNAL(clicked()), SLOT(slotSaveFilter()));
+ connect(m_saveFilter, TQT_SIGNAL(clicked()), TQT_SLOT(slotSaveFilter()));
enableButtonApply(false);
}
enableButtonOK(false); // disable at start
actionButton(Help)->setDefault(false); // Help automatically becomes default when OK is disabled
actionButton(Cancel)->setDefault(true); // Help automatically becomes default when OK is disabled
- setMinimumWidth(QMAX(minimumWidth(), FILTER_MIN_WIDTH));
- setHelp(QString::fromLatin1("filter-dialog"));
+ setMinimumWidth(TQMAX(minimumWidth(), FILTER_MIN_WIDTH));
+ setHelp(TQString::tqfromLatin1("filter-dialog"));
}
Tellico::FilterPtr FilterDialog::currentFilter() {
@@ -341,7 +341,7 @@ Tellico::FilterPtr FilterDialog::currentFilter() {
}
m_filter->clear(); // deletes all old rules
- for(QPtrListIterator<QWidget> it(m_ruleLister->widgetList()); it.current(); ++it) {
+ for(TQPtrListIterator<TQWidget> it(m_ruleLister->widgetList()); it.current(); ++it) {
FilterRuleWidget* rw = static_cast<FilterRuleWidget*>(it.current());
FilterRule* rule = rw->rule();
if(rule && !rule->isEmpty()) {
@@ -390,8 +390,8 @@ void FilterDialog::slotClear() {
void FilterDialog::slotShrink() {
updateGeometry();
- QApplication::sendPostedEvents();
- resize(width(), sizeHint().height());
+ TQApplication::sendPostedEvents();
+ resize(width(), tqsizeHint().height());
}
void FilterDialog::slotFilterChanged() {
diff --git a/src/filterdialog.h b/src/filterdialog.h
index f2d21a6..99823d8 100644
--- a/src/filterdialog.h
+++ b/src/filterdialog.h
@@ -21,16 +21,16 @@
#include <kdialogbase.h>
-#include <qhbox.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqhbox.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
class KComboBox;
class KLineEdit;
class KPushButton;
-class QRadioButton;
-class QDialog;
+class TQRadioButton;
+class TQDialog;
namespace Tellico {
class FilterDialog;
@@ -45,15 +45,16 @@ namespace Tellico {
*
* @author Robby Stephenson
*/
-class FilterRuleWidget : public QHBox {
+class FilterRuleWidget : public TQHBox {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor. You give a @ref FilterRule as parameter, which will
* be used to initialize the widget.
*/
- FilterRuleWidget(FilterRule* rule, QWidget* parent, const char* name=0);
+ FilterRuleWidget(FilterRule* rule, TQWidget* tqparent, const char* name=0);
/**
* Set the rule. The rule is accepted regardless of the return
@@ -91,18 +92,19 @@ private:
KComboBox* m_ruleFunc;
KLineEdit* m_ruleValue;
KPushButton* m_editRegExp;
- QDialog* m_editRegExpDialog;
- QStringList m_ruleFieldList;
- QStringList m_ruleFuncList;
+ TQDialog* m_editRegExpDialog;
+ TQStringList m_ruleFieldList;
+ TQStringList m_ruleFuncList;
};
class FilterRuleWidgetLister : public KWidgetLister {
Q_OBJECT
+ TQ_OBJECT
public:
- FilterRuleWidgetLister(QWidget* parent, const char* name=0);
+ FilterRuleWidgetLister(TQWidget* tqparent, const char* name=0);
- const QPtrList<QWidget>& widgetList() const;
+ const TQPtrList<TQWidget>& widgetList() const;
void setFilter(Filter::Ptr filter);
public slots:
@@ -113,8 +115,8 @@ signals:
void signalModified();
protected:
- virtual void clearWidget(QWidget* widget);
- virtual QWidget* createWidget(QWidget* parent);
+ virtual void clearWidget(TQWidget* widget);
+ virtual TQWidget* createWidget(TQWidget* tqparent);
};
/**
@@ -122,6 +124,7 @@ protected:
*/
class FilterDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
enum Mode {
@@ -132,10 +135,10 @@ public:
/**
* The constructor sets up the dialog.
*
- * @param parent A pointer to the parent widget
+ * @param tqparent A pointer to the tqparent widget
* @param name The widget name
*/
- FilterDialog(Mode mode, QWidget* parent, const char* name=0);
+ FilterDialog(Mode mode, TQWidget* tqparent, const char* name=0);
FilterPtr currentFilter();
void setFilter(FilterPtr filter);
@@ -159,8 +162,8 @@ private:
FilterPtr m_filter;
const Mode m_mode;
- QRadioButton* m_matchAll;
- QRadioButton* m_matchAny;
+ TQRadioButton* m_matchAll;
+ TQRadioButton* m_matchAny;
FilterRuleWidgetLister* m_ruleLister;
KLineEdit* m_filterName;
KPushButton* m_saveFilter;
diff --git a/src/filteritem.cpp b/src/filteritem.cpp
index 68f5eaf..fe598df 100644
--- a/src/filteritem.cpp
+++ b/src/filteritem.cpp
@@ -16,14 +16,14 @@
#include <kiconloader.h>
-#include <qpixmap.h>
+#include <tqpixmap.h>
using Tellico::FilterItem;
-FilterItem::FilterItem(GUI::ListView* parent_, Filter::Ptr filter_)
- : GUI::CountedItem(parent_), m_filter(filter_) {
+FilterItem::FilterItem(GUI::ListView* tqparent_, Filter::Ptr filter_)
+ : GUI::CountedItem(tqparent_), m_filter(filter_) {
setText(0, filter_->name());
- setPixmap(0, SmallIcon(QString::fromLatin1("filter")));
+ setPixmap(0, SmallIcon(TQString::tqfromLatin1("filter")));
}
void FilterItem::updateFilter(Filter::Ptr filter_) {
diff --git a/src/filteritem.h b/src/filteritem.h
index c777b5a..874b2ab 100644
--- a/src/filteritem.h
+++ b/src/filteritem.h
@@ -24,7 +24,7 @@ namespace Tellico {
*/
class FilterItem : public GUI::CountedItem {
public:
- FilterItem(GUI::ListView* parent, Tellico::Filter::Ptr filter);
+ FilterItem(GUI::ListView* tqparent, Tellico::Filter::Ptr filter);
virtual bool isFilterItem() const { return true; }
Filter::Ptr filter() { return m_filter; }
diff --git a/src/filterview.cpp b/src/filterview.cpp
index 8bb9deb..6a52e54 100644
--- a/src/filterview.cpp
+++ b/src/filterview.cpp
@@ -25,21 +25,21 @@
#include <kpopupmenu.h>
#include <kiconloader.h>
-#include <qheader.h>
+#include <tqheader.h>
using Tellico::FilterView;
-FilterView::FilterView(QWidget* parent_, const char* name_) : GUI::ListView(parent_, name_), m_notSortedYet(true) {
+FilterView::FilterView(TQWidget* tqparent_, const char* name_) : GUI::ListView(tqparent_, name_), m_notSortedYet(true) {
addColumn(i18n("Filter"));
header()->setStretchEnabled(true, 0);
- setResizeMode(QListView::NoColumn);
+ setResizeMode(TQListView::NoColumn);
setRootIsDecorated(true);
setShowSortIndicator(true);
setTreeStepSize(15);
setFullWidth(true);
- connect(this, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)),
- SLOT(contextMenuRequested(QListViewItem*, const QPoint&, int)));
+ connect(this, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)),
+ TQT_SLOT(contextMenuRequested(TQListViewItem*, const TQPoint&, int)));
}
bool FilterView::isSelectable(GUI::ListViewItem* item_) const {
@@ -56,7 +56,7 @@ bool FilterView::isSelectable(GUI::ListViewItem* item_) const {
return true;
}
-void FilterView::contextMenuRequested(QListViewItem* item_, const QPoint& point_, int) {
+void FilterView::contextMenuRequested(TQListViewItem* item_, const TQPoint& point_, int) {
if(!item_) {
return;
}
@@ -64,10 +64,10 @@ void FilterView::contextMenuRequested(QListViewItem* item_, const QPoint& point_
GUI::ListViewItem* item = static_cast<GUI::ListViewItem*>(item_);
if(item->isFilterItem()) {
KPopupMenu menu(this);
- menu.insertItem(SmallIconSet(QString::fromLatin1("filter")),
- i18n("Modify Filter"), this, SLOT(slotModifyFilter()));
- menu.insertItem(SmallIconSet(QString::fromLatin1("editdelete")),
- i18n("Delete Filter"), this, SLOT(slotDeleteFilter()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("filter")),
+ i18n("Modify Filter"), this, TQT_SLOT(slotModifyFilter()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("editdelete")),
+ i18n("Delete Filter"), this, TQT_SLOT(slotDeleteFilter()));
menu.exec(point_);
}
}
@@ -95,14 +95,14 @@ void FilterView::addCollection(Data::CollPtr coll_) {
for(FilterVec::Iterator it = filters.begin(); it != filters.end(); ++it) {
addFilter(it);
}
- Data::FieldPtr f = coll_->fieldByName(QString::fromLatin1("title"));
+ Data::FieldPtr f = coll_->fieldByName(TQString::tqfromLatin1("title"));
if(f) {
setComparison(0, ListViewComparison::create(f));
}
}
void FilterView::addEntries(Data::EntryVec entries_) {
- for(QListViewItem* item = firstChild(); item; item = item->nextSibling()) {
+ for(TQListViewItem* item = firstChild(); item; item = item->nextSibling()) {
Filter::Ptr filter = static_cast<FilterItem*>(item)->filter();
for(Data::EntryVecIt it = entries_.begin(); it != entries_.end(); ++it) {
if(filter && filter->matches(it.data())) {
@@ -119,11 +119,11 @@ void FilterView::modifyEntries(Data::EntryVec entries_) {
}
void FilterView::modifyEntry(Data::EntryPtr entry_) {
- for(QListViewItem* item = firstChild(); item; item = item->nextSibling()) {
+ for(TQListViewItem* item = firstChild(); item; item = item->nextSibling()) {
bool hasEntry = false;
- QListViewItem* entryItem = 0;
- // iterate over all children and find item with matching entry pointers
- for(QListViewItem* i = item->firstChild(); i; i = i->nextSibling()) {
+ TQListViewItem* entryItem = 0;
+ // iterate over all tqchildren and find item with matching entry pointers
+ for(TQListViewItem* i = item->firstChild(); i; i = i->nextSibling()) {
if(static_cast<EntryItem*>(i)->entry() == entry_) {
i->setText(0, entry_->title());
// only one item per filter will match
@@ -145,12 +145,12 @@ void FilterView::modifyEntry(Data::EntryPtr entry_) {
void FilterView::removeEntries(Data::EntryVec entries_) {
// the group modified signal gets handles separately, this is just for filters
- for(QListViewItem* item = firstChild(); item; item = item->nextSibling()) {
- // iterate over all children and delete items with matching entry pointers
- QListViewItem* c1 = item->firstChild();
+ for(TQListViewItem* item = firstChild(); item; item = item->nextSibling()) {
+ // iterate over all tqchildren and delete items with matching entry pointers
+ TQListViewItem* c1 = item->firstChild();
while(c1) {
- if(entries_.contains(static_cast<EntryItem*>(c1)->entry())) {
- QListViewItem* c2 = c1;
+ if(entries_.tqcontains(static_cast<EntryItem*>(c1)->entry())) {
+ TQListViewItem* c2 = c1;
c1 = c1->nextSibling();
delete c2;
} else {
@@ -214,7 +214,7 @@ void FilterView::removeFilter(FilterPtr filter_) {
found = cur;
} else {
// iterate over all filter items
- for(QListViewItem* item = firstChild(); item; item = item->nextSibling()) {
+ for(TQListViewItem* item = firstChild(); item; item = item->nextSibling()) {
if(static_cast<FilterItem*>(item)->filter() == filter_) {
found = static_cast<FilterItem*>(item);
break;
@@ -245,7 +245,7 @@ void FilterView::resetComparisons() {
if(childCount() == 0) {
return;
}
- QListViewItem* item = firstChild();
+ TQListViewItem* item = firstChild();
while(item && item->childCount() == 0) {
item = item->nextSibling();
}
@@ -257,7 +257,7 @@ void FilterView::resetComparisons() {
if(!coll) {
return;
}
- Data::FieldPtr f = coll->fieldByName(QString::fromLatin1("title"));
+ Data::FieldPtr f = coll->fieldByName(TQString::tqfromLatin1("title"));
if(f) {
setComparison(0, ListViewComparison::create(f));
}
diff --git a/src/filterview.h b/src/filterview.h
index 85674e5..8fbb1a5 100644
--- a/src/filterview.h
+++ b/src/filterview.h
@@ -18,7 +18,7 @@
#include "observer.h"
#include "filteritem.h"
-#include <qdict.h>
+#include <tqdict.h>
namespace Tellico {
@@ -27,9 +27,10 @@ namespace Tellico {
*/
class FilterView : public GUI::ListView, public Observer {
Q_OBJECT
+ TQ_OBJECT
public:
- FilterView(QWidget* parent, const char* name=0);
+ FilterView(TQWidget* tqparent, const char* name=0);
virtual bool isSelectable(GUI::ListViewItem*) const;
@@ -59,7 +60,7 @@ private slots:
* @param point The location point
* @param col The column number, not currently used
*/
- void contextMenuRequested(QListViewItem* item, const QPoint& point, int col);
+ void contextMenuRequested(TQListViewItem* item, const TQPoint& point, int col);
/**
* Modify a saved filter
@@ -75,7 +76,7 @@ private:
void resetComparisons();
bool m_notSortedYet;
- QDict<FilterItem> m_itemDict;
+ TQDict<FilterItem> m_itemDict;
};
} // end namespace
diff --git a/src/groupiterator.cpp b/src/groupiterator.cpp
index 21f0db2..209de52 100644
--- a/src/groupiterator.cpp
+++ b/src/groupiterator.cpp
@@ -16,8 +16,8 @@
using Tellico::GroupIterator;
-GroupIterator::GroupIterator(const QListView* view_) {
- // groups are the first children in the group view
+GroupIterator::GroupIterator(const TQListView* view_) {
+ // groups are the first tqchildren in the group view
m_item = static_cast<GUI::ListViewItem*>(view_->firstChild());
}
diff --git a/src/groupiterator.h b/src/groupiterator.h
index a77b7ea..74daf03 100644
--- a/src/groupiterator.h
+++ b/src/groupiterator.h
@@ -14,7 +14,7 @@
#ifndef TELLICO_GROUPITERATOR_H
#define TELLICO_GROUPITERATOR_H
-class QListView;
+class TQListView;
namespace Tellico {
namespace Data {
@@ -29,7 +29,7 @@ namespace Tellico {
*/
class GroupIterator{
public:
- GroupIterator(const QListView* view);
+ GroupIterator(const TQListView* view);
GroupIterator& operator++();
Data::EntryGroup* group();
diff --git a/src/groupview.cpp b/src/groupview.cpp
index 67b1a40..16bf8e1 100644
--- a/src/groupview.cpp
+++ b/src/groupview.cpp
@@ -31,34 +31,34 @@
#include <kiconloader.h>
#include <kaction.h>
-#include <qstringlist.h>
-#include <qcolor.h>
-#include <qregexp.h>
-#include <qheader.h>
+#include <tqstringlist.h>
+#include <tqcolor.h>
+#include <tqregexp.h>
+#include <tqheader.h>
using Tellico::GroupView;
-GroupView::GroupView(QWidget* parent_, const char* name_/*=0*/)
- : GUI::ListView(parent_, name_), m_notSortedYet(true), m_coll(0) {
- addColumn(QString::null); // header text gets updated later
+GroupView::GroupView(TQWidget* tqparent_, const char* name_/*=0*/)
+ : GUI::ListView(tqparent_, name_), m_notSortedYet(true), m_coll(0) {
+ addColumn(TQString()); // header text gets updated later
header()->setStretchEnabled(true, 0);
- setResizeMode(QListView::NoColumn);
+ setResizeMode(TQListView::NoColumn);
setRootIsDecorated(true);
setShowSortIndicator(true);
setTreeStepSize(15);
setFullWidth(true);
- connect(this, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)),
- SLOT(contextMenuRequested(QListViewItem*, const QPoint&, int)));
+ connect(this, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)),
+ TQT_SLOT(contextMenuRequested(TQListViewItem*, const TQPoint&, int)));
- connect(this, SIGNAL(expanded(QListViewItem*)),
- SLOT(slotExpanded(QListViewItem*)));
+ connect(this, TQT_SIGNAL(expanded(TQListViewItem*)),
+ TQT_SLOT(slotExpanded(TQListViewItem*)));
- connect(this, SIGNAL(collapsed(QListViewItem*)),
- SLOT(slotCollapsed(QListViewItem*)));
+ connect(this, TQT_SIGNAL(collapsed(TQListViewItem*)),
+ TQT_SLOT(slotCollapsed(TQListViewItem*)));
- m_groupOpenPixmap = SmallIcon(QString::fromLatin1("folder_open"));
- m_groupClosedPixmap = SmallIcon(QString::fromLatin1("folder"));
+ m_groupOpenPixmap = SmallIcon(TQString::tqfromLatin1("folder_open"));
+ m_groupClosedPixmap = SmallIcon(TQString::tqfromLatin1("folder"));
}
Tellico::EntryGroupItem* GroupView::addGroup(Data::EntryGroup* group_) {
@@ -71,7 +71,7 @@ Tellico::EntryGroupItem* GroupView::addGroup(Data::EntryGroup* group_) {
}
EntryGroupItem* item = new EntryGroupItem(this, group_, type);
if(group_->groupName() == i18n(Data::Collection::s_emptyGroupTitle)) {
- item->setPixmap(0, SmallIcon(QString::fromLatin1("folder_red")));
+ item->setPixmap(0, SmallIcon(TQString::tqfromLatin1("folder_red")));
item->setSortWeight(10);
} else {
item->setPixmap(0, m_groupClosedPixmap);
@@ -115,7 +115,7 @@ void GroupView::slotModifyGroups(Data::CollPtr coll_, PtrVector<Data::EntryGroup
}
// myDebug() << "GroupView::slotModifyGroups() - " << group->fieldName() << "/" << group->groupName() << endl;
- EntryGroupItem* par = m_groupDict.find(group->groupName());
+ EntryGroupItem* par = m_groupDict.tqfind(group->groupName());
if(par) {
if(group->isEmpty()) {
m_groupDict.remove(par->text(0));
@@ -144,7 +144,7 @@ void GroupView::slotModifyGroups(Data::CollPtr coll_, PtrVector<Data::EntryGroup
sort(); // in case the count changed, or group name
}
-// don't 'shadow' QListView::setSelected
+// don't 'shadow' TQListView::setSelected
void GroupView::setEntrySelected(Data::EntryPtr entry_) {
// myDebug() << "GroupView::slotSetSelected()" << endl;
// if entry_ is null pointer, set no selected
@@ -178,13 +178,13 @@ void GroupView::setEntrySelected(Data::EntryPtr entry_) {
return;
}
- EntryGroupItem* groupItem = m_groupDict.find(group->groupName());
+ EntryGroupItem* groupItem = m_groupDict.tqfind(group->groupName());
if(!groupItem) {
return;
}
clearSelection();
- for(QListViewItem* item = groupItem->firstChild(); item; item = item->nextSibling()) {
+ for(TQListViewItem* item = groupItem->firstChild(); item; item = item->nextSibling()) {
EntryItem* entryItem = static_cast<EntryItem*>(item);
if(entryItem->entry() == entry_) {
blockSignals(true);
@@ -212,7 +212,7 @@ void GroupView::slotCollapseAll(int depth_/*=-1*/) {
}
void GroupView::setSiblingsOpen(int depth_, bool open_) {
- QListViewItem* item = 0;
+ TQListViewItem* item = 0;
if(depth_ == -1) {
item = currentItem();
@@ -240,7 +240,7 @@ void GroupView::setSiblingsOpen(int depth_, bool open_) {
}
}
-void GroupView::contextMenuRequested(QListViewItem* item_, const QPoint& point_, int) {
+void GroupView::contextMenuRequested(TQListViewItem* item_, const TQPoint& point_, int) {
if(!item_) {
return;
}
@@ -248,23 +248,23 @@ void GroupView::contextMenuRequested(QListViewItem* item_, const QPoint& point_,
KPopupMenu menu(this);
GUI::ListViewItem* item = static_cast<GUI::ListViewItem*>(item_);
if(item->isEntryGroupItem()) {
- menu.insertItem(SmallIconSet(QString::fromLatin1("2downarrow")),
- i18n("Expand All Groups"), this, SLOT(slotExpandAll()));
- menu.insertItem(SmallIconSet(QString::fromLatin1("2uparrow")),
- i18n("Collapse All Groups"), this, SLOT(slotCollapseAll()));
- menu.insertItem(SmallIconSet(QString::fromLatin1("filter")),
- i18n("Filter by Group"), this, SLOT(slotFilterGroup()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("2downarrow")),
+ i18n("Expand All Groups"), this, TQT_SLOT(slotExpandAll()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("2uparrow")),
+ i18n("Collapse All Groups"), this, TQT_SLOT(slotCollapseAll()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("filter")),
+ i18n("Filter by Group"), this, TQT_SLOT(slotFilterGroup()));
} else if(item->isEntryItem()) {
Controller::self()->plugEntryActions(&menu);
}
menu.exec(point_);
}
-void GroupView::slotCollapsed(QListViewItem* item_) {
+void GroupView::slotCollapsed(TQListViewItem* item_) {
// only change icon for group items
if(static_cast<GUI::ListViewItem*>(item_)->isEntryGroupItem()) {
if(item_->text(0) == i18n(Data::Collection::s_emptyGroupTitle)) {
- item_->setPixmap(0, SmallIcon(QString::fromLatin1("folder_red")));
+ item_->setPixmap(0, SmallIcon(TQString::tqfromLatin1("folder_red")));
} else {
item_->setPixmap(0, m_groupClosedPixmap);
}
@@ -272,7 +272,7 @@ void GroupView::slotCollapsed(QListViewItem* item_) {
}
}
-void GroupView::slotExpanded(QListViewItem* item_) {
+void GroupView::slotExpanded(TQListViewItem* item_) {
EntryGroupItem* item = static_cast<EntryGroupItem*>(item_);
// only change icon for group items
if(!item->isEntryGroupItem()) {
@@ -281,7 +281,7 @@ void GroupView::slotExpanded(QListViewItem* item_) {
setUpdatesEnabled(false);
if(item->text(0) == i18n(Data::Collection::s_emptyGroupTitle)) {
- item->setPixmap(0, SmallIcon(QString::fromLatin1("folder_red_open")));
+ item->setPixmap(0, SmallIcon(TQString::tqfromLatin1("folder_red_open")));
} else {
item->setPixmap(0, m_groupOpenPixmap);
}
@@ -316,11 +316,11 @@ void GroupView::addCollection(Data::CollPtr coll_) {
// when the coll gets set for the first time, the pixmaps need to be updated
if((m_coll->hasField(m_groupBy) && m_coll->fieldByName(m_groupBy)->formatFlag() == Data::Field::FormatName)
|| m_groupBy == Data::Collection::s_peopleGroupName) {
- m_groupOpenPixmap = UserIcon(QString::fromLatin1("person-open"));
- m_groupClosedPixmap = UserIcon(QString::fromLatin1("person"));
+ m_groupOpenPixmap = UserIcon(TQString::tqfromLatin1("person-open"));
+ m_groupClosedPixmap = UserIcon(TQString::tqfromLatin1("person"));
}
- Data::FieldPtr f = coll_->fieldByName(QString::fromLatin1("title"));
+ Data::FieldPtr f = coll_->fieldByName(TQString::tqfromLatin1("title"));
if(f) {
setComparison(0, ListViewComparison::create(f));
}
@@ -332,7 +332,7 @@ void GroupView::addCollection(Data::CollPtr coll_) {
// myDebug() << "GroupView::addCollection - done" << endl;
}
-void GroupView::setGroupField(const QString& groupField_) {
+void GroupView::setGroupField(const TQString& groupField_) {
// myDebug() << "GroupView::setGroupField - " << groupField_ << endl;
if(groupField_.isEmpty() || groupField_ == m_groupBy) {
return;
@@ -344,11 +344,11 @@ void GroupView::setGroupField(const QString& groupField_) {
}
if((m_coll->hasField(groupField_) && m_coll->fieldByName(groupField_)->formatFlag() == Data::Field::FormatName)
|| groupField_ == Data::Collection::s_peopleGroupName) {
- m_groupOpenPixmap = UserIcon(QString::fromLatin1("person-open"));
- m_groupClosedPixmap = UserIcon(QString::fromLatin1("person"));
+ m_groupOpenPixmap = UserIcon(TQString::tqfromLatin1("person-open"));
+ m_groupClosedPixmap = UserIcon(TQString::tqfromLatin1("person"));
} else {
- m_groupOpenPixmap = SmallIcon(QString::fromLatin1("folder_open"));
- m_groupClosedPixmap = SmallIcon(QString::fromLatin1("folder"));
+ m_groupOpenPixmap = SmallIcon(TQString::tqfromLatin1("folder_open"));
+ m_groupClosedPixmap = SmallIcon(TQString::tqfromLatin1("folder"));
}
updateHeader();
populateCollection();
@@ -381,7 +381,7 @@ void GroupView::populateCollection() {
// iterate over all the groups in the dict
// e.g. if the dict is "author", loop over all the author groups
- for(QDictIterator<Data::EntryGroup> it(*dict); it.current(); ++it) {
+ for(TQDictIterator<Data::EntryGroup> it(*dict); it.current(); ++it) {
addGroup(it.current());
}
@@ -411,7 +411,7 @@ void GroupView::slotFilterGroup() {
filter->append(new FilterRule(fIt->name(), it.current()->text(0), FilterRule::FuncContains));
}
} else {
- QString s = it.current()->text(0);
+ TQString s = it.current()->text(0);
if(s != i18n(Data::Collection::s_emptyGroupTitle)) {
filter->append(new FilterRule(m_groupBy, it.current()->text(0), FilterRule::FuncContains));
}
@@ -459,16 +459,16 @@ void GroupView::removeField(Data::CollPtr, Data::FieldPtr) {
}
void GroupView::updateHeader(Data::FieldPtr field_/*=0*/) {
- QString t = field_ ? field_->title() : groupTitle();
+ TQString t = field_ ? field_->title() : groupTitle();
if(sortStyle() == ListView::SortByText) {
setColumnText(0, t);
} else {
- setColumnText(0, i18n("%1 (Sort by Count)").arg(t));
+ setColumnText(0, i18n("%1 (Sort by Count)").tqarg(t));
}
}
-QString GroupView::groupTitle() {
- QString title;
+TQString GroupView::groupTitle() {
+ TQString title;
if(!m_coll || m_groupBy.isEmpty()) {
title = i18n("Group Name Header", "Group");
} else {
@@ -486,7 +486,7 @@ void GroupView::resetComparisons() {
if(!m_coll) {
return;
}
- Data::FieldPtr f = m_coll->fieldByName(QString::fromLatin1("title"));
+ Data::FieldPtr f = m_coll->fieldByName(TQString::tqfromLatin1("title"));
if(f) {
setComparison(0, ListViewComparison::create(f));
}
diff --git a/src/groupview.h b/src/groupview.h
index 4ead256..40a40f9 100644
--- a/src/groupview.h
+++ b/src/groupview.h
@@ -17,8 +17,8 @@
#include "gui/listview.h"
#include "observer.h"
-#include <qdict.h>
-#include <qpixmap.h>
+#include <tqdict.h>
+#include <tqpixmap.h>
namespace Tellico {
namespace Data {
@@ -32,7 +32,7 @@ namespace Tellico {
* The GroupView shows the entries grouped, as well as the saved filters.
*
* There is one root item for each collection in the document. The entries are grouped
- * by the field defined by each collection. A @ref QDict is used to keep track of the
+ * by the field defined by each collection. A @ref TQDict is used to keep track of the
* group items.
*
* @see Tellico::Data::Collection
@@ -41,28 +41,29 @@ namespace Tellico {
*/
class GroupView : public GUI::ListView, public Observer {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* The constructor sets up the single column, and initializes the popup menu.
*
- * @param parent A pointer to the parent widget
+ * @param tqparent A pointer to the tqparent widget
* @param name The widget name
*/
- GroupView(QWidget* parent, const char* name=0);
+ GroupView(TQWidget* tqparent, const char* name=0);
/**
* Returns the name of the field by which the entries are grouped
*
* @return The field name
*/
- const QString& groupBy() const { return m_groupBy; }
+ const TQString& groupBy() const { return m_groupBy; }
/**
* Sets the name of the field by which the entries are grouped
*
* @param groupFieldName The field name
*/
- void setGroupField(const QString& groupFieldName);
+ void setGroupField(const TQString& groupFieldName);
/**
* Adds a collection, along with all all the groups for the collection in
* the groupFieldribute. This method gets called as well when the groupFieldribute
@@ -72,7 +73,7 @@ public:
*/
void addCollection(Data::CollPtr coll);
/**
- * Removes a root collection item, and all of its children.
+ * Removes a root collection item, and all of its tqchildren.
*
* @param coll A pointer to the collection
*/
@@ -149,21 +150,21 @@ private slots:
* @param point The location point
* @param col The column number, not currently used
*/
- void contextMenuRequested(QListViewItem* item, const QPoint& point, int col);
+ void contextMenuRequested(TQListViewItem* item, const TQPoint& point, int col);
/**
* Handles changing the icon when an item is expanded, depended on whether it refers
* to a collection, a group, or an entry.
*
* @param item A pointer to the expanded list item
*/
- void slotExpanded(QListViewItem* item);
+ void slotExpanded(TQListViewItem* item);
/**
* Handles changing the icon when an item is collapsed, depended on whether it refers
* to a collection, a group, or an entry.
*
* @param item A pointer to the collapse list item
*/
- void slotCollapsed(QListViewItem* item);
+ void slotCollapsed(TQListViewItem* item);
/**
* Filter by group
*/
@@ -182,16 +183,16 @@ private:
virtual void setSorting(int column, bool ascending = true);
void resetComparisons();
- QString groupTitle();
+ TQString groupTitle();
void updateHeader(Data::FieldPtr field=0);
bool m_notSortedYet;
Data::CollPtr m_coll;
- QDict<EntryGroupItem> m_groupDict;
- QString m_groupBy;
+ TQDict<EntryGroupItem> m_groupDict;
+ TQString m_groupBy;
- QPixmap m_groupOpenPixmap;
- QPixmap m_groupClosedPixmap;
+ TQPixmap m_groupOpenPixmap;
+ TQPixmap m_groupClosedPixmap;
};
} // end namespace
diff --git a/src/gui/boolfieldwidget.cpp b/src/gui/boolfieldwidget.cpp
index 5a8e88b..ae625be 100644
--- a/src/gui/boolfieldwidget.cpp
+++ b/src/gui/boolfieldwidget.cpp
@@ -15,29 +15,29 @@
#include "../field.h"
#include "../latin1literal.h"
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqlayout.h>
using Tellico::GUI::BoolFieldWidget;
-BoolFieldWidget::BoolFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : FieldWidget(field_, parent_, name_) {
+BoolFieldWidget::BoolFieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : FieldWidget(field_, tqparent_, name_) {
- m_checkBox = new QCheckBox(this);
- connect(m_checkBox, SIGNAL(clicked()), SIGNAL(modified()));
+ m_checkBox = new TQCheckBox(this);
+ connect(m_checkBox, TQT_SIGNAL(clicked()), TQT_SIGNAL(modified()));
registerWidget();
}
-QString BoolFieldWidget::text() const {
+TQString BoolFieldWidget::text() const {
if(m_checkBox->isChecked()) {
- return QString::fromLatin1("true");
+ return TQString::tqfromLatin1("true");
}
- return QString();
+ return TQString();
}
-void BoolFieldWidget::setText(const QString& text_) {
+void BoolFieldWidget::setText(const TQString& text_) {
blockSignals(true);
m_checkBox->blockSignals(true);
@@ -54,7 +54,7 @@ void BoolFieldWidget::clear() {
editMultiple(false);
}
-QWidget* BoolFieldWidget::widget() {
+TQWidget* BoolFieldWidget::widget() {
return m_checkBox;
}
diff --git a/src/gui/boolfieldwidget.h b/src/gui/boolfieldwidget.h
index 81af5a6..0181f31 100644
--- a/src/gui/boolfieldwidget.h
+++ b/src/gui/boolfieldwidget.h
@@ -17,8 +17,8 @@
#include "fieldwidget.h"
#include "../datavectors.h"
-class QCheckBox;
-class QString;
+class TQCheckBox;
+class TQString;
namespace Tellico {
namespace GUI {
@@ -28,22 +28,23 @@ namespace Tellico {
*/
class BoolFieldWidget : public FieldWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- BoolFieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ BoolFieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~BoolFieldWidget() {}
- virtual QString text() const;
- virtual void setText(const QString& text);
+ virtual TQString text() const;
+ virtual void setText(const TQString& text);
public slots:
virtual void clear();
protected:
- virtual QWidget* widget();
+ virtual TQWidget* widget();
private:
- QCheckBox* m_checkBox;
+ TQCheckBox* m_checkBox;
};
} // end GUI namespace
diff --git a/src/gui/choicefieldwidget.cpp b/src/gui/choicefieldwidget.cpp
index e9c6870..8e0240b 100644
--- a/src/gui/choicefieldwidget.cpp
+++ b/src/gui/choicefieldwidget.cpp
@@ -16,29 +16,29 @@
#include <kcombobox.h>
-#include <qlabel.h>
-#include <qlayout.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
using Tellico::GUI::ChoiceFieldWidget;
-ChoiceFieldWidget::ChoiceFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : FieldWidget(field_, parent_, name_), m_comboBox(0) {
+ChoiceFieldWidget::ChoiceFieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : FieldWidget(field_, tqparent_, name_), m_comboBox(0) {
m_comboBox = new KComboBox(this);
- connect(m_comboBox, SIGNAL(activated(int)), SIGNAL(modified()));
+ connect(m_comboBox, TQT_SIGNAL(activated(int)), TQT_SIGNAL(modified()));
// always have empty choice
- m_comboBox->insertItem(QString::null);
+ m_comboBox->insertItem(TQString());
m_comboBox->insertStringList(field_->allowed());
m_comboBox->setMinimumWidth(5*fontMetrics().maxWidth());
registerWidget();
}
-QString ChoiceFieldWidget::text() const {
+TQString ChoiceFieldWidget::text() const {
return m_comboBox->currentText();
}
-void ChoiceFieldWidget::setText(const QString& text_) {
+void ChoiceFieldWidget::setText(const TQString& text_) {
blockSignals(true);
m_comboBox->blockSignals(true);
@@ -54,15 +54,15 @@ void ChoiceFieldWidget::clear() {
}
void ChoiceFieldWidget::updateFieldHook(Data::FieldPtr, Data::FieldPtr newField_) {
- QString value = text();
+ TQString value = text();
m_comboBox->clear();
// always have empty choice
- m_comboBox->insertItem(QString::null);
+ m_comboBox->insertItem(TQString());
m_comboBox->insertStringList(newField_->allowed());
m_comboBox->setCurrentText(value);
}
-QWidget* ChoiceFieldWidget::widget() {
+TQWidget* ChoiceFieldWidget::widget() {
return m_comboBox;
}
diff --git a/src/gui/choicefieldwidget.h b/src/gui/choicefieldwidget.h
index a2c40f5..35c40b9 100644
--- a/src/gui/choicefieldwidget.h
+++ b/src/gui/choicefieldwidget.h
@@ -27,19 +27,20 @@ namespace Tellico {
*/
class ChoiceFieldWidget : public FieldWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- ChoiceFieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ ChoiceFieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~ChoiceFieldWidget() {}
- virtual QString text() const;
- virtual void setText(const QString& text);
+ virtual TQString text() const;
+ virtual void setText(const TQString& text);
public slots:
virtual void clear();
protected:
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual void updateFieldHook(Data::FieldPtr oldField, Data::FieldPtr newField);
private:
diff --git a/src/gui/collectiontypecombo.cpp b/src/gui/collectiontypecombo.cpp
index 66749a3..727d26f 100644
--- a/src/gui/collectiontypecombo.cpp
+++ b/src/gui/collectiontypecombo.cpp
@@ -17,7 +17,7 @@
using Tellico::GUI::CollectionTypeCombo;
-CollectionTypeCombo::CollectionTypeCombo(QWidget* parent_) : ComboBox(parent_) {
+CollectionTypeCombo::CollectionTypeCombo(TQWidget* tqparent_) : ComboBox(tqparent_) {
reset();
}
@@ -25,12 +25,12 @@ void CollectionTypeCombo::reset() {
clear();
// I want to sort the collection names
const CollectionNameMap nameMap = CollectionFactory::nameMap();
- QMap<QString, int> rNameMap;
+ TQMap<TQString, int> rNameMap;
for(CollectionNameMap::ConstIterator it = nameMap.begin(); it != nameMap.end(); ++it) {
rNameMap.insert(it.data(), it.key());
}
- const QValueList<int> collTypes = rNameMap.values();
- const QStringList collNames = rNameMap.keys();
+ const TQValueList<int> collTypes = rNameMap.values();
+ const TQStringList collNames = rNameMap.keys();
int custom = -1;
const int total = collTypes.count();
// when i equals the size, then go back and do custom
diff --git a/src/gui/collectiontypecombo.h b/src/gui/collectiontypecombo.h
index 8d3ef80..bcc9e7f 100644
--- a/src/gui/collectiontypecombo.h
+++ b/src/gui/collectiontypecombo.h
@@ -22,7 +22,7 @@ namespace GUI {
class CollectionTypeCombo : public ComboBox {
public:
- CollectionTypeCombo(QWidget* parent);
+ CollectionTypeCombo(TQWidget* tqparent);
void reset();
void setCurrentType(int type);
int currentType() const { return currentData().toInt(); }
diff --git a/src/gui/combobox.cpp b/src/gui/combobox.cpp
index 1aff29b..c5b3dfe 100644
--- a/src/gui/combobox.cpp
+++ b/src/gui/combobox.cpp
@@ -17,7 +17,7 @@
using Tellico::GUI::ComboBox;
-ComboBox::ComboBox(QWidget* parent_) : KComboBox(parent_) {
+ComboBox::ComboBox(TQWidget* tqparent_) : KComboBox(tqparent_) {
setEditable(false);
}
@@ -26,19 +26,19 @@ void ComboBox::clear() {
m_data.clear();
}
-void ComboBox::insertItem(const QString& s_, const QVariant& t_, int idx_/* =-1 */) {
+void ComboBox::insertItem(const TQString& s_, const TQVariant& t_, int idx_/* =-1 */) {
KComboBox::insertItem(s_, idx_);
if(idx_ < 0) {
m_data.push_back(t_);
} else {
while(idx_ > static_cast<int>(m_data.count())) {
- m_data.push_back(QVariant());
+ m_data.push_back(TQVariant());
}
m_data.insert(m_data.at(idx_), t_);
}
}
-void ComboBox::insertItems(const QStringList& s_, const QValueList<QVariant>& t_, int idx_ /*=-1*/) {
+void ComboBox::insertItems(const TQStringList& s_, const TQValueList<TQVariant>& t_, int idx_ /*=-1*/) {
if(s_.count() != t_.count()) {
kdWarning() << "ComboBox::insertItems() - must have equal number of items in list!" << endl;
return;
@@ -49,19 +49,19 @@ void ComboBox::insertItems(const QStringList& s_, const QValueList<QVariant>& t_
}
}
-const QVariant& ComboBox::currentData() const {
+const TQVariant& ComboBox::currentData() const {
return data(currentItem());
}
-const QVariant& ComboBox::data(uint idx_) const {
+const TQVariant& ComboBox::data(uint idx_) const {
if(idx_ >= m_data.count()) {
- static QVariant t; // inescapable
+ static TQVariant t; // inescapable
return t;
}
return m_data[idx_];
}
-void ComboBox::setCurrentData(const QVariant& data_) {
+void ComboBox::setCurrentData(const TQVariant& data_) {
for(uint i = 0; i < m_data.count(); ++i) {
if(m_data[i] == data_) {
setCurrentItem(i);
diff --git a/src/gui/combobox.h b/src/gui/combobox.h
index d02dbb8..98a411b 100644
--- a/src/gui/combobox.h
+++ b/src/gui/combobox.h
@@ -16,34 +16,34 @@
#include <kcombobox.h>
-#include <qvariant.h>
-#include <qvaluelist.h>
+#include <tqvariant.h>
+#include <tqvaluelist.h>
-class QString;
+class TQString;
namespace Tellico {
namespace GUI {
/**
- * A combobox for mapping a QVariant to each item.
+ * A combobox for mapping a TQVariant to each item.
*
* @author Robby Stephenson
*/
class ComboBox : public KComboBox {
public:
- ComboBox(QWidget* parent_);
+ ComboBox(TQWidget* tqparent_);
void clear();
- const QVariant& currentData() const;
- const QVariant& data(uint index) const;
- void insertItem(const QString& string, const QVariant& datum, int index = -1);
- void insertItems(const QStringList& strings, const QValueList<QVariant>& data, int index = -1);
+ const TQVariant& currentData() const;
+ const TQVariant& data(uint index) const;
+ void insertItem(const TQString& string, const TQVariant& datum, int index = -1);
+ void insertItems(const TQStringList& strings, const TQValueList<TQVariant>& data, int index = -1);
// set current item to match data
- void setCurrentData(const QVariant& data);
+ void setCurrentData(const TQVariant& data);
private:
- QValueList<QVariant> m_data;
+ TQValueList<TQVariant> m_data;
};
} // end namespace
diff --git a/src/gui/counteditem.cpp b/src/gui/counteditem.cpp
index 08b4f25..1be5bcd 100644
--- a/src/gui/counteditem.cpp
+++ b/src/gui/counteditem.cpp
@@ -18,12 +18,12 @@
#include <kglobalsettings.h>
#include <kstringhandler.h>
-#include <qpainter.h>
-#include <qpixmap.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
using Tellico::GUI::CountedItem;
-int CountedItem::compare(QListViewItem* item_, int col_, bool asc_) const {
+int CountedItem::compare(TQListViewItem* item_, int col_, bool asc_) const {
GUI::ListView* lv = listView();
GUI::CountedItem* item = static_cast<GUI::CountedItem*>(item_);
if(lv->sortStyle() == GUI::ListView::SortByCount) {
@@ -39,7 +39,7 @@ int CountedItem::compare(QListViewItem* item_, int col_, bool asc_) const {
return GUI::ListViewItem::compare(item, col_, asc_);
}
-void CountedItem::paintCell(QPainter* p_, const QColorGroup& cg_,
+void CountedItem::paintCell(TQPainter* p_, const TQColorGroup& cg_,
int column_, int width_, int align_) {
if(!p_) {
return;
@@ -55,25 +55,25 @@ void CountedItem::paintCell(QPainter* p_, const QColorGroup& cg_,
// set a catchable text so that we can have our own implementation (see further down)
// but still benefit from KListView::paintCell
- QString oldText = text(column_);
+ TQString oldText = text(column_);
// if(oldText.isEmpty()) {
if(oldText == '\t') {
return; // avoid endless loop!
}
- setText(column_, QChar('\t'));
+ setText(column_, TQChar('\t'));
ListViewItem::paintCell(p_, cg_, column_, width_, align_);
setText(column_, oldText);
int marg = listView()->itemMargin();
int r = marg;
- const QPixmap* icon = pixmap(column_);
+ const TQPixmap* icon = pixmap(column_);
if(icon) {
r += icon->width() + marg;
}
- QFontMetrics fm = p_->fontMetrics();
- QString numText = QString::fromLatin1(" (%1)").arg(count());
+ TQFontMetrics fm = p_->fontMetrics();
+ TQString numText = TQString::tqfromLatin1(" (%1)").tqarg(count());
// don't call CountedListViewItem::width() because that includes the count already
int w = ListViewItem::width(fm, listView(), column_);
int countWidth = fm.width(numText);
@@ -85,8 +85,8 @@ void CountedItem::paintCell(QPainter* p_, const QColorGroup& cg_,
} else {
p_->setPen(cg_.text());
}
- QRect br(0, height(), r, 0);
- if(!oldText.isEmpty() && !oldText.startsWith(QChar('\t'))) {
+ TQRect br(0, height(), r, 0);
+ if(!oldText.isEmpty() && !oldText.startsWith(TQChar('\t'))) {
p_->drawText(r, 0, width_-marg-r, height(), align_ | AlignVCenter, oldText, -1, &br);
}
@@ -98,15 +98,15 @@ void CountedItem::paintCell(QPainter* p_, const QColorGroup& cg_,
}
p_->setPen(Tellico::contrastColor);
}
- p_->drawText(br.right(), 0, width_-marg-br.right(), height(), align_ | Qt::AlignVCenter, numText);
+ p_->drawText(br.right(), 0, width_-marg-br.right(), height(), align_ | TQt::AlignVCenter, numText);
}
-int CountedItem::width(const QFontMetrics& fm_, const QListView* lv_, int column_) const {
+int CountedItem::width(const TQFontMetrics& fm_, const TQListView* lv_, int column_) const {
int w = ListViewItem::width(fm_, lv_, column_);
// show count is only for first column
if(column_ == 0) {
- QString numText = QString::fromLatin1(" (%1)").arg(count());
+ TQString numText = TQString::tqfromLatin1(" (%1)").tqarg(count());
w += fm_.width(numText) + 2; // add a little pad
}
return w;
diff --git a/src/gui/counteditem.h b/src/gui/counteditem.h
index 9ea0138..7e3b9a1 100644
--- a/src/gui/counteditem.h
+++ b/src/gui/counteditem.h
@@ -16,9 +16,9 @@
#include "listview.h"
-class QPainter;
-class QColorGroup;
-class QFontMetrics;
+class TQPainter;
+class TQColorGroup;
+class TQFontMetrics;
namespace Tellico {
namespace GUI {
@@ -28,16 +28,16 @@ namespace Tellico {
*/
class CountedItem : public GUI::ListViewItem {
public:
- CountedItem(ListView* parent) : ListViewItem(parent) {}
- CountedItem(ListViewItem* parent) : ListViewItem(parent) {}
+ CountedItem(ListView* tqparent) : ListViewItem(tqparent) {}
+ CountedItem(ListViewItem* tqparent) : ListViewItem(tqparent) {}
- virtual int compare(QListViewItem* item, int col, bool ascending) const;
+ virtual int compare(TQListViewItem* item, int col, bool ascending) const;
/**
* Paints the cell, adding the number count.
*/
- virtual void paintCell(QPainter* p, const QColorGroup& cg,
+ virtual void paintCell(TQPainter* p, const TQColorGroup& cg,
int column, int width, int align);
- virtual int width(const QFontMetrics& fm, const QListView* lv, int c) const;
+ virtual int width(const TQFontMetrics& fm, const TQListView* lv, int c) const;
virtual int count() const { return childCount(); }
virtual int realChildCount() const { return count(); }
diff --git a/src/gui/datefieldwidget.cpp b/src/gui/datefieldwidget.cpp
index d0609d6..281cee6 100644
--- a/src/gui/datefieldwidget.cpp
+++ b/src/gui/datefieldwidget.cpp
@@ -17,20 +17,20 @@
using Tellico::GUI::DateFieldWidget;
-DateFieldWidget::DateFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : FieldWidget(field_, parent_, name_) {
+DateFieldWidget::DateFieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : FieldWidget(field_, tqparent_, name_) {
m_widget = new DateWidget(this);
- connect(m_widget, SIGNAL(signalModified()), SIGNAL(modified()));
+ connect(m_widget, TQT_SIGNAL(signalModified()), TQT_SIGNAL(modified()));
registerWidget();
}
-QString DateFieldWidget::text() const {
+TQString DateFieldWidget::text() const {
return m_widget->text();
}
-void DateFieldWidget::setText(const QString& text_) {
+void DateFieldWidget::setText(const TQString& text_) {
blockSignals(true);
m_widget->blockSignals(true);
@@ -45,7 +45,7 @@ void DateFieldWidget::clear() {
editMultiple(false);
}
-QWidget* DateFieldWidget::widget() {
+TQWidget* DateFieldWidget::widget() {
return m_widget;
}
diff --git a/src/gui/datefieldwidget.h b/src/gui/datefieldwidget.h
index e3c2d55..573b7dc 100644
--- a/src/gui/datefieldwidget.h
+++ b/src/gui/datefieldwidget.h
@@ -17,7 +17,7 @@
#include "fieldwidget.h"
#include "../datavectors.h"
-class QString;
+class TQString;
namespace Tellico {
namespace GUI {
@@ -28,19 +28,20 @@ namespace Tellico {
*/
class DateFieldWidget : public FieldWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- DateFieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ DateFieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~DateFieldWidget() {}
- virtual QString text() const;
- virtual void setText(const QString& text);
+ virtual TQString text() const;
+ virtual void setText(const TQString& text);
public slots:
virtual void clear();
protected:
- virtual QWidget* widget();
+ virtual TQWidget* widget();
private:
DateWidget* m_widget;
diff --git a/src/gui/datewidget.cpp b/src/gui/datewidget.cpp
index 42e2d4c..054741a 100644
--- a/src/gui/datewidget.cpp
+++ b/src/gui/datewidget.cpp
@@ -26,22 +26,22 @@
#include <kglobalsettings.h>
#include <kcalendarsystem.h>
-#include <qvbox.h>
-#include <qlayout.h>
+#include <tqvbox.h>
+#include <tqlayout.h>
using Tellico::GUI::SpinBox;
using Tellico::GUI::DateWidget;
-SpinBox::SpinBox(int min, int max, QWidget *parent) : QSpinBox(min, max, 1, parent)
+SpinBox::SpinBox(int min, int max, TQWidget *tqparent) : TQSpinBox(min, max, 1, tqparent)
{
- editor()->setAlignment(AlignRight);
+ editor()->tqsetAlignment(AlignRight);
// I want to be able to omit the day
// an empty string just removes the special value, so set white space
- setSpecialValueText(QChar(' '));
+ setSpecialValueText(TQChar(' '));
}
-DateWidget::DateWidget(QWidget* parent_, const char* name_) : QWidget(parent_, name_) {
- QHBoxLayout* l = new QHBoxLayout(this, 0, 4);
+DateWidget::DateWidget(TQWidget* tqparent_, const char* name_) : TQWidget(tqparent_, name_) {
+ TQHBoxLayout* l = new TQHBoxLayout(this, 0, 4);
KLocale* locale = KGlobal::locale();
@@ -52,10 +52,10 @@ DateWidget::DateWidget(QWidget* parent_, const char* name_) : QWidget(parent_, n
m_monthCombo = new KComboBox(false, this);
l->addWidget(m_monthCombo, 1);
// allow empty item
- m_monthCombo->insertItem(QString::null);
- QDate d;
+ m_monthCombo->insertItem(TQString());
+ TQDate d;
for(int i = 1; ; ++i) {
- QString str = locale->calendar()->monthName(i, locale->calendar()->year(d));
+ TQString str = locale->calendar()->monthName(i, locale->calendar()->year(d));
if(str.isNull()) {
break;
}
@@ -66,87 +66,87 @@ DateWidget::DateWidget(QWidget* parent_, const char* name_) : QWidget(parent_, n
locale->calendar()->maxValidYear(), this);
l->addWidget(m_yearSpin, 1);
- connect(m_daySpin, SIGNAL(valueChanged(int)), SLOT(slotDateChanged()));
- connect(m_monthCombo, SIGNAL(activated(int)), SLOT(slotDateChanged()));
- connect(m_yearSpin, SIGNAL(valueChanged(int)), SLOT(slotDateChanged()));
+ connect(m_daySpin, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotDateChanged()));
+ connect(m_monthCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotDateChanged()));
+ connect(m_yearSpin, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotDateChanged()));
m_dateButton = new KPushButton(this);
- m_dateButton->setIconSet(SmallIconSet(QString::fromLatin1("date")));
- connect(m_dateButton, SIGNAL(clicked()), SLOT(slotShowPicker()));
+ m_dateButton->setIconSet(SmallIconSet(TQString::tqfromLatin1("date")));
+ connect(m_dateButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotShowPicker()));
l->addWidget(m_dateButton, 0);
- m_frame = new QVBox(0, 0, WType_Popup);
- m_frame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
+ m_frame = new TQVBox(0, 0, WType_Popup);
+ m_frame->setFrameStyle(TQFrame::PopupPanel | TQFrame::Raised);
m_frame->setLineWidth(3);
m_frame->hide();
m_picker = new KDatePicker(m_frame, 0); // must include name to get correct constructor
- connect(m_picker, SIGNAL(dateEntered(QDate)), SLOT(slotDateEntered(QDate)));
- connect(m_picker, SIGNAL(dateSelected(QDate)), SLOT(slotDateSelected(QDate)));
+ connect(m_picker, TQT_SIGNAL(dateEntered(TQDate)), TQT_SLOT(slotDateEntered(TQDate)));
+ connect(m_picker, TQT_SIGNAL(dateSelected(TQDate)), TQT_SLOT(slotDateSelected(TQDate)));
}
void DateWidget::slotDateChanged() {
int day = m_daySpin->value();
- day = QMIN(QMAX(day, m_daySpin->minValue()), m_daySpin->maxValue());
+ day = TQMIN(TQMAX(day, m_daySpin->minValue()), m_daySpin->maxValue());
int m = m_monthCombo->currentItem();
- m = QMIN(QMAX(m, 0), m_monthCombo->count()-1);
+ m = TQMIN(TQMAX(m, 0), m_monthCombo->count()-1);
int y = m_yearSpin->value();
- y = QMIN(QMAX(y, m_yearSpin->minValue()), m_yearSpin->maxValue());
+ y = TQMIN(TQMAX(y, m_yearSpin->minValue()), m_yearSpin->maxValue());
// if all are valid, set this date
if(day > m_daySpin->minValue() && m > 0 && y > m_yearSpin->minValue()) {
- QDate d(y, m, day);
+ TQDate d(y, m, day);
setDate(d);
}
emit signalModified();
}
-QDate DateWidget::date() const {
+TQDate DateWidget::date() const {
// possible for either day, month, or year to be empty
// in which case a null date is returned
int day = m_daySpin->value();
// min value is the empty one
if(day == m_daySpin->minValue()) {
- return QDate();
+ return TQDate();
}
int month = m_monthCombo->currentItem();
if(month == 0) {
- return QDate();
+ return TQDate();
}
int year = m_yearSpin->value();
if(year == m_yearSpin->minValue()) {
- return QDate();
+ return TQDate();
}
- return QDate(year, month, day);
+ return TQDate(year, month, day);
}
-QString DateWidget::text() const {
+TQString DateWidget::text() const {
// possible for either day, month, or year to be empty
// but not all three
bool empty = true;
// format is "year-month-day"
- QString s;
+ TQString s;
if(m_yearSpin->value() > m_yearSpin->minValue()) {
- s += QString::number(m_yearSpin->value());
+ s += TQString::number(m_yearSpin->value());
empty = false;
}
s += '-';
// first item is empty
if(m_monthCombo->currentItem() > 0) {
- s += QString::number(m_monthCombo->currentItem());
+ s += TQString::number(m_monthCombo->currentItem());
empty = false;
}
s += '-';
if(m_daySpin->value() > m_daySpin->minValue()) {
- s += QString::number(m_daySpin->value());
+ s += TQString::number(m_daySpin->value());
empty = false;
}
- return empty ? QString() : s;
+ return empty ? TQString() : s;
}
-void DateWidget::setDate(const QDate& date_) {
+void DateWidget::setDate(const TQDate& date_) {
m_daySpin->blockSignals(true);
m_monthCombo->blockSignals(true);
m_yearSpin->blockSignals(true);
@@ -162,19 +162,19 @@ void DateWidget::setDate(const QDate& date_) {
m_yearSpin->blockSignals(false);
}
-void DateWidget::setDate(const QString& date_) {
+void DateWidget::setDate(const TQString& date_) {
m_daySpin->blockSignals(true);
m_monthCombo->blockSignals(true);
m_yearSpin->blockSignals(true);
- QStringList s = QStringList::split('-', date_, true);
+ TQStringList s = TQStringList::split('-', date_, true);
bool ok = true;
int y = s.count() > 0 ? s[0].toInt(&ok) : m_yearSpin->minValue();
if(!ok) {
y = m_yearSpin->minValue();
ok = true;
}
- y = QMIN(QMAX(y, m_yearSpin->minValue()), m_yearSpin->maxValue());
+ y = TQMIN(TQMAX(y, m_yearSpin->minValue()), m_yearSpin->maxValue());
m_yearSpin->setValue(y);
int m = s.count() > 1 ? s[1].toInt(&ok) : 0;
@@ -182,12 +182,12 @@ void DateWidget::setDate(const QString& date_) {
m = 0;
ok = true;
}
- m = QMIN(QMAX(m, 0), m_monthCombo->count()-1);
+ m = TQMIN(TQMAX(m, 0), m_monthCombo->count()-1);
m_monthCombo->setCurrentItem(m);
// need to update number of days in month
// for now set date to 1
- QDate date(y, (m == 0 ? 1 : m), 1);
+ TQDate date(y, (m == 0 ? 1 : m), 1);
m_daySpin->blockSignals(true);
m_daySpin->setMaxValue(KGlobal::locale()->calendar()->daysInMonth(date));
m_daySpin->blockSignals(false);
@@ -196,7 +196,7 @@ void DateWidget::setDate(const QString& date_) {
if(!ok) {
day = m_daySpin->minValue();
}
- day = QMIN(QMAX(day, m_daySpin->minValue()), m_daySpin->maxValue());
+ day = TQMIN(TQMAX(day, m_daySpin->minValue()), m_daySpin->maxValue());
m_daySpin->setValue(day);
m_daySpin->blockSignals(false);
@@ -205,7 +205,7 @@ void DateWidget::setDate(const QString& date_) {
// if all are valid, set this date
if(day > m_daySpin->minValue() && m > 0 && y > m_yearSpin->minValue()) {
- QDate d(y, m, day);
+ TQDate d(y, m, day);
m_picker->blockSignals(true);
m_picker->setDate(d);
m_picker->blockSignals(false);
@@ -221,7 +221,7 @@ void DateWidget::clear() {
m_daySpin->setValue(m_daySpin->minValue());
m_monthCombo->setCurrentItem(0);
m_yearSpin->setValue(m_yearSpin->minValue());
- m_picker->setDate(QDate::currentDate());
+ m_picker->setDate(TQDate::tqcurrentDate());
m_daySpin->blockSignals(false);
m_monthCombo->blockSignals(false);
@@ -230,16 +230,16 @@ void DateWidget::clear() {
}
void DateWidget::slotShowPicker() {
- QRect desk = KGlobalSettings::desktopGeometry(this);
- QPoint popupPoint = mapToGlobal(QPoint(0, 0));
+ TQRect desk = KGlobalSettings::desktopGeometry(this);
+ TQPoint popupPoint = mapToGlobal(TQPoint(0, 0));
- int dateFrameHeight = m_frame->sizeHint().height();
+ int dateFrameHeight = m_frame->tqsizeHint().height();
if(popupPoint.y() + height() + dateFrameHeight > desk.bottom()) {
popupPoint.setY(popupPoint.y() - dateFrameHeight);
} else {
popupPoint.setY(popupPoint.y() + height());
}
- int dateFrameWidth = m_frame->sizeHint().width();
+ int dateFrameWidth = m_frame->tqsizeHint().width();
if(popupPoint.x() + dateFrameWidth > desk.right()) {
popupPoint.setX(desk.right() - dateFrameWidth);
}
@@ -253,7 +253,7 @@ void DateWidget::slotShowPicker() {
m_frame->move(popupPoint);
- QDate d = date();
+ TQDate d = date();
if(d.isValid()) {
m_picker->setDate(d);
}
@@ -261,7 +261,7 @@ void DateWidget::slotShowPicker() {
m_frame->show();
}
-void DateWidget::slotDateSelected(QDate date_) {
+void DateWidget::slotDateSelected(TQDate date_) {
if(date_.isValid()) {
setDate(date_);
emit signalModified();
@@ -269,7 +269,7 @@ void DateWidget::slotDateSelected(QDate date_) {
}
}
-void DateWidget::slotDateEntered(QDate date_) {
+void DateWidget::slotDateEntered(TQDate date_) {
if(date_.isValid()) {
setDate(date_);
emit signalModified();
diff --git a/src/gui/datewidget.h b/src/gui/datewidget.h
index 93d7bcb..9575af9 100644
--- a/src/gui/datewidget.h
+++ b/src/gui/datewidget.h
@@ -14,40 +14,42 @@
#ifndef TELLICODATEWIDGET_H
#define TELLICODATEWIDGET_H
-#include <qspinbox.h>
-#include <qdatetime.h>
+#include <tqspinbox.h>
+#include <tqdatetime.h>
class KComboBox;
class KPushButton;
class KDatePicker;
-class QVBox;
-class QString;
+class TQVBox;
+class TQString;
namespace Tellico {
namespace GUI {
-class SpinBox : public QSpinBox {
+class SpinBox : public TQSpinBox {
Q_OBJECT
+ TQ_OBJECT
public:
- SpinBox(int min, int max, QWidget *parent);
+ SpinBox(int min, int max, TQWidget *tqparent);
};
/**
* @author Robby Stephenson
*/
-class DateWidget : public QWidget {
+class DateWidget : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- DateWidget(QWidget* parent, const char* name = 0);
+ DateWidget(TQWidget* tqparent, const char* name = 0);
~DateWidget() {}
- QDate date() const;
- QString text() const;
- void setDate(const QDate& date);
- void setDate(const QString& date);
+ TQDate date() const;
+ TQString text() const;
+ void setDate(const TQDate& date);
+ void setDate(const TQString& date);
void clear();
signals:
@@ -56,8 +58,8 @@ signals:
private slots:
void slotDateChanged();
void slotShowPicker();
- void slotDateSelected(QDate newDate);
- void slotDateEntered(QDate newDate);
+ void slotDateSelected(TQDate newDate);
+ void slotDateEntered(TQDate newDate);
private:
SpinBox* m_daySpin;
@@ -65,7 +67,7 @@ private:
SpinBox* m_yearSpin;
KPushButton* m_dateButton;
- QVBox* m_frame;
+ TQVBox* m_frame;
KDatePicker* m_picker;
};
diff --git a/src/gui/fieldwidget.cpp b/src/gui/fieldwidget.cpp
index 6a9fc66..0983217 100644
--- a/src/gui/fieldwidget.cpp
+++ b/src/gui/fieldwidget.cpp
@@ -28,13 +28,13 @@
#include <kurllabel.h>
#include <klocale.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
-#include <qregexp.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qstyle.h>
-#include <qtimer.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
+#include <tqregexp.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqstyle.h>
+#include <tqtimer.h>
namespace {
// if you change this, update numberfieldwidget, too
@@ -43,40 +43,40 @@ namespace {
using Tellico::GUI::FieldWidget;
-const QRegExp FieldWidget::s_semiColon = QRegExp(QString::fromLatin1("\\s*;\\s*"));
+const TQRegExp FieldWidget::s_semiColon = TQRegExp(TQString::tqfromLatin1("\\s*;\\s*"));
-FieldWidget* FieldWidget::create(Data::FieldPtr field_, QWidget* parent_, const char* name_) {
+FieldWidget* FieldWidget::create(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_) {
switch (field_->type()) {
case Data::Field::Line:
- return new GUI::LineFieldWidget(field_, parent_, name_);
+ return new GUI::LineFieldWidget(field_, tqparent_, name_);
case Data::Field::Para:
- return new GUI::ParaFieldWidget(field_, parent_, name_);
+ return new GUI::ParaFieldWidget(field_, tqparent_, name_);
case Data::Field::Bool:
- return new GUI::BoolFieldWidget(field_, parent_, name_);
+ return new GUI::BoolFieldWidget(field_, tqparent_, name_);
case Data::Field::Number:
- return new GUI::NumberFieldWidget(field_, parent_, name_);
+ return new GUI::NumberFieldWidget(field_, tqparent_, name_);
case Data::Field::Choice:
- return new GUI::ChoiceFieldWidget(field_, parent_, name_);
+ return new GUI::ChoiceFieldWidget(field_, tqparent_, name_);
case Data::Field::Table:
case Data::Field::Table2:
- return new GUI::TableFieldWidget(field_, parent_, name_);
+ return new GUI::TableFieldWidget(field_, tqparent_, name_);
case Data::Field::Date:
- return new GUI::DateFieldWidget(field_, parent_, name_);
+ return new GUI::DateFieldWidget(field_, tqparent_, name_);
case Data::Field::URL:
- return new GUI::URLFieldWidget(field_, parent_, name_);
+ return new GUI::URLFieldWidget(field_, tqparent_, name_);
case Data::Field::Image:
- return new GUI::ImageFieldWidget(field_, parent_, name_);
+ return new GUI::ImageFieldWidget(field_, tqparent_, name_);
case Data::Field::Rating:
- return new GUI::RatingFieldWidget(field_, parent_, name_);
+ return new GUI::RatingFieldWidget(field_, tqparent_, name_);
case Data::Field::ReadOnly:
case Data::Field::Dependent:
@@ -89,23 +89,23 @@ FieldWidget* FieldWidget::create(Data::FieldPtr field_, QWidget* parent_, const
}
}
-FieldWidget::FieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : QWidget(parent_, name_), m_field(field_) {
- QHBoxLayout* l = new QHBoxLayout(this, 2, 2); // parent, margin, spacing
+FieldWidget::FieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : TQWidget(tqparent_, name_), m_field(field_) {
+ TQHBoxLayout* l = new TQHBoxLayout(this, 2, 2); // tqparent, margin, spacing
l->addSpacing(4); // add some more space in the columns between widgets
- if(QCString(style().name()).lower().find("keramik", 0, false) > -1) {
+ if(TQCString(tqstyle().name()).lower().tqfind("keramik", 0, false) > -1) {
l->setMargin(1);
}
Data::Field::Type type = field_->type();
- QString s = i18n("Edit Label", "%1:").arg(field_->title());
+ TQString s = i18n("Edit Label", "%1:").tqarg(field_->title());
if(type == Data::Field::URL) {
// set URL to null for now
- m_label = new KURLLabel(QString::null, s, this);
+ m_label = new KURLLabel(TQString(), s, this);
} else {
- m_label = new QLabel(s, this);
+ m_label = new TQLabel(s, this);
}
- m_label->setFixedWidth(m_label->sizeHint().width());
+ m_label->setFixedWidth(m_label->tqsizeHint().width());
l->addWidget(m_label);
// expands indicates if the edit widget should expand to full width of widget
@@ -118,15 +118,15 @@ FieldWidget::FieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* na
|| type == Data::Field::Image
|| type == Data::Field::Date);
- m_editMultiple = new QCheckBox(this);
+ m_editMultiple = new TQCheckBox(this);
m_editMultiple->setChecked(true);
- m_editMultiple->setFixedWidth(m_editMultiple->sizeHint().width()); // don't let it have any extra space
- connect(m_editMultiple, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ m_editMultiple->setFixedWidth(m_editMultiple->tqsizeHint().width()); // don't let it have any extra space
+ connect(m_editMultiple, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setEnabled(bool)));
l->addWidget(m_editMultiple);
- QWhatsThis::add(this, field_->description());
+ TQWhatsThis::add(this, field_->description());
// after letting the subclass get created, insert default value
- QTimer::singleShot(0, this, SLOT(insertDefault()));
+ TQTimer::singleShot(0, this, TQT_SLOT(insertDefault()));
}
void FieldWidget::insertDefault() {
@@ -147,7 +147,7 @@ void FieldWidget::setEnabled(bool enabled_) {
}
int FieldWidget::labelWidth() const {
- return m_label->sizeHint().width();
+ return m_label->tqsizeHint().width();
}
void FieldWidget::setLabelWidth(int width_) {
@@ -166,23 +166,23 @@ void FieldWidget::editMultiple(bool show_) {
// FIXME: maybe modified should only be signaled when the button is toggle on
if(show_) {
m_editMultiple->show();
- connect(m_editMultiple, SIGNAL(clicked()), this, SIGNAL(modified()));
+ connect(m_editMultiple, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(modified()));
} else {
m_editMultiple->hide();
- disconnect(m_editMultiple, SIGNAL(clicked()), this, SIGNAL(modified()));
+ disconnect(m_editMultiple, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(modified()));
}
// the widget length needs to be updated since it gets shorter
widget()->updateGeometry();
}
void FieldWidget::registerWidget() {
- QWidget* w = widget();
+ TQWidget* w = widget();
m_label->setBuddy(w);
if(w->isFocusEnabled()) {
setFocusProxy(w);
}
- QHBoxLayout* l = static_cast<QHBoxLayout*>(layout());
+ TQHBoxLayout* l = static_cast<TQHBoxLayout*>(tqlayout());
l->insertWidget(FIELD_EDIT_WIDGET_INDEX, w, m_expands ? 1 : 0 /*stretch*/);
if(!m_expands) {
l->insertStretch(FIELD_EDIT_WIDGET_INDEX+1, 1 /*stretch*/);
@@ -192,9 +192,9 @@ void FieldWidget::registerWidget() {
void FieldWidget::updateField(Data::FieldPtr oldField_, Data::FieldPtr newField_) {
m_field = newField_;
- m_label->setText(i18n("Edit Label", "%1:").arg(newField_->title()));
+ m_label->setText(i18n("Edit Label", "%1:").tqarg(newField_->title()));
updateGeometry();
- QWhatsThis::add(this, newField_->description());
+ TQWhatsThis::add(this, newField_->description());
updateFieldHook(oldField_, newField_);
}
diff --git a/src/gui/fieldwidget.h b/src/gui/fieldwidget.h
index dd34ebb..1bd9582 100644
--- a/src/gui/fieldwidget.h
+++ b/src/gui/fieldwidget.h
@@ -16,12 +16,12 @@
#include "../datavectors.h"
-#include <qwidget.h>
-#include <qregexp.h>
+#include <tqwidget.h>
+#include <tqregexp.h>
-class QLabel;
-class QCheckBox;
-class QString;
+class TQLabel;
+class TQCheckBox;
+class TQString;
namespace Tellico {
namespace Data {
@@ -35,16 +35,17 @@ namespace Tellico {
*
* @author Robby Stephenson
*/
-class FieldWidget : public QWidget {
+class FieldWidget : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- FieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ FieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~FieldWidget() {}
Data::FieldPtr field() const { return m_field; }
- virtual QString text() const = 0;
- virtual void setText(const QString& text) = 0;
+ virtual TQString text() const = 0;
+ virtual void setText(const TQString& text) = 0;
int labelWidth() const;
void setLabelWidth(int width);
@@ -55,10 +56,10 @@ public:
void updateField(Data::FieldPtr oldField, Data::FieldPtr newField);
// only used by LineFieldWidget, really
- virtual void addCompletionObjectItem(const QString&) {}
+ virtual void addCompletionObjectItem(const TQString&) {}
// factory function
- static FieldWidget* create(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ static FieldWidget* create(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
public slots:
virtual void insertDefault();
@@ -69,19 +70,19 @@ signals:
virtual void modified();
protected:
- QLabel* label() { return m_label; } // needed so the URLField can handle clicks on the label
- virtual QWidget* widget() = 0;
+ TQLabel* label() { return m_label; } // needed so the URLField can handle clicks on the label
+ virtual TQWidget* widget() = 0;
void registerWidget();
// not all widgets have to be updated when the field changes
virtual void updateFieldHook(Data::FieldPtr, Data::FieldPtr) {}
- static const QRegExp s_semiColon;
+ static const TQRegExp s_semiColon;
private:
Data::FieldPtr m_field;
- QLabel* m_label;
- QCheckBox* m_editMultiple;
+ TQLabel* m_label;
+ TQCheckBox* m_editMultiple;
bool m_expands;
};
diff --git a/src/gui/imagefieldwidget.cpp b/src/gui/imagefieldwidget.cpp
index 2cb9b40..253f5f3 100644
--- a/src/gui/imagefieldwidget.cpp
+++ b/src/gui/imagefieldwidget.cpp
@@ -18,21 +18,21 @@
using Tellico::GUI::ImageFieldWidget;
-ImageFieldWidget::ImageFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : FieldWidget(field_, parent_, name_) {
+ImageFieldWidget::ImageFieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : FieldWidget(field_, tqparent_, name_) {
m_widget = new ImageWidget(this);
- m_widget->setLinkOnlyChecked(field_->property(QString::fromLatin1("link")) == Latin1Literal("true"));
- connect(m_widget, SIGNAL(signalModified()), SIGNAL(modified()));
+ m_widget->setLinkOnlyChecked(field_->property(TQString::tqfromLatin1("link")) == Latin1Literal("true"));
+ connect(m_widget, TQT_SIGNAL(signalModified()), TQT_SIGNAL(modified()));
registerWidget();
}
-QString ImageFieldWidget::text() const {
+TQString ImageFieldWidget::text() const {
return m_widget->id();
}
-void ImageFieldWidget::setText(const QString& text_) {
+void ImageFieldWidget::setText(const TQString& text_) {
blockSignals(true);
m_widget->blockSignals(true);
@@ -47,7 +47,7 @@ void ImageFieldWidget::clear() {
editMultiple(false);
}
-QWidget* ImageFieldWidget::widget() {
+TQWidget* ImageFieldWidget::widget() {
return m_widget;
}
diff --git a/src/gui/imagefieldwidget.h b/src/gui/imagefieldwidget.h
index b5ebea5..81b952d 100644
--- a/src/gui/imagefieldwidget.h
+++ b/src/gui/imagefieldwidget.h
@@ -17,7 +17,7 @@
#include "fieldwidget.h"
#include "../datavectors.h"
-class QString;
+class TQString;
namespace Tellico {
namespace GUI {
@@ -28,19 +28,20 @@ namespace Tellico {
*/
class ImageFieldWidget : public FieldWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- ImageFieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ ImageFieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~ImageFieldWidget() {}
- virtual QString text() const;
- virtual void setText(const QString& text);
+ virtual TQString text() const;
+ virtual void setText(const TQString& text);
public slots:
virtual void clear();
protected:
- virtual QWidget* widget();
+ virtual TQWidget* widget();
private:
ImageWidget* m_widget;
diff --git a/src/gui/imagewidget.cpp b/src/gui/imagewidget.cpp
index 92f75c3..575c734 100644
--- a/src/gui/imagewidget.cpp
+++ b/src/gui/imagewidget.cpp
@@ -24,12 +24,12 @@
#include <kurldrag.h>
#include <kmessagebox.h>
-#include <qwmatrix.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qdragobject.h>
-#include <qapplication.h> // needed for drag distance
+#include <tqwmatrix.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqdragobject.h>
+#include <tqapplication.h> // needed for drag distance
namespace {
static const uint IMAGE_WIDGET_BUTTON_MARGIN = 8;
@@ -40,28 +40,28 @@ namespace {
using Tellico::GUI::ImageWidget;
-ImageWidget::ImageWidget(QWidget* parent_, const char* name_) : QWidget(parent_, name_) {
- QHBoxLayout* l = new QHBoxLayout(this);
+ImageWidget::ImageWidget(TQWidget* tqparent_, const char* name_) : TQWidget(tqparent_, name_) {
+ TQHBoxLayout* l = new TQHBoxLayout(this);
l->setMargin(IMAGE_WIDGET_BUTTON_MARGIN);
- m_label = new QLabel(this);
- m_label->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored));
- m_label->setFrameStyle(QFrame::Panel | QFrame::Sunken);
- m_label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
+ m_label = new TQLabel(this);
+ m_label->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Ignored));
+ m_label->setFrameStyle(TQFrame::Panel | TQFrame::Sunken);
+ m_label->tqsetAlignment(TQt::AlignHCenter | TQt::AlignVCenter);
l->addWidget(m_label, 1);
l->addSpacing(IMAGE_WIDGET_BUTTON_MARGIN);
- QVBoxLayout* boxLayout = new QVBoxLayout(l);
+ TQVBoxLayout* boxLayout = new TQVBoxLayout(l);
boxLayout->addStretch(1);
- KButtonBox* box = new KButtonBox(this, Vertical);
- box->addButton(i18n("Select Image..."), this, SLOT(slotGetImage()));
- box->addButton(i18n("Clear"), this, SLOT(slotClear()));
- box->layout();
+ KButtonBox* box = new KButtonBox(this,Qt::Vertical);
+ box->addButton(i18n("Select Image..."), TQT_TQOBJECT(this), TQT_SLOT(slotGetImage()));
+ box->addButton(i18n("Clear"), TQT_TQOBJECT(this), TQT_SLOT(slotClear()));
+ box->tqlayout();
boxLayout->addWidget(box);
boxLayout->addSpacing(8);
- m_cbLinkOnly = new QCheckBox(i18n("Save link only"), this);
- connect(m_cbLinkOnly, SIGNAL(clicked()), SLOT(slotLinkOnlyClicked()));
+ m_cbLinkOnly = new TQCheckBox(i18n("Save link only"), this);
+ connect(m_cbLinkOnly, TQT_SIGNAL(clicked()), TQT_SLOT(slotLinkOnlyClicked()));
boxLayout->addWidget(m_cbLinkOnly);
boxLayout->addStretch(1);
@@ -71,7 +71,7 @@ ImageWidget::ImageWidget(QWidget* parent_, const char* name_) : QWidget(parent_,
setAcceptDrops(true);
}
-void ImageWidget::setImage(const QString& id_) {
+void ImageWidget::setImage(const TQString& id_) {
if(id_.isEmpty()) {
slotClear();
return;
@@ -83,7 +83,7 @@ void ImageWidget::setImage(const QString& id_) {
m_cbLinkOnly->setEnabled(link);
// if we're using a link, then the original URL _is_ the id
m_originalURL = link ? id_ : KURL();
- m_scaled = QPixmap();
+ m_scaled = TQPixmap();
scale();
update();
@@ -95,8 +95,8 @@ void ImageWidget::setLinkOnlyChecked(bool link_) {
void ImageWidget::slotClear() {
// m_image = Data::Image();
- m_imageID = QString();
- m_pixmap = QPixmap();
+ m_imageID = TQString();
+ m_pixmap = TQPixmap();
m_scaled = m_pixmap;
m_originalURL = KURL();
@@ -123,7 +123,7 @@ void ImageWidget::scale() {
newHeight = static_cast<int>(static_cast<double>(ph)*ww/static_cast<double>(pw));
}
- QWMatrix wm;
+ TQWMatrix wm;
wm.scale(static_cast<double>(newWidth)/pw, static_cast<double>(newHeight)/ph);
m_scaled = m_pixmap.xForm(wm);
} else {
@@ -132,7 +132,7 @@ void ImageWidget::scale() {
m_label->setPixmap(m_scaled);
}
-void ImageWidget::resizeEvent(QResizeEvent *) {
+void ImageWidget::resizeEvent(TQResizeEvent *) {
if(m_pixmap.isNull()) {
return;
}
@@ -142,7 +142,7 @@ void ImageWidget::resizeEvent(QResizeEvent *) {
}
void ImageWidget::slotGetImage() {
- KURL url = KFileDialog::getImageOpenURL(QString::null, this);
+ KURL url = KFileDialog::getImageOpenURL(TQString(), this);
if(url.isEmpty() || !url.isValid()) {
return;
}
@@ -168,53 +168,53 @@ void ImageWidget::slotLinkOnlyClicked() {
// so it needs to be added to the cache all over again
// probably could do this without downloading the image all over again,
// but I'm not going to do that right now
- const QString& id = ImageFactory::addImage(m_originalURL, false, KURL(), link);
+ const TQString& id = ImageFactory::addImage(m_originalURL, false, KURL(), link);
// same image, so no need to call setImage
m_imageID = id;
emit signalModified();
}
-void ImageWidget::mousePressEvent(QMouseEvent* event_) {
+void ImageWidget::mousePressEvent(TQMouseEvent* event_) {
// Only interested in LMB
if(event_->button() == Qt::LeftButton) {
// Store the position of the mouse press.
// check if position is inside the label
- if(m_label->geometry().contains(event_->pos())) {
+ if(m_label->tqgeometry().tqcontains(event_->pos())) {
m_dragStart = event_->pos();
} else {
- m_dragStart = QPoint();
+ m_dragStart = TQPoint();
}
}
}
-void ImageWidget::mouseMoveEvent(QMouseEvent* event_) {
- int delay = QApplication::startDragDistance();
+void ImageWidget::mouseMoveEvent(TQMouseEvent* event_) {
+ int delay = TQApplication::startDragDistance();
// Only interested in LMB
if(event_->state() & Qt::LeftButton) {
// only allow drag is the image is non-null, and the drag start point isn't null and the user dragged far enough
if(!m_imageID.isEmpty() && !m_dragStart.isNull() && (m_dragStart - event_->pos()).manhattanLength() > delay) {
const Data::Image& img = ImageFactory::imageById(m_imageID);
if(!img.isNull()) {
- QImageDrag* drag = new QImageDrag(img, this);
+ TQImageDrag* drag = new TQImageDrag(img, this);
drag->dragCopy();
}
}
}
}
-void ImageWidget::dragEnterEvent(QDragEnterEvent* event_) {
- event_->accept(KURLDrag::canDecode(event_) || QImageDrag::canDecode(event_) || QTextDrag::canDecode(event_));
+void ImageWidget::dragEnterEvent(TQDragEnterEvent* event_) {
+ event_->accept(KURLDrag::canDecode(event_) || TQImageDrag::canDecode(event_) || TQTextDrag::canDecode(event_));
}
-void ImageWidget::dropEvent(QDropEvent* event_) {
- QImage image;
+void ImageWidget::dropEvent(TQDropEvent* event_) {
+ TQImage image;
KURL::List urls;
- QString text;
+ TQString text;
- GUI::CursorSaver cs(Qt::busyCursor);
- if(QImageDrag::decode(event_, image)) {
- // Qt reads PNG data by default
- const QString& id = ImageFactory::addImage(image, QString::fromLatin1("PNG"));
+ GUI::CursorSaver cs(TQt::busyCursor);
+ if(TQImageDrag::decode(event_, image)) {
+ // TQt reads PNG data by default
+ const TQString& id = ImageFactory::addImage(image, TQString::tqfromLatin1("PNG"));
if(!id.isEmpty() && id != m_imageID) {
setImage(id);
emit signalModified();
@@ -230,7 +230,7 @@ void ImageWidget::dropEvent(QDropEvent* event_) {
}
// kdDebug() << "ImageWidget::dropEvent() - " << url.prettyURL() << endl;
loadImage(url);
- } else if(QTextDrag::decode(event_, text)) {
+ } else if(TQTextDrag::decode(event_, text)) {
KURL url(text);
if(url.isEmpty() || !url.isValid()) {
return;
@@ -244,7 +244,7 @@ void ImageWidget::loadImage(const KURL& url_) {
GUI::CursorSaver cs;
// if we're linking only, then we want the image id to be the same as the url
- const QString& id = ImageFactory::addImage(url_, false, KURL(), link);
+ const TQString& id = ImageFactory::addImage(url_, false, KURL(), link);
if(id != m_imageID) {
setImage(id);
emit signalModified();
diff --git a/src/gui/imagewidget.h b/src/gui/imagewidget.h
index 7780be4..76a7304 100644
--- a/src/gui/imagewidget.h
+++ b/src/gui/imagewidget.h
@@ -15,16 +15,16 @@
#define TELLICOIMAGEWIDGET_H
#include <kurl.h>
-#include <qwidget.h>
-#include <qpixmap.h>
-#include <qpoint.h>
+#include <tqwidget.h>
+#include <tqpixmap.h>
+#include <tqpoint.h>
-class QLabel;
-class QResizeEvent;
-class QMouseEvent;
-class QDragEnterEvent;
-class QDropEvent;
-class QCheckBox;
+class TQLabel;
+class TQResizeEvent;
+class TQMouseEvent;
+class TQDragEnterEvent;
+class TQDropEvent;
+class TQCheckBox;
namespace Tellico {
namespace GUI {
@@ -32,15 +32,16 @@ namespace Tellico {
/**
* @author Robby Stephenson
*/
-class ImageWidget : public QWidget {
+class ImageWidget : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- ImageWidget(QWidget* parent, const char* name = 0);
+ ImageWidget(TQWidget* tqparent, const char* name = 0);
virtual ~ImageWidget() {}
- const QString& id() const { return m_imageID; }
- void setImage(const QString& id);
+ const TQString& id() const { return m_imageID; }
+ void setImage(const TQString& id);
void setLinkOnlyChecked(bool l);
public slots:
@@ -50,11 +51,11 @@ signals:
void signalModified();
protected:
- virtual void resizeEvent(QResizeEvent* ev);
- virtual void mousePressEvent(QMouseEvent* ev);
- virtual void mouseMoveEvent(QMouseEvent* ev);
- virtual void dragEnterEvent(QDragEnterEvent* ev);
- virtual void dropEvent(QDropEvent* ev);
+ virtual void resizeEvent(TQResizeEvent* ev);
+ virtual void mousePressEvent(TQMouseEvent* ev);
+ virtual void mouseMoveEvent(TQMouseEvent* ev);
+ virtual void dragEnterEvent(TQDragEnterEvent* ev);
+ virtual void dropEvent(TQDropEvent* ev);
private slots:
void slotGetImage();
@@ -64,13 +65,13 @@ private:
void scale();
void loadImage(const KURL& url);
- QString m_imageID;
- QPixmap m_pixmap;
- QPixmap m_scaled;
- QLabel* m_label;
- QCheckBox* m_cbLinkOnly;
+ TQString m_imageID;
+ TQPixmap m_pixmap;
+ TQPixmap m_scaled;
+ TQLabel* m_label;
+ TQCheckBox* m_cbLinkOnly;
KURL m_originalURL;
- QPoint m_dragStart;
+ TQPoint m_dragStart;
};
} // end GUI namespace
diff --git a/src/gui/kwidgetlister.cpp b/src/gui/kwidgetlister.cpp
index 80bf31b..ea51900 100644
--- a/src/gui/kwidgetlister.cpp
+++ b/src/gui/kwidgetlister.cpp
@@ -19,11 +19,11 @@
In addition, as a special exception, the copyright holders give
permission to link the code of this library with any edition of
- the Qt library by Trolltech AS, Norway (or with modified versions
- of Qt that use the same license as Qt), and distribute linked
+ the TQt library by Trolltech AS, Norway (or with modified versions
+ of TQt that use the same license as TQt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
- Qt. If you modify this file, you may extend this exception to
+ TQt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
@@ -36,47 +36,47 @@
#include <kpushbutton.h>
#include <kiconloader.h>
-#include <qlayout.h>
-#include <qhbox.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
#include <assert.h>
-KWidgetLister::KWidgetLister( int minWidgets, int maxWidgets, QWidget *parent, const char* name )
- : QWidget( parent, name )
+KWidgetLister::KWidgetLister( int minWidgets, int maxWidgets, TQWidget *tqparent, const char* name )
+ : TQWidget( tqparent, name )
{
mWidgetList.setAutoDelete(TRUE);
- mMinWidgets = QMAX( minWidgets, 1 );
- mMaxWidgets = QMAX( maxWidgets, mMinWidgets + 1 );
+ mMinWidgets = TQMAX( minWidgets, 1 );
+ mMaxWidgets = TQMAX( maxWidgets, mMinWidgets + 1 );
//--------- the button box
- mLayout = new QVBoxLayout(this, 0, 4);
- mButtonBox = new QHBox(this);
+ mLayout = new TQVBoxLayout(this, 0, 4);
+ mButtonBox = new TQHBox(this);
mButtonBox->setSpacing(4);
mLayout->addWidget( mButtonBox );
mBtnMore = new KPushButton( i18n("more widgets","More"), mButtonBox );
- mBtnMore->setIconSet(SmallIconSet(QString::fromLatin1("down")));
+ mBtnMore->setIconSet(SmallIconSet(TQString::tqfromLatin1("down")));
mButtonBox->setStretchFactor( mBtnMore, 0 );
mBtnFewer = new KPushButton( i18n("fewer widgets","Fewer"), mButtonBox );
- mBtnFewer->setIconSet(SmallIconSet(QString::fromLatin1("up")));
+ mBtnFewer->setIconSet(SmallIconSet(TQString::tqfromLatin1("up")));
mButtonBox->setStretchFactor( mBtnFewer, 0 );
- QWidget *spacer = new QWidget( mButtonBox );
+ TQWidget *spacer = new TQWidget( mButtonBox );
mButtonBox->setStretchFactor( spacer, 1 );
mBtnClear = new KPushButton( i18n("clear widgets","Clear"), mButtonBox );
- mBtnClear->setIconSet(SmallIconSet(QString::fromLatin1("locationbar_erase")));
+ mBtnClear->setIconSet(SmallIconSet(TQString::tqfromLatin1("locationbar_erase")));
mButtonBox->setStretchFactor( mBtnClear, 0 );
//---------- connect everything
- connect( mBtnMore, SIGNAL(clicked()),
- this, SLOT(slotMore()) );
- connect( mBtnFewer, SIGNAL(clicked()),
- this, SLOT(slotFewer()) );
- connect( mBtnClear, SIGNAL(clicked()),
- this, SLOT(slotClear()) );
+ connect( mBtnMore, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotMore()) );
+ connect( mBtnFewer, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotFewer()) );
+ connect( mBtnClear, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotClear()) );
enableControls();
}
@@ -112,7 +112,7 @@ void KWidgetLister::slotClear()
setNumberOfShownWidgetsTo( mMinWidgets );
// clear remaining widgets
- QPtrListIterator<QWidget> it( mWidgetList );
+ TQPtrListIterator<TQWidget> it( mWidgetList );
for ( it.toFirst() ; it.current() ; ++it )
clearWidget( (*it) );
@@ -121,11 +121,11 @@ void KWidgetLister::slotClear()
emit clearWidgets();
}
-void KWidgetLister::addWidgetAtEnd(QWidget *w)
+void KWidgetLister::addWidgetAtEnd(TQWidget *w)
{
if (!w) w = this->createWidget(this);
- mLayout->insertWidget( mLayout->findWidget( mButtonBox ), w );
+ mLayout->insertWidget( mLayout->tqfindWidget( mButtonBox ), w );
mWidgetList.append( w );
w->show();
enableControls();
@@ -135,26 +135,26 @@ void KWidgetLister::addWidgetAtEnd(QWidget *w)
void KWidgetLister::removeLastWidget()
{
- // The layout will take care that the
+ // The tqlayout will take care that the
// widget is removed from screen, too.
mWidgetList.removeLast();
enableControls();
emit widgetRemoved();
}
-void KWidgetLister::clearWidget( QWidget* /*aWidget*/ )
+void KWidgetLister::clearWidget( TQWidget* /*aWidget*/ )
{
}
-QWidget* KWidgetLister::createWidget( QWidget* parent )
+TQWidget* KWidgetLister::createWidget( TQWidget* tqparent )
{
- return new QWidget( parent );
+ return new TQWidget( tqparent );
}
void KWidgetLister::setNumberOfShownWidgetsTo( int aNum )
{
- int superfluousWidgets = QMAX( (int)mWidgetList.count() - aNum, 0 );
- int missingWidgets = QMAX( aNum - (int)mWidgetList.count(), 0 );
+ int superfluousWidgets = TQMAX( (int)mWidgetList.count() - aNum, 0 );
+ int missingWidgets = TQMAX( aNum - (int)mWidgetList.count(), 0 );
// remove superfluous widgets
for ( ; superfluousWidgets ; superfluousWidgets-- )
diff --git a/src/gui/kwidgetlister.h b/src/gui/kwidgetlister.h
index e02b54c..c57f1e4 100644
--- a/src/gui/kwidgetlister.h
+++ b/src/gui/kwidgetlister.h
@@ -19,11 +19,11 @@
In addition, as a special exception, the copyright holders give
permission to link the code of this library with any edition of
- the Qt library by Trolltech AS, Norway (or with modified versions
- of Qt that use the same license as Qt), and distribute linked
+ the TQt library by Trolltech AS, Norway (or with modified versions
+ of TQt that use the same license as TQt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
- Qt. If you modify this file, you may extend this exception to
+ TQt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
@@ -32,12 +32,12 @@
#ifndef _KWIDGETLISTER_H_
#define _KWIDGETLISTER_H_
-#include <qwidget.h>
-#include <qptrlist.h>
+#include <tqwidget.h>
+#include <tqptrlist.h>
class KPushButton;
-class QVBoxLayout;
-class QHBox;
+class TQVBoxLayout;
+class TQHBox;
/** Simple widget that nonetheless does a lot of the dirty work for
the filter edit widgets (@ref KMSearchpatternEdit and @ref
@@ -59,30 +59,31 @@ class QHBox;
*/
-class KWidgetLister : public QWidget
+class KWidgetLister : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KWidgetLister( int minWidgets=1, int maxWidgets=8, QWidget* parent=0, const char* name=0 );
+ KWidgetLister( int minWidgets=1, int maxWidgets=8, TQWidget* tqparent=0, const char* name=0 );
virtual ~KWidgetLister();
protected slots:
/** Called whenever the user clicks on the 'more' button.
Reimplementations should call this method, because this
implementation does all the dirty work with adding the widgets
- to the layout (through @ref addWidgetAtEnd) and enabling/disabling
+ to the tqlayout (through @ref addWidgetAtEnd) and enabling/disabling
the control buttons. */
virtual void slotMore();
/** Called whenever the user clicks on the 'fewer' button.
Reimplementations should call this method, because this
implementation does all the dirty work with removing the widgets
- from the layout (through @ref removelastWidget) and
+ from the tqlayout (through @ref removelastWidget) and
enabling/disabling the control buttons. */
virtual void slotFewer();
/** Called whenever the user clicks on the 'clear' button.
Reimplementations should call this method, because this
implementation does all the dirty work with removing all but
- @ref mMinWidets widgets from the layout and enabling/disabling
+ @ref mMinWidets widgets from the tqlayout and enabling/disabling
the control buttons. */
virtual void slotClear();
@@ -96,8 +97,8 @@ protected:
when showing it on screen. Make sure you call this
implementaion, though, since you cannot put the widget on screen
from derived classes (@p mLayout is private).
- Make sure the parent of the QWidget to add is this KWidgetLister. */
- virtual void addWidgetAtEnd(QWidget *w =0);
+ Make sure the tqparent of the TQWidget to add is this KWidgetLister. */
+ virtual void addWidgetAtEnd(TQWidget *w =0);
/** Removes a single (always the last) widget. Doesn't care if there
are still only @ref mMinWidgets left on screen and whether it
should enable/disable any controls. It simply does what it is
@@ -108,12 +109,12 @@ protected:
virtual void removeLastWidget();
/** Called to clear a given widget. The default implementation does
nothing. */
- virtual void clearWidget( QWidget* );
+ virtual void clearWidget( TQWidget* );
/** Because QT 2.x does not support signals/slots in template
classes, we are forced to emulate this by forcing the
implementers of subclasses of KWidgetLister to reimplement this
function which replaces the "@p new @p T" call. */
- virtual QWidget* createWidget( QWidget *parent );
+ virtual TQWidget* createWidget( TQWidget *tqparent );
/** Sets the number of widgets on scrren to exactly @p aNum. Doesn't
check if @p aNum is inside the range @p
[mMinWidgets,mMaxWidgets]. */
@@ -121,7 +122,7 @@ protected:
/** The list of widgets. Note that this list is set to auto-delete,
meaning that widgets that are removed from the screen by either
@ref slotFewer or @ref slotClear will be destroyed! */
- QPtrList<QWidget> mWidgetList;
+ TQPtrList<TQWidget> mWidgetList;
/** The minimum number of widgets that are to stay on screen. */
int mMinWidgets;
/** The maximum number of widgets that are to be shown on screen. */
@@ -131,7 +132,7 @@ signals:
/** This signal is emitted whenever a widget was added */
void widgetAdded();
/** This signal is emitted whenever a widget was added */
- void widgetAdded(QWidget *);
+ void widgetAdded(TQWidget *);
/** This signal is emitted whenever a widget was removed */
void widgetRemoved();
/** This signal is emitted whenever the clear button is clicked */
@@ -141,8 +142,8 @@ private:
void enableControls();
KPushButton *mBtnMore, *mBtnFewer, *mBtnClear;
- QVBoxLayout *mLayout;
- QHBox *mButtonBox;
+ TQVBoxLayout *mLayout;
+ TQHBox *mButtonBox;
};
diff --git a/src/gui/lineedit.cpp b/src/gui/lineedit.cpp
index 6248880..68a403d 100644
--- a/src/gui/lineedit.cpp
+++ b/src/gui/lineedit.cpp
@@ -17,55 +17,55 @@
#include <kactioncollection.h>
#include <kspell.h>
-#include <qapplication.h>
-#include <qpainter.h>
-#include <qpopupmenu.h>
+#include <tqapplication.h>
+#include <tqpainter.h>
+#include <tqpopupmenu.h>
using Tellico::GUI::LineEdit;
-LineEdit::LineEdit(QWidget* parent_, const char* name_) : KLineEdit(parent_, name_)
+LineEdit::LineEdit(TQWidget* tqparent_, const char* name_) : KLineEdit(tqparent_, name_)
, m_drawHint(false)
, m_allowSpellCheck(false)
, m_enableSpellCheck(true)
, m_spell(0) {
- m_spellAction = KStdAction::spelling(this, SLOT(slotCheckSpelling()), new KActionCollection(this));
+ m_spellAction = KStdAction::spelling(TQT_TQOBJECT(this), TQT_SLOT(slotCheckSpelling()), new KActionCollection(this));
}
void LineEdit::clear() {
KLineEdit::clear();
m_drawHint = true;
- repaint();
+ tqrepaint();
}
-void LineEdit::setText(const QString& text_) {
+void LineEdit::setText(const TQString& text_) {
m_drawHint = text_.isEmpty();
- repaint();
+ tqrepaint();
KLineEdit::setText(text_);
}
-void LineEdit::setHint(const QString& hint_) {
+void LineEdit::setHint(const TQString& hint_) {
m_hint = hint_;
m_drawHint = text().isEmpty();
- repaint();
+ tqrepaint();
}
-void LineEdit::focusInEvent(QFocusEvent* event_) {
+void LineEdit::focusInEvent(TQFocusEvent* event_) {
if(m_drawHint) {
m_drawHint = false;
- repaint();
+ tqrepaint();
}
KLineEdit::focusInEvent(event_);
}
-void LineEdit::focusOutEvent(QFocusEvent* event_) {
+void LineEdit::focusOutEvent(TQFocusEvent* event_) {
if(text().isEmpty()) {
m_drawHint = true;
- repaint();
+ tqrepaint();
}
KLineEdit::focusOutEvent(event_);
}
-void LineEdit::drawContents(QPainter* painter_) {
+void LineEdit::drawContents(TQPainter* painter_) {
// draw the regular line edit first
KLineEdit::drawContents(painter_);
@@ -75,12 +75,12 @@ void LineEdit::drawContents(QPainter* painter_) {
}
// save current pen
- QPen oldPen = painter_->pen();
+ TQPen oldPen = painter_->pen();
// follow lead of kdepim and amarok, use disabled text color
- painter_->setPen(palette().color(QPalette::Disabled, QColorGroup::Text));
+ painter_->setPen(palette().color(TQPalette::Disabled, TQColorGroup::Text));
- QRect rect = contentsRect();
+ TQRect rect = contentsRect();
// again, follow kdepim and amarok lead, and pad by 2 pixels
rect.rLeft() += 2;
painter_->drawText(rect, AlignAuto | AlignVCenter, m_hint);
@@ -89,14 +89,14 @@ void LineEdit::drawContents(QPainter* painter_) {
painter_->setPen(oldPen);
}
-QPopupMenu* LineEdit::createPopupMenu() {
- QPopupMenu* popup = KLineEdit::createPopupMenu();
+TQPopupMenu* LineEdit::createPopupMenu() {
+ TQPopupMenu* popup = KLineEdit::createPopupMenu();
if(!popup) {
return popup;
}
- if(m_allowSpellCheck && echoMode() == QLineEdit::Normal && !isReadOnly()) {
+ if(m_allowSpellCheck && echoMode() == TQLineEdit::Normal && !isReadOnly()) {
popup->insertSeparator();
m_spellAction->plug(popup);
@@ -110,22 +110,22 @@ void LineEdit::slotCheckSpelling() {
delete m_spell;
// re-use the action string to get translations
m_spell = new KSpell(this, m_spellAction->text(),
- this, SLOT(slotSpellCheckReady(KSpell*)), 0, true, true);
-
- connect(m_spell, SIGNAL(death()),
- SLOT(spellCheckerFinished()));
- connect(m_spell, SIGNAL(misspelling( const QString &, const QStringList &, unsigned int)),
- SLOT(spellCheckerMisspelling( const QString &, const QStringList &, unsigned int)));
- connect(m_spell, SIGNAL(corrected(const QString &, const QString &, unsigned int)),
- SLOT(spellCheckerCorrected(const QString &, const QString &, unsigned int)));
+ TQT_TQOBJECT(this), TQT_SLOT(slotSpellCheckReady(KSpell*)), 0, true, true);
+
+ connect(m_spell, TQT_SIGNAL(death()),
+ TQT_SLOT(spellCheckerFinished()));
+ connect(m_spell, TQT_SIGNAL(misspelling( const TQString &, const TQStringList &, unsigned int)),
+ TQT_SLOT(spellCheckerMisspelling( const TQString &, const TQStringList &, unsigned int)));
+ connect(m_spell, TQT_SIGNAL(corrected(const TQString &, const TQString &, unsigned int)),
+ TQT_SLOT(spellCheckerCorrected(const TQString &, const TQString &, unsigned int)));
}
void LineEdit::slotSpellCheckReady(KSpell* spell) {
spell->check(text());
- connect(spell, SIGNAL(done(const QString&)), SLOT(slotSpellCheckDone(const QString&)));
+ connect(spell, TQT_SIGNAL(done(const TQString&)), TQT_SLOT(slotSpellCheckDone(const TQString&)));
}
-void LineEdit::slotSpellCheckDone(const QString& newText) {
+void LineEdit::slotSpellCheckDone(const TQString& newText) {
if(newText != text()) {
setText(newText);
}
@@ -136,11 +136,11 @@ void LineEdit::spellCheckerFinished() {
m_spell = 0;
}
-void LineEdit::spellCheckerMisspelling(const QString &text, const QStringList&, unsigned int pos) {
+void LineEdit::spellCheckerMisspelling(const TQString &text, const TQStringList&, unsigned int pos) {
setSelection(pos, pos + text.length());
}
-void LineEdit::spellCheckerCorrected(const QString& oldWord, const QString& newWord, unsigned int pos) {
+void LineEdit::spellCheckerCorrected(const TQString& oldWord, const TQString& newWord, unsigned int pos) {
if(oldWord != newWord) {
setSelection(pos, pos + oldWord.length());
insert(newWord);
diff --git a/src/gui/lineedit.h b/src/gui/lineedit.h
index af7d81b..1c42cbe 100644
--- a/src/gui/lineedit.h
+++ b/src/gui/lineedit.h
@@ -16,7 +16,7 @@
#include <klineedit.h>
-#include <qstring.h>
+#include <tqstring.h>
class KAction;
class KSpell;
@@ -29,12 +29,13 @@ namespace Tellico {
*/
class LineEdit : public KLineEdit {
Q_OBJECT
+ TQ_OBJECT
public:
- LineEdit(QWidget* parent = 0, const char* name = 0);
+ LineEdit(TQWidget* tqparent = 0, const char* name = 0);
- virtual void setText(const QString& text);
- void setHint(const QString& hint);
+ virtual void setText(const TQString& text);
+ void setHint(const TQString& hint);
// by default, spell check is not allowed, and no popupmenu item is created
void setAllowSpellCheck(bool b) { m_allowSpellCheck = b; }
@@ -45,21 +46,21 @@ public slots:
void clear();
protected:
- virtual void focusInEvent(QFocusEvent* event);
- virtual void focusOutEvent(QFocusEvent* event);
- virtual void drawContents(QPainter* painter);
- virtual QPopupMenu* createPopupMenu();
+ virtual void focusInEvent(TQFocusEvent* event);
+ virtual void focusOutEvent(TQFocusEvent* event);
+ virtual void drawContents(TQPainter* painter);
+ virtual TQPopupMenu* createPopupMenu();
private slots:
void slotCheckSpelling();
void slotSpellCheckReady(KSpell* spell);
- void slotSpellCheckDone(const QString& text);
- void spellCheckerMisspelling(const QString& text, const QStringList&, unsigned int pos);
- void spellCheckerCorrected(const QString& oldText, const QString& newText, unsigned int pos);
+ void slotSpellCheckDone(const TQString& text);
+ void spellCheckerMisspelling(const TQString& text, const TQStringList&, unsigned int pos);
+ void spellCheckerCorrected(const TQString& oldText, const TQString& newText, unsigned int pos);
void spellCheckerFinished();
private:
- QString m_hint;
+ TQString m_hint;
bool m_drawHint;
KAction* m_spellAction;
bool m_allowSpellCheck;
diff --git a/src/gui/linefieldwidget.cpp b/src/gui/linefieldwidget.cpp
index 1535832..acc5e33 100644
--- a/src/gui/linefieldwidget.cpp
+++ b/src/gui/linefieldwidget.cpp
@@ -21,13 +21,13 @@
using Tellico::GUI::LineFieldWidget;
-LineFieldWidget::LineFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : FieldWidget(field_, parent_, name_) {
+LineFieldWidget::LineFieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : FieldWidget(field_, tqparent_, name_) {
m_lineEdit = new GUI::LineEdit(this);
m_lineEdit->setAllowSpellCheck(true);
m_lineEdit->setEnableSpellCheck(field_->formatFlag() != Data::Field::FormatName);
- connect(m_lineEdit, SIGNAL(textChanged(const QString&)), SIGNAL(modified()));
+ connect(m_lineEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SIGNAL(modified()));
registerWidget();
@@ -40,19 +40,19 @@ LineFieldWidget::LineFieldWidget(Data::FieldPtr field_, QWidget* parent_, const
}
if(field_->name() == Latin1Literal("isbn")) {
- m_lineEdit->setValidator(new ISBNValidator(this));
+ m_lineEdit->setValidator(new ISBNValidator(TQT_TQOBJECT(this)));
}
}
-QString LineFieldWidget::text() const {
- QString text = m_lineEdit->text();
+TQString LineFieldWidget::text() const {
+ TQString text = m_lineEdit->text();
if(field()->flags() & Data::Field::AllowMultiple) {
- text.replace(s_semiColon, QString::fromLatin1("; "));
+ text.tqreplace(s_semiColon, TQString::tqfromLatin1("; "));
}
return text.stripWhiteSpace();
}
-void LineFieldWidget::setText(const QString& text_) {
+void LineFieldWidget::setText(const TQString& text_) {
blockSignals(true);
m_lineEdit->blockSignals(true);
m_lineEdit->setText(text_);
@@ -65,7 +65,7 @@ void LineFieldWidget::clear() {
editMultiple(false);
}
-void LineFieldWidget::addCompletionObjectItem(const QString& text_) {
+void LineFieldWidget::addCompletionObjectItem(const TQString& text_) {
m_lineEdit->completionObject()->addItem(text_);
}
@@ -83,7 +83,7 @@ void LineFieldWidget::updateFieldHook(Data::FieldPtr oldField_, Data::FieldPtr n
}
}
-QWidget* LineFieldWidget::widget() {
+TQWidget* LineFieldWidget::widget() {
return m_lineEdit;
}
diff --git a/src/gui/linefieldwidget.h b/src/gui/linefieldwidget.h
index 70dc175..cdbfb28 100644
--- a/src/gui/linefieldwidget.h
+++ b/src/gui/linefieldwidget.h
@@ -26,20 +26,21 @@ namespace Tellico {
*/
class LineFieldWidget : public FieldWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- LineFieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ LineFieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~LineFieldWidget() {}
- virtual QString text() const;
- virtual void setText(const QString& text);
- virtual void addCompletionObjectItem(const QString& text);
+ virtual TQString text() const;
+ virtual void setText(const TQString& text);
+ virtual void addCompletionObjectItem(const TQString& text);
public slots:
virtual void clear();
protected:
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual void updateFieldHook(Data::FieldPtr oldField, Data::FieldPtr newField);
private:
diff --git a/src/gui/listboxtext.cpp b/src/gui/listboxtext.cpp
index 8ec6fa2..0d33a7c 100644
--- a/src/gui/listboxtext.cpp
+++ b/src/gui/listboxtext.cpp
@@ -14,34 +14,34 @@
#include "listboxtext.h"
#include "../tellico_utils.h"
-#include <qpainter.h>
+#include <tqpainter.h>
using Tellico::GUI::ListBoxText;
-ListBoxText::ListBoxText(QListBox* listbox_, const QString& text_)
- : QListBoxText(listbox_, text_), m_colored(false) {
+ListBoxText::ListBoxText(TQListBox* listbox_, const TQString& text_)
+ : TQListBoxText(listbox_, text_), m_colored(false) {
}
-ListBoxText::ListBoxText(QListBox* listbox_, const QString& text_, QListBoxItem* after_)
- : QListBoxText(listbox_, text_, after_), m_colored(false) {
+ListBoxText::ListBoxText(TQListBox* listbox_, const TQString& text_, TQListBoxItem* after_)
+ : TQListBoxText(listbox_, text_, after_), m_colored(false) {
}
-int ListBoxText::width(const QListBox* listbox_) const {
+int ListBoxText::width(const TQListBox* listbox_) const {
if(m_colored) {
- QFont font = listbox_->font();
+ TQFont font = listbox_->font();
font.setBold(true);
font.setItalic(true);
- QFontMetrics fm(font);
+ TQFontMetrics fm(font);
return fm.width(text()) + 6;
} else {
- return QListBoxText::width(listbox_);
+ return TQListBoxText::width(listbox_);
}
}
// I don't want the height to change when colored
// so all the items are at the same level for multi-column boxes
-int ListBoxText::height(const QListBox* listbox_) const {
- return QListBoxText::height(listbox_);
+int ListBoxText::height(const TQListBox* listbox_) const {
+ return TQListBoxText::height(listbox_);
}
void ListBoxText::setColored(bool colored_) {
@@ -51,15 +51,15 @@ void ListBoxText::setColored(bool colored_) {
}
}
-void ListBoxText::setText(const QString& text_) {
- QListBoxText::setText(text_);
+void ListBoxText::setText(const TQString& text_) {
+ TQListBoxText::setText(text_);
listBox()->triggerUpdate(true);
}
-// mostly copied from QListBoxText::paint() in Qt 3.1.1
-void ListBoxText::paint(QPainter* painter_) {
+// mostly copied from TQListBoxText::paint() in TQt 3.1.1
+void ListBoxText::paint(TQPainter* painter_) {
if(m_colored) {
- QFont font = painter_->font();
+ TQFont font = painter_->font();
font.setBold(true);
font.setItalic(true);
painter_->setFont(font);
@@ -68,7 +68,7 @@ void ListBoxText::paint(QPainter* painter_) {
}
}
int itemHeight = height(listBox());
- QFontMetrics fm = painter_->fontMetrics();
+ TQFontMetrics fm = painter_->fontMetrics();
int yPos = ((itemHeight - fm.height()) / 2) + fm.ascent();
painter_->drawText(3, yPos, text());
}
diff --git a/src/gui/listboxtext.h b/src/gui/listboxtext.h
index 3cfe2db..03edc95 100644
--- a/src/gui/listboxtext.h
+++ b/src/gui/listboxtext.h
@@ -14,31 +14,31 @@
#ifndef TELLICO_GUI_LISTBOXTEXT_H
#define TELLICO_GUI_LISTBOXTEXT_H
-#include <qlistbox.h>
+#include <tqlistbox.h>
namespace Tellico {
namespace GUI {
/**
- * ListBoxText subclasses QListBoxText so that @ref setText() can be made public,
+ * ListBoxText subclasses TQListBoxText so that @ref setText() can be made public,
* and the font color can be changed
*
* @author Robby Stephenson
*/
-class ListBoxText : public QListBoxText {
+class ListBoxText : public TQListBoxText {
public:
- ListBoxText(QListBox* listbox, const QString& text);
- ListBoxText(QListBox* listbox, const QString& text, QListBoxItem* after);
+ ListBoxText(TQListBox* listbox, const TQString& text);
+ ListBoxText(TQListBox* listbox, const TQString& text, TQListBoxItem* after);
- virtual int width(const QListBox* box) const;
- virtual int height(const QListBox* box) const;
+ virtual int width(const TQListBox* box) const;
+ virtual int height(const TQListBox* box) const;
bool isColored() const { return m_colored; }
void setColored(bool colored);
- void setText(const QString& text);
+ void setText(const TQString& text);
protected:
- virtual void paint(QPainter* painter);
+ virtual void paint(TQPainter* painter);
private:
bool m_colored;
diff --git a/src/gui/listview.cpp b/src/gui/listview.cpp
index d93174c..1816da6 100644
--- a/src/gui/listview.cpp
+++ b/src/gui/listview.cpp
@@ -18,26 +18,26 @@
#include <kapplication.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qheader.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqheader.h>
using Tellico::GUI::ListView;
using Tellico::GUI::ListViewItem;
-ListView::ListView(QWidget* parent_, const char* name_) : KListView(parent_, name_/*=0*/),
+ListView::ListView(TQWidget* tqparent_, const char* name_) : KListView(tqparent_, name_/*=0*/),
m_sortStyle(SortByText), m_isClear(true) {
- setSelectionMode(QListView::Extended);
- connect(this, SIGNAL(selectionChanged()),
- SLOT(slotSelectionChanged()));
- connect(this, SIGNAL(doubleClicked(QListViewItem*)),
- SLOT(slotDoubleClicked(QListViewItem*)));
+ setSelectionMode(TQListView::Extended);
+ connect(this, TQT_SIGNAL(selectionChanged()),
+ TQT_SLOT(slotSelectionChanged()));
+ connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem*)),
+ TQT_SLOT(slotDoubleClicked(TQListViewItem*)));
#if !KDE_IS_VERSION(3,3,90)
m_shadeSortColumn = false;
// call it once to initialize
slotUpdateColors();
#endif
- connect(kapp, SIGNAL(kdisplayPaletteChanged()), SLOT(slotUpdateColors()));
+ connect(kapp, TQT_SIGNAL(kdisplayPaletteChanged()), TQT_SLOT(slotUpdateColors()));
m_comparisons.setAutoDelete(true);
}
@@ -71,8 +71,8 @@ bool ListView::isSelectable(ListViewItem* item_) const {
}
// selecting multiple items is ok
- // only when parent is open. Be careful to check for existence of parent
- if(item_->parent() && !item_->parent()->isOpen()) {
+ // only when tqparent is open. Be careful to check for existence of tqparent
+ if(item_->tqparent() && !item_->tqparent()->isOpen()) {
return false;
}
@@ -111,7 +111,7 @@ int ListView::lastVisibleColumn() const {
return header()->mapToSection(col);
}
-void ListView::setColumnText(int column, const QString& label) {
+void ListView::setColumnText(int column, const TQString& label) {
ListViewComparison* comp = m_comparisons.take(columnText(column));
KListView::setColumnText(column, label);
if(comp) {
@@ -121,7 +121,7 @@ void ListView::setColumnText(int column, const QString& label) {
void ListView::setComparison(int column, ListViewComparison* comp) {
if(comp) {
- m_comparisons.replace(columnText(column), comp);
+ m_comparisons.tqreplace(columnText(column), comp);
}
}
@@ -135,7 +135,7 @@ void ListView::clearComparisons() {
int ListView::compare(int col, const GUI::ListViewItem* item1, GUI::ListViewItem* item2, bool asc) {
if(col >= 0 && col < static_cast<int>(m_comparisons.count())) {
- ListViewComparison* com = m_comparisons.find(columnText(col));
+ ListViewComparison* com = m_comparisons.tqfind(columnText(col));
if(com) {
return com->compare(col, item1, item2, asc);
}
@@ -147,16 +147,16 @@ int ListView::compare(int col, const GUI::ListViewItem* item1, GUI::ListViewItem
void ListView::setShadeSortColumn(bool shade_) {
if(m_shadeSortColumn != shade_) {
m_shadeSortColumn = shade_;
- repaint();
+ tqrepaint();
}
}
#endif
void ListView::slotUpdateColors() {
#if !KDE_IS_VERSION(3,3,90)
- m_backColor2 = viewport()->colorGroup().base();
- if(m_backColor2 == Qt::black) {
- m_backColor2 = QColor(50, 50, 50); // dark gray
+ m_backColor2 = viewport()->tqcolorGroup().base();
+ if(m_backColor2 == TQt::black) {
+ m_backColor2 = TQColor(50, 50, 50); // dark gray
} else {
int h,s,v;
m_backColor2.hsv(&h, &s, &v);
@@ -168,8 +168,8 @@ void ListView::slotUpdateColors() {
}
m_altColor2 = alternateBackground();
- if(m_altColor2 == Qt::black) {
- m_altColor2 = QColor(50, 50, 50); // dark gray
+ if(m_altColor2 == TQt::black) {
+ m_altColor2 = TQColor(50, 50, 50); // dark gray
} else {
int h,s,v;
m_altColor2.hsv(&h, &s, &v);
@@ -180,8 +180,8 @@ void ListView::slotUpdateColors() {
}
}
#endif
- Tellico::updateContrastColor(viewport()->colorGroup());
- repaint();
+ Tellico::updateContrastColor(viewport()->tqcolorGroup());
+ tqrepaint();
}
void ListView::slotSelectionChanged() {
@@ -196,11 +196,11 @@ void ListView::slotSelectionChanged() {
m_isClear = false;
Data::EntryVec entries;
- // now just find all the children or grandchildren that are entry items
+ // now just find all the tqchildren or grandtqchildren that are entry items
for(GUI::ListViewItemListIt it(m_selectedItems); it.current(); ++it) {
Data::EntryVec more = it.current()->entries();
for(Data::EntryVecIt entry = more.begin(); entry != more.end(); ++entry) {
- if(!entries.contains(entry)) {
+ if(!entries.tqcontains(entry)) {
entries.append(entry);
}
}
@@ -209,13 +209,13 @@ void ListView::slotSelectionChanged() {
Controller::self()->slotUpdateSelection(this, entries);
}
-void ListView::slotDoubleClicked(QListViewItem* item_) {
+void ListView::slotDoubleClicked(TQListViewItem* item_) {
if(!item_) {
return;
}
- // if it has children, just open it
- // but some items delay children creation
+ // if it has tqchildren, just open it
+ // but some items delay tqchildren creation
if(static_cast<ListViewItem*>(item_)->realChildCount() > 0) {
item_->setOpen(!item_->isOpen());
}
@@ -224,7 +224,7 @@ void ListView::slotDoubleClicked(QListViewItem* item_) {
item->doubleClicked();
}
-void ListView::drawContentsOffset(QPainter* p, int ox, int oy, int cx, int cy, int cw, int ch) {
+void ListView::drawContentsOffset(TQPainter* p, int ox, int oy, int cx, int cy, int cw, int ch) {
bool oldUpdatesEnabled = isUpdatesEnabled();
setUpdatesEnabled(false);
KListView::drawContentsOffset(p, ox, oy, cx, cy, cw, ch);
@@ -234,8 +234,8 @@ void ListView::drawContentsOffset(QPainter* p, int ox, int oy, int cx, int cy, i
/* ****************** ListViewItem ********************* */
ListViewItem::~ListViewItem() {
- // I think there's a bug in qt where the children of this item are deleted after the item itself
- // as a result, there is no listView() pointer for the children, that obvious causes
+ // I think there's a bug in qt where the tqchildren of this item are deleted after the item itself
+ // as a result, there is no listView() pointer for the tqchildren, that obvious causes
// a problem with updating the selection. So we MUST call clear() here ourselves!
clear();
// be sure to remove from selected list when it's deleted
@@ -246,14 +246,14 @@ ListViewItem::~ListViewItem() {
}
void ListViewItem::clear() {
- QListViewItem* item = firstChild();
+ TQListViewItem* item = firstChild();
while(item) {
delete item;
item = firstChild();
}
}
-int ListViewItem::compare(QListViewItem* item_, int col_, bool asc_) const {
+int ListViewItem::compare(TQListViewItem* item_, int col_, bool asc_) const {
int res = compareWeight(item_, col_, asc_);
if(res != 0) {
return res;
@@ -262,7 +262,7 @@ int ListViewItem::compare(QListViewItem* item_, int col_, bool asc_) const {
return res == 0 ? KListViewItem::compare(item_, col_, asc_) : res;
}
-int ListViewItem::compareWeight(QListViewItem* item_, int col_, bool asc_) const {
+int ListViewItem::compareWeight(TQListViewItem* item_, int col_, bool asc_) const {
Q_UNUSED(col_);
// I want the sorting to be independent of sort order
GUI::ListViewItem* i = static_cast<GUI::ListViewItem*>(item_);
@@ -292,7 +292,7 @@ void ListViewItem::setSelected(bool s_) {
}
}
-QColor ListViewItem::backgroundColor(int column_) {
+TQColor ListViewItem::backgroundColor(int column_) {
#if KDE_IS_VERSION(3,3,90)
return KListViewItem::backgroundColor(column_);
#else
@@ -300,43 +300,43 @@ QColor ListViewItem::backgroundColor(int column_) {
if(view->columns() > 1 && view->shadeSortColumn() && column_ == view->sortColumn()) {
return isAlternate() ? view->alternateBackground2() : view->background2();
}
- return isAlternate() ? view->alternateBackground() : view->viewport()->colorGroup().base();
+ return isAlternate() ? view->alternateBackground() : view->viewport()->tqcolorGroup().base();
#endif
}
-void ListViewItem::paintCell(QPainter* p_, const QColorGroup& cg_,
+void ListViewItem::paintCell(TQPainter* p_, const TQColorGroup& cg_,
int column_, int width_, int align_) {
// taken from klistview.cpp
// I can't call KListViewItem::paintCell since KListViewItem::backgroundCOlor(int) is
// not virtual. I need to be sure to call ListViewItem::backgroundColor(int);
- QColorGroup cg = cg_;
- const QPixmap* pm = listView()->viewport()->backgroundPixmap();
+ TQColorGroup cg = cg_;
+ const TQPixmap* pm = listView()->viewport()->backgroundPixmap();
if(pm && !pm->isNull()) {
- cg.setBrush(QColorGroup::Base, QBrush(backgroundColor(column_), *pm));
- QPoint o = p_->brushOrigin();
+ cg.setBrush(TQColorGroup::Base, TQBrush(backgroundColor(column_), *pm));
+ TQPoint o = p_->brushOrigin();
p_->setBrushOrigin(o.x()-listView()->contentsX(), o.y()-listView()->contentsY());
} else {
- cg.setColor(listView()->viewport()->backgroundMode() == Qt::FixedColor ?
- QColorGroup::Background : QColorGroup::Base,
+ cg.setColor(listView()->viewport()->backgroundMode() == TQt::FixedColor ?
+ TQColorGroup::Background : TQColorGroup::Base,
backgroundColor(column_));
}
// don't call KListViewItem::paintCell() since that also does alternate painting, etc...
- QListViewItem::paintCell(p_, cg, column_, width_, align_);
+ TQListViewItem::paintCell(p_, cg, column_, width_, align_);
// borrowed from amarok, draw line to left of cell
if(!isSelected()) {
- p_->setPen(QPen(listView()->alternateBackground(), 0, Qt::SolidLine));
+ p_->setPen(TQPen(listView()->alternateBackground(), 0, TQt::SolidLine));
p_->drawLine(width_-1, 0, width_-1, height()-1);
}
}
Tellico::Data::EntryVec ListViewItem::entries() const {
Data::EntryVec entries;
- for(QListViewItem* child = firstChild(); child; child = child->nextSibling()) {
+ for(TQListViewItem* child = firstChild(); child; child = child->nextSibling()) {
Data::EntryVec more = static_cast<GUI::ListViewItem*>(child)->entries();
for(Data::EntryVecIt entry = more.begin(); entry != more.end(); ++entry) {
- if(!entries.contains(entry)) {
+ if(!entries.tqcontains(entry)) {
entries.append(entry);
}
}
diff --git a/src/gui/listview.h b/src/gui/listview.h
index 4c5ade7..8f31977 100644
--- a/src/gui/listview.h
+++ b/src/gui/listview.h
@@ -20,15 +20,15 @@
#include <klistview.h>
#include <kdeversion.h>
-#include <qdict.h>
+#include <tqdict.h>
namespace Tellico {
class ListViewComparison;
namespace GUI {
class ListViewItem;
-typedef QPtrList<ListViewItem> ListViewItemList;
-typedef QPtrListIterator<ListViewItem> ListViewItemListIt;
+typedef TQPtrList<ListViewItem> ListViewItemList;
+typedef TQPtrListIterator<ListViewItem> ListViewItemListIt;
/**
* A ListView keeps track of the selected items and allows subclasses to determine
@@ -42,6 +42,7 @@ typedef QPtrListIterator<ListViewItem> ListViewItemListIt;
*/
class ListView : public KListView {
Q_OBJECT
+ TQ_OBJECT
friend class ListViewItem; // needed so the ListViewItem d'tor can update selection list
@@ -51,7 +52,7 @@ public:
SortByCount = 1
};
- ListView(QWidget* parent, const char* name = 0);
+ ListView(TQWidget* tqparent, const char* name = 0);
virtual ~ListView();
void clearSelection();
@@ -74,7 +75,7 @@ public:
int firstVisibleColumn() const;
int lastVisibleColumn() const;
- virtual void setColumnText(int column, const QString& label);
+ virtual void setColumnText(int column, const TQString& label);
void setComparison(int column, ListViewComparison* comp);
void removeComparison(int column);
@@ -85,8 +86,8 @@ public:
// taken from KDE bug 59791
void setShadeSortColumn(bool shade_);
bool shadeSortColumn() const { return m_shadeSortColumn; }
- const QColor& background2() const { return m_backColor2; }
- const QColor& alternateBackground2() const { return m_altColor2; }
+ const TQColor& background2() const { return m_backColor2; }
+ const TQColor& alternateBackground2() const { return m_altColor2; }
#endif
protected slots:
@@ -97,11 +98,11 @@ protected slots:
virtual void slotSelectionChanged();
protected:
- virtual void drawContentsOffset(QPainter* p, int ox, int oy, int cx, int cy, int cw, int ch);
+ virtual void drawContentsOffset(TQPainter* p, int ox, int oy, int cx, int cy, int cw, int ch);
private slots:
void slotUpdateColors();
- void slotDoubleClicked(QListViewItem* item);
+ void slotDoubleClicked(TQListViewItem* item);
private:
/**
@@ -115,11 +116,11 @@ private:
SortStyle m_sortStyle;
bool m_isClear;
ListViewItemList m_selectedItems;
- QDict<ListViewComparison> m_comparisons;
+ TQDict<ListViewComparison> m_comparisons;
#if !KDE_IS_VERSION(3,3,90)
bool m_shadeSortColumn;
- QColor m_backColor2;
- QColor m_altColor2;
+ TQColor m_backColor2;
+ TQColor m_altColor2;
#endif
};
@@ -131,11 +132,11 @@ private:
*/
class ListViewItem : public KListViewItem {
public:
- ListViewItem(ListView* parent) : KListViewItem(parent), m_sortWeight(-1) {}
- ListViewItem(ListView* parent, QListViewItem* after) : KListViewItem(parent, after), m_sortWeight(-1) {}
- ListViewItem(ListViewItem* parent) : KListViewItem(parent), m_sortWeight(-1) {}
- ListViewItem(ListView* parent, const QString& text) : KListViewItem(parent, text), m_sortWeight(-1) {}
- ListViewItem(ListViewItem* parent, const QString& text) : KListViewItem(parent, text), m_sortWeight(-1) {}
+ ListViewItem(ListView* tqparent) : KListViewItem(tqparent), m_sortWeight(-1) {}
+ ListViewItem(ListView* tqparent, TQListViewItem* after) : KListViewItem(tqparent, after), m_sortWeight(-1) {}
+ ListViewItem(ListViewItem* tqparent) : KListViewItem(tqparent), m_sortWeight(-1) {}
+ ListViewItem(ListView* tqparent, const TQString& text) : KListViewItem(tqparent, text), m_sortWeight(-1) {}
+ ListViewItem(ListViewItem* tqparent, const TQString& text) : KListViewItem(tqparent, text), m_sortWeight(-1) {}
virtual ~ListViewItem();
virtual int realChildCount() const { return childCount(); }
@@ -149,7 +150,7 @@ public:
int sortWeight() const { return m_sortWeight; }
void setSortWeight(int w) { m_sortWeight = w; }
- virtual int compare(QListViewItem* item, int col, bool ascending) const;
+ virtual int compare(TQListViewItem* item, int col, bool ascending) const;
virtual void setSelected(bool selected);
/**
@@ -159,9 +160,9 @@ public:
* @param column The column number
* @param alternate The alternate row color can be forced
*/
- virtual QColor backgroundColor(int column); // not virtual in KListViewItem!!!
- virtual void paintCell(QPainter* painter, const QColorGroup& colorGroup,
- int column, int width, int alignment);
+ virtual TQColor backgroundColor(int column); // not virtual in KListViewItem!!!
+ virtual void paintCell(TQPainter* painter, const TQColorGroup& tqcolorGroup,
+ int column, int width, int tqalignment);
ListView* listView () const { return static_cast<ListView*>(KListViewItem::listView()); }
@@ -169,7 +170,7 @@ public:
virtual Data::EntryVec entries() const;
private:
- int compareWeight(QListViewItem* item, int col, bool ascending) const;
+ int compareWeight(TQListViewItem* item, int col, bool ascending) const;
int m_sortWeight;
};
diff --git a/src/gui/numberfieldwidget.cpp b/src/gui/numberfieldwidget.cpp
index 027b1e9..9f249c6 100644
--- a/src/gui/numberfieldwidget.cpp
+++ b/src/gui/numberfieldwidget.cpp
@@ -17,13 +17,13 @@
#include <klineedit.h>
-#include <qlayout.h>
-#include <qvalidator.h>
+#include <tqlayout.h>
+#include <tqvalidator.h>
using Tellico::GUI::NumberFieldWidget;
-NumberFieldWidget::NumberFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : FieldWidget(field_, parent_, name_), m_lineEdit(0), m_spinBox(0) {
+NumberFieldWidget::NumberFieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : FieldWidget(field_, tqparent_, name_), m_lineEdit(0), m_spinBox(0) {
if(field_->flags() & Data::Field::AllowMultiple) {
initLineEdit();
@@ -36,43 +36,43 @@ NumberFieldWidget::NumberFieldWidget(Data::FieldPtr field_, QWidget* parent_, co
void NumberFieldWidget::initLineEdit() {
m_lineEdit = new KLineEdit(this);
- connect(m_lineEdit, SIGNAL(textChanged(const QString&)), SIGNAL(modified()));
- // connect(kl, SIGNAL(returnPressed(const QString&)), this, SLOT(slotHandleReturn()));
+ connect(m_lineEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SIGNAL(modified()));
+ // connect(kl, TQT_SIGNAL(returnPressed(const TQString&)), this, TQT_SLOT(slotHandleReturn()));
// regexp is any number of digits followed optionally by any number of
// groups of a semi-colon followed optionally by a space, followed by digits
- QRegExp rx(QString::fromLatin1("-?\\d*(; ?-?\\d*)*"));
- m_lineEdit->setValidator(new QRegExpValidator(rx, this));
+ TQRegExp rx(TQString::tqfromLatin1("-?\\d*(; ?-?\\d*)*"));
+ m_lineEdit->setValidator(new TQRegExpValidator(rx, TQT_TQOBJECT(this)));
}
void NumberFieldWidget::initSpinBox() {
// intentionally allow only positive numbers
m_spinBox = new GUI::SpinBox(-1, INT_MAX, this);
- connect(m_spinBox, SIGNAL(valueChanged(int)), SIGNAL(modified()));
- // QSpinBox doesn't emit valueChanged if you edit the value with
+ connect(m_spinBox, TQT_SIGNAL(valueChanged(int)), TQT_SIGNAL(modified()));
+ // TQSpinBox doesn't emit valueChanged if you edit the value with
// the lineEdit until you change the keyboard focus
- connect(m_spinBox->child("qt_spinbox_edit"), SIGNAL(textChanged(const QString&)), SIGNAL(modified()));
+ connect(m_spinBox->child("qt_spinbox_edit"), TQT_SIGNAL(textChanged(const TQString&)), TQT_SIGNAL(modified()));
// I want to allow no value, so set space as special text. Empty text is ignored
- m_spinBox->setSpecialValueText(QChar(' '));
+ m_spinBox->setSpecialValueText(TQChar(' '));
}
-QString NumberFieldWidget::text() const {
+TQString NumberFieldWidget::text() const {
if(isSpinBox()) {
// minValue = special empty text
if(m_spinBox->value() > m_spinBox->minValue()) {
- return QString::number(m_spinBox->value());
+ return TQString::number(m_spinBox->value());
}
- return QString();
+ return TQString();
}
- QString text = m_lineEdit->text();
+ TQString text = m_lineEdit->text();
if(field()->flags() & Data::Field::AllowMultiple) {
- text.replace(s_semiColon, QString::fromLatin1("; "));
+ text.tqreplace(s_semiColon, TQString::tqfromLatin1("; "));
}
return text.simplifyWhiteSpace();
}
-void NumberFieldWidget::setText(const QString& text_) {
+void NumberFieldWidget::setText(const TQString& text_) {
blockSignals(true);
if(isSpinBox()) {
@@ -114,26 +114,26 @@ void NumberFieldWidget::updateFieldHook(Data::FieldPtr, Data::FieldPtr newField_
return;
}
- QString value = text();
+ TQString value = text();
if(wasLineEdit && !nowLineEdit) {
- layout()->remove(m_lineEdit);
+ tqlayout()->remove(m_lineEdit);
delete m_lineEdit;
m_lineEdit = 0;
initSpinBox();
} else if(!wasLineEdit && nowLineEdit) {
- layout()->remove(m_spinBox);
+ tqlayout()->remove(m_spinBox);
delete m_spinBox;
m_spinBox = 0;
initLineEdit();
}
// should really be FIELD_EDIT_WIDGET_INDEX from fieldwidget.cpp
- static_cast<QBoxLayout*>(layout())->insertWidget(2, widget(), 1 /*stretch*/);
+ static_cast<TQBoxLayout*>(tqlayout())->insertWidget(2, widget(), 1 /*stretch*/);
widget()->show();
setText(value);
}
-QWidget* NumberFieldWidget::widget() {
+TQWidget* NumberFieldWidget::widget() {
if(isSpinBox()) {
return m_spinBox;
}
diff --git a/src/gui/numberfieldwidget.h b/src/gui/numberfieldwidget.h
index c0fed9d..6c9fd82 100644
--- a/src/gui/numberfieldwidget.h
+++ b/src/gui/numberfieldwidget.h
@@ -28,19 +28,20 @@ namespace Tellico {
*/
class NumberFieldWidget : public FieldWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- NumberFieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ NumberFieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~NumberFieldWidget() {}
- virtual QString text() const;
- virtual void setText(const QString& text);
+ virtual TQString text() const;
+ virtual void setText(const TQString& text);
public slots:
virtual void clear();
protected:
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual void updateFieldHook(Data::FieldPtr oldField, Data::FieldPtr newField);
private:
diff --git a/src/gui/overlaywidget.cpp b/src/gui/overlaywidget.cpp
index 6214ca8..54d27fe 100644
--- a/src/gui/overlaywidget.cpp
+++ b/src/gui/overlaywidget.cpp
@@ -13,11 +13,11 @@
#include "overlaywidget.h"
-#include <qlayout.h>
+#include <tqlayout.h>
using Tellico::GUI::OverlayWidget;
-OverlayWidget::OverlayWidget(QWidget* parent, QWidget* anchor) : QFrame(parent)
+OverlayWidget::OverlayWidget(TQWidget* tqparent, TQWidget* anchor) : TQFrame(tqparent)
, m_anchor(anchor)
, m_corner(TopRight) {
m_anchor->installEventFilter(this);
@@ -33,8 +33,8 @@ void OverlayWidget::setCorner(Corner corner_) {
reposition();
}
-void OverlayWidget::addWidget(QWidget* widget_) {
- layout()->add(widget_);
+void OverlayWidget::addWidget(TQWidget* widget_) {
+ tqlayout()->add(widget_);
adjustSize();
}
@@ -43,10 +43,10 @@ void OverlayWidget::reposition() {
return;
}
- setMaximumSize(parentWidget()->size());
+ setMaximumSize(tqparentWidget()->size());
adjustSize();
- QPoint p;
+ TQPoint p;
switch(m_corner) {
case BottomLeft:
@@ -70,9 +70,9 @@ void OverlayWidget::reposition() {
}
// Position in the toplevelwidget's coordinates
- QPoint pTopLevel = m_anchor->mapTo(topLevelWidget(), p);
- // Position in the widget's parentWidget coordinates
- QPoint pParent = parentWidget()->mapFrom(topLevelWidget(), pTopLevel);
+ TQPoint pTopLevel = m_anchor->mapTo(tqtopLevelWidget(), p);
+ // Position in the widget's tqparentWidget coordinates
+ TQPoint pParent = tqparentWidget()->mapFrom(tqtopLevelWidget(), pTopLevel);
// keep it on the screen
if(pParent.x() < 0) {
pParent.rx() = 0;
@@ -80,25 +80,25 @@ void OverlayWidget::reposition() {
move(pParent);
}
-bool OverlayWidget::eventFilter(QObject* object_, QEvent* event_) {
- if(object_ == m_anchor && (event_->type() == QEvent::Move || event_->type() == QEvent::Resize)) {
+bool OverlayWidget::eventFilter(TQObject* object_, TQEvent* event_) {
+ if(TQT_BASE_OBJECT(object_) == TQT_BASE_OBJECT(m_anchor) && (event_->type() == TQEvent::Move || event_->type() == TQEvent::Resize)) {
reposition();
}
- return QFrame::eventFilter(object_, event_);
+ return TQFrame::eventFilter(object_, event_);
}
-void OverlayWidget::resizeEvent(QResizeEvent* event_) {
+void OverlayWidget::resizeEvent(TQResizeEvent* event_) {
reposition();
- QFrame::resizeEvent(event_);
+ TQFrame::resizeEvent(event_);
}
-bool OverlayWidget::event(QEvent* event_) {
- if(event_->type() == QEvent::ChildInserted) {
+bool OverlayWidget::event(TQEvent* event_) {
+ if(event_->type() == TQEvent::ChildInserted) {
adjustSize();
}
- return QFrame::event(event_);
+ return TQFrame::event(event_);
}
#include "overlaywidget.moc"
diff --git a/src/gui/overlaywidget.h b/src/gui/overlaywidget.h
index 7b4453e..80eb245 100644
--- a/src/gui/overlaywidget.h
+++ b/src/gui/overlaywidget.h
@@ -17,7 +17,7 @@
#ifndef TELLICO_GUI_OVERLAYWIDGET_H
#define TELLICO_GUI_OVERLAYWIDGET_H
-#include <qframe.h>
+#include <tqframe.h>
namespace Tellico {
namespace GUI {
@@ -25,26 +25,27 @@ namespace Tellico {
/**
* @author Robby Stephenson
*/
-class OverlayWidget : public QFrame {
+class OverlayWidget : public TQFrame {
Q_OBJECT
+ TQ_OBJECT
public:
- OverlayWidget(QWidget* parent, QWidget* anchor);
+ OverlayWidget(TQWidget* tqparent, TQWidget* anchor);
void setCorner(Corner corner);
Corner corner() const { return m_corner; }
- void addWidget(QWidget* widget);
+ void addWidget(TQWidget* widget);
protected:
- void resizeEvent(QResizeEvent* event);
- bool eventFilter(QObject* object, QEvent* event);
- bool event(QEvent* event);
+ void resizeEvent(TQResizeEvent* event);
+ bool eventFilter(TQObject* object, TQEvent* event);
+ bool event(TQEvent* event);
private:
void reposition();
- QWidget* m_anchor;
+ TQWidget* m_anchor;
Corner m_corner;
};
diff --git a/src/gui/parafieldwidget.cpp b/src/gui/parafieldwidget.cpp
index 9941e34..ba3b583 100644
--- a/src/gui/parafieldwidget.cpp
+++ b/src/gui/parafieldwidget.cpp
@@ -19,32 +19,32 @@
using Tellico::GUI::ParaFieldWidget;
-ParaFieldWidget::ParaFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : FieldWidget(field_, parent_, name_) {
+ParaFieldWidget::ParaFieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : FieldWidget(field_, tqparent_, name_) {
m_textEdit = new KTextEdit(this);
- m_textEdit->setTextFormat(Qt::PlainText);
- if(field_->property(QString::fromLatin1("spellcheck")) != Latin1Literal("false")) {
+ m_textEdit->setTextFormat(TQt::PlainText);
+ if(field_->property(TQString::tqfromLatin1("spellcheck")) != Latin1Literal("false")) {
m_textEdit->setCheckSpellingEnabled(true);
}
- connect(m_textEdit, SIGNAL(textChanged()), SIGNAL(modified()));
+ connect(m_textEdit, TQT_SIGNAL(textChanged()), TQT_SIGNAL(modified()));
registerWidget();
}
-QString ParaFieldWidget::text() const {
- QString text = m_textEdit->text();
- text.replace('\n', QString::fromLatin1("<br/>"));
+TQString ParaFieldWidget::text() const {
+ TQString text = m_textEdit->text();
+ text.tqreplace('\n', TQString::tqfromLatin1("<br/>"));
return text;
}
-void ParaFieldWidget::setText(const QString& text_) {
+void ParaFieldWidget::setText(const TQString& text_) {
blockSignals(true);
m_textEdit->blockSignals(true);
- QRegExp rx(QString::fromLatin1("<br/?>"), false /*case-sensitive*/);
- QString s = text_;
- s.replace(rx, QChar('\n'));
+ TQRegExp rx(TQString::tqfromLatin1("<br/?>"), false /*case-sensitive*/);
+ TQString s = text_;
+ s.tqreplace(rx, TQChar('\n'));
m_textEdit->setText(s);
m_textEdit->blockSignals(false);
@@ -56,7 +56,7 @@ void ParaFieldWidget::clear() {
editMultiple(false);
}
-QWidget* ParaFieldWidget::widget() {
+TQWidget* ParaFieldWidget::widget() {
return m_textEdit;
}
diff --git a/src/gui/parafieldwidget.h b/src/gui/parafieldwidget.h
index ac9801f..f672bfb 100644
--- a/src/gui/parafieldwidget.h
+++ b/src/gui/parafieldwidget.h
@@ -27,19 +27,20 @@ namespace Tellico {
*/
class ParaFieldWidget : public FieldWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- ParaFieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ ParaFieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~ParaFieldWidget() {}
- virtual QString text() const;
- virtual void setText(const QString& text);
+ virtual TQString text() const;
+ virtual void setText(const TQString& text);
public slots:
virtual void clear();
protected:
- virtual QWidget* widget();
+ virtual TQWidget* widget();
private:
KTextEdit* m_textEdit;
diff --git a/src/gui/previewdialog.cpp b/src/gui/previewdialog.cpp
index 4c0d8e1..856fcd0 100644
--- a/src/gui/previewdialog.cpp
+++ b/src/gui/previewdialog.cpp
@@ -22,16 +22,16 @@
using Tellico::GUI::PreviewDialog;
-PreviewDialog::PreviewDialog(QWidget* parent_)
- : KDialogBase(parent_, "template preview dialog", false /* modal */,
+PreviewDialog::PreviewDialog(TQWidget* tqparent_)
+ : KDialogBase(tqparent_, "template preview dialog", false /* modal */,
i18n("Template Preview"), KDialogBase::Ok)
, m_tempDir(new KTempDir()) {
m_tempDir->setAutoDelete(true);
- connect(this, SIGNAL(finished()), SLOT(delayedDestruct()));
+ connect(this, TQT_SIGNAL(finished()), TQT_SLOT(delayedDestruct()));
m_view = new EntryView(this);
setMainWidget(m_view->view());
- setInitialSize(QSize(600, 500));
+ setInitialSize(TQSize(600, 500));
}
PreviewDialog::~PreviewDialog() {
@@ -39,7 +39,7 @@ PreviewDialog::~PreviewDialog() {
m_tempDir = 0;
}
-void PreviewDialog::setXSLTFile(const QString& file_) {
+void PreviewDialog::setXSLTFile(const TQString& file_) {
m_view->setXSLTFile(file_);
}
diff --git a/src/gui/previewdialog.h b/src/gui/previewdialog.h
index a386a94..a0f7893 100644
--- a/src/gui/previewdialog.h
+++ b/src/gui/previewdialog.h
@@ -28,12 +28,13 @@ namespace Tellico {
class PreviewDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- PreviewDialog(QWidget* parent);
+ PreviewDialog(TQWidget* tqparent);
~PreviewDialog();
- void setXSLTFile(const QString& file);
+ void setXSLTFile(const TQString& file);
void setXSLTOptions(StyleOptions options);
void showEntry(Data::EntryPtr entry);
diff --git a/src/gui/progress.cpp b/src/gui/progress.cpp
index 36baaf1..725d7a0 100644
--- a/src/gui/progress.cpp
+++ b/src/gui/progress.cpp
@@ -16,10 +16,10 @@
using Tellico::GUI::Progress;
-Progress::Progress(QWidget* parent_) : KProgress(parent_) {
+Progress::Progress(TQWidget* tqparent_) : KProgress(tqparent_) {
}
-Progress::Progress(int totalSteps_, QWidget* parent_) : KProgress(totalSteps_, parent_) {
+Progress::Progress(int totalSteps_, TQWidget* tqparent_) : KProgress(totalSteps_, tqparent_) {
}
bool Progress::isDone() const {
diff --git a/src/gui/progress.h b/src/gui/progress.h
index b58de2f..4e01853 100644
--- a/src/gui/progress.h
+++ b/src/gui/progress.h
@@ -24,10 +24,11 @@ namespace Tellico {
*/
class Progress : public KProgress {
Q_OBJECT
+ TQ_OBJECT
public:
- Progress(QWidget* parent);
- Progress(int totalSteps, QWidget* parent);
+ Progress(TQWidget* tqparent);
+ Progress(int totalSteps, TQWidget* tqparent);
bool isDone() const;
void setDone();
diff --git a/src/gui/ratingfieldwidget.cpp b/src/gui/ratingfieldwidget.cpp
index 4b0de71..3887725 100644
--- a/src/gui/ratingfieldwidget.cpp
+++ b/src/gui/ratingfieldwidget.cpp
@@ -17,19 +17,19 @@
using Tellico::GUI::RatingFieldWidget;
-RatingFieldWidget::RatingFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : FieldWidget(field_, parent_, name_) {
+RatingFieldWidget::RatingFieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : FieldWidget(field_, tqparent_, name_) {
m_rating = new RatingWidget(field_, this);
- connect(m_rating, SIGNAL(modified()), SIGNAL(modified()));
+ connect(m_rating, TQT_SIGNAL(modified()), TQT_SIGNAL(modified()));
registerWidget();
}
-QString RatingFieldWidget::text() const {
+TQString RatingFieldWidget::text() const {
return m_rating->text();
}
-void RatingFieldWidget::setText(const QString& text_) {
+void RatingFieldWidget::setText(const TQString& text_) {
blockSignals(true);
m_rating->blockSignals(true);
@@ -52,7 +52,7 @@ void RatingFieldWidget::updateFieldHook(Data::FieldPtr, Data::FieldPtr newField_
m_rating->updateField(newField_);
}
-QWidget* RatingFieldWidget::widget() {
+TQWidget* RatingFieldWidget::widget() {
return m_rating;
}
diff --git a/src/gui/ratingfieldwidget.h b/src/gui/ratingfieldwidget.h
index 369dbec..f985ea2 100644
--- a/src/gui/ratingfieldwidget.h
+++ b/src/gui/ratingfieldwidget.h
@@ -26,19 +26,20 @@ namespace Tellico {
*/
class RatingFieldWidget : public FieldWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- RatingFieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ RatingFieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~RatingFieldWidget() {}
- virtual QString text() const;
- virtual void setText(const QString& text);
+ virtual TQString text() const;
+ virtual void setText(const TQString& text);
public slots:
virtual void clear();
protected:
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual void updateFieldHook(Data::FieldPtr oldField, Data::FieldPtr newField);
private:
diff --git a/src/gui/ratingwidget.cpp b/src/gui/ratingwidget.cpp
index 4921f21..4bfa9ec 100644
--- a/src/gui/ratingwidget.cpp
+++ b/src/gui/ratingwidget.cpp
@@ -19,8 +19,8 @@
#include <kiconloader.h>
-#include <qintdict.h>
-#include <qlayout.h>
+#include <tqintdict.h>
+#include <tqlayout.h>
namespace {
static const int RATING_WIDGET_MAX_ICONS = 10; // same as in Field::ratingValues()
@@ -29,10 +29,10 @@ namespace {
using Tellico::GUI::RatingWidget;
-const QPixmap& RatingWidget::pixmap(const QString& value_) {
- static QIntDict<QPixmap> pixmaps;
+const TQPixmap& RatingWidget::pixmap(const TQString& value_) {
+ static TQIntDict<TQPixmap> pixmaps;
if(pixmaps.isEmpty()) {
- pixmaps.insert(-1, new QPixmap());
+ pixmaps.insert(-1, new TQPixmap());
}
bool ok;
int n = Tellico::toUInt(value_, &ok);
@@ -43,29 +43,29 @@ const QPixmap& RatingWidget::pixmap(const QString& value_) {
return *pixmaps[n];
}
- QString picName = QString::fromLatin1("stars%1").arg(n);
- QPixmap* pix = new QPixmap(UserIcon(picName));
+ TQString picName = TQString::tqfromLatin1("stars%1").tqarg(n);
+ TQPixmap* pix = new TQPixmap(UserIcon(picName));
pixmaps.insert(n, pix);
return *pix;
}
-RatingWidget::RatingWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : QHBox(parent_, name_), m_field(field_), m_currIndex(-1) {
- m_pixOn = UserIcon(QString::fromLatin1("star_on"));
- m_pixOff = UserIcon(QString::fromLatin1("star_off"));
+RatingWidget::RatingWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : TQHBox(tqparent_, name_), m_field(field_), m_currIndex(-1) {
+ m_pixOn = UserIcon(TQString::tqfromLatin1("star_on"));
+ m_pixOff = UserIcon(TQString::tqfromLatin1("star_off"));
setSpacing(0);
// find maximum width and height
- int w = QMAX(RATING_WIDGET_MAX_STAR_SIZE, QMAX(m_pixOn.width(), m_pixOff.width()));
- int h = QMAX(RATING_WIDGET_MAX_STAR_SIZE, QMAX(m_pixOn.height(), m_pixOff.height()));
+ int w = TQMAX(RATING_WIDGET_MAX_STAR_SIZE, TQMAX(m_pixOn.width(), m_pixOff.width()));
+ int h = TQMAX(RATING_WIDGET_MAX_STAR_SIZE, TQMAX(m_pixOn.height(), m_pixOff.height()));
for(int i = 0; i < RATING_WIDGET_MAX_ICONS; ++i) {
- QLabel* l = new QLabel(this);
+ TQLabel* l = new TQLabel(this);
l->setFixedSize(w, h);
m_widgets.append(l);
}
init();
- QBoxLayout* l = dynamic_cast<QBoxLayout*>(layout());
+ TQBoxLayout* l = dynamic_cast<TQBoxLayout*>(tqlayout());
if(l) {
l->addStretch(1);
}
@@ -73,21 +73,21 @@ RatingWidget::RatingWidget(Data::FieldPtr field_, QWidget* parent_, const char*
void RatingWidget::init() {
updateBounds();
- m_total = QMIN(m_max, static_cast<int>(m_widgets.count()));
+ m_total = TQMIN(m_max, static_cast<int>(m_widgets.count()));
uint i = 0;
for( ; static_cast<int>(i) < m_total; ++i) {
m_widgets.at(i)->setPixmap(m_pixOff);
}
for( ; i < m_widgets.count(); ++i) {
- m_widgets.at(i)->setPixmap(QPixmap());
+ m_widgets.at(i)->setPixmap(TQPixmap());
}
update();
}
void RatingWidget::updateBounds() {
bool ok; // not used;
- m_min = Tellico::toUInt(m_field->property(QString::fromLatin1("minimum")), &ok);
- m_max = Tellico::toUInt(m_field->property(QString::fromLatin1("maximum")), &ok);
+ m_min = Tellico::toUInt(m_field->property(TQString::tqfromLatin1("minimum")), &ok);
+ m_max = Tellico::toUInt(m_field->property(TQString::tqfromLatin1("maximum")), &ok);
if(m_max > RATING_WIDGET_MAX_ICONS) {
myDebug() << "RatingWidget::updateBounds() - max is too high: " << m_max << endl;
m_max = RATING_WIDGET_MAX_ICONS;
@@ -106,19 +106,19 @@ void RatingWidget::update() {
m_widgets.at(i)->setPixmap(m_pixOff);
}
- QHBox::update();
+ TQHBox::update();
}
-void RatingWidget::mousePressEvent(QMouseEvent* event_) {
+void RatingWidget::mousePressEvent(TQMouseEvent* event_) {
// only react to left button
if(event_->button() != Qt::LeftButton) {
return;
}
int idx;
- QWidget* child = childAt(event_->pos());
+ TQWidget* child = tqchildAt(event_->pos());
if(child) {
- idx = m_widgets.findRef(static_cast<QLabel*>(child));
+ idx = m_widgets.tqfindRef(static_cast<TQLabel*>(child));
// if the widget is clicked beyond the maximum value, clear it
// remember total and min are values, but index is zero-based!
if(idx > m_total-1) {
@@ -141,12 +141,12 @@ void RatingWidget::clear() {
update();
}
-QString RatingWidget::text() const {
+TQString RatingWidget::text() const {
// index is index of the list, which is zero-based. Add 1!
- return m_currIndex == -1 ? QString::null : QString::number(m_currIndex+1);
+ return m_currIndex == -1 ? TQString() : TQString::number(m_currIndex+1);
}
-void RatingWidget::setText(const QString& text_) {
+void RatingWidget::setText(const TQString& text_) {
bool ok;
// text is value, subtract one to get index
m_currIndex = Tellico::toUInt(text_, &ok)-1;
diff --git a/src/gui/ratingwidget.h b/src/gui/ratingwidget.h
index 99665b3..9a3e477 100644
--- a/src/gui/ratingwidget.h
+++ b/src/gui/ratingwidget.h
@@ -16,10 +16,10 @@
#include "../datavectors.h"
-#include <qhbox.h>
-#include <qptrlist.h>
-#include <qlabel.h>
-#include <qpixmap.h>
+#include <tqhbox.h>
+#include <tqptrlist.h>
+#include <tqlabel.h>
+#include <tqpixmap.h>
namespace Tellico {
namespace Data {
@@ -30,20 +30,21 @@ namespace Tellico {
/**
* @author Robby Stephenson
*/
-class RatingWidget : public QHBox {
+class RatingWidget : public TQHBox {
Q_OBJECT
+ TQ_OBJECT
-typedef QPtrList<QLabel> LabelList;
+typedef TQPtrList<TQLabel> LabelList;
public:
- RatingWidget(Data::FieldPtr field, QWidget* parent, const char* name = 0);
+ RatingWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name = 0);
void clear();
- QString text() const;
- void setText(const QString& text);
+ TQString text() const;
+ void setText(const TQString& text);
void updateField(Data::FieldPtr field);
- static const QPixmap& pixmap(const QString& value);
+ static const TQPixmap& pixmap(const TQString& value);
public slots:
void update();
@@ -52,7 +53,7 @@ signals:
void modified();
protected:
- virtual void mousePressEvent(QMouseEvent* e);
+ virtual void mousePressEvent(TQMouseEvent* e);
private:
void init();
@@ -66,8 +67,8 @@ private:
int m_min;
int m_max;
- QPixmap m_pixOn;
- QPixmap m_pixOff;
+ TQPixmap m_pixOn;
+ TQPixmap m_pixOff;
};
} // end GUI namespace
diff --git a/src/gui/richtextlabel.cpp b/src/gui/richtextlabel.cpp
index a4cdde4..a0b3a01 100644
--- a/src/gui/richtextlabel.cpp
+++ b/src/gui/richtextlabel.cpp
@@ -15,33 +15,33 @@
#include <kdebug.h>
-#include <qlayout.h>
+#include <tqlayout.h>
using Tellico::GUI::RichTextLabel;
-RichTextLabel::RichTextLabel(QWidget* parent) : QTextEdit(parent) {
+RichTextLabel::RichTextLabel(TQWidget* tqparent) : TQTextEdit(tqparent) {
init();
}
-RichTextLabel::RichTextLabel(const QString& text, QWidget* parent) : QTextEdit(text, QString::null, parent) {
+RichTextLabel::RichTextLabel(const TQString& text, TQWidget* tqparent) : TQTextEdit(text, TQString(), tqparent) {
init();
}
-QSize RichTextLabel::sizeHint() const {
- return minimumSizeHint();
+TQSize RichTextLabel::tqsizeHint() const {
+ return tqminimumSizeHint();
}
void RichTextLabel::init() {
setReadOnly(true);
- setTextFormat(Qt::RichText);
+ setTextFormat(TQt::RichText);
- setFrameShape(QFrame::NoFrame);
+ setFrameShape(TQFrame::NoFrame);
viewport()->setMouseTracking(false);
- setPaper(colorGroup().background());
+ setPaper(tqcolorGroup().background());
- setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
- viewport()->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
+ tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding));
+ viewport()->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding));
}
#include "richtextlabel.moc"
diff --git a/src/gui/richtextlabel.h b/src/gui/richtextlabel.h
index f45a328..9f57fb6 100644
--- a/src/gui/richtextlabel.h
+++ b/src/gui/richtextlabel.h
@@ -14,7 +14,7 @@
#ifndef TELLICO_GUI_RICHTEXTLABEL_H
#define TELLICO_GUI_RICHTEXTLABEL_H
-#include <qtextedit.h>
+#include <tqtextedit.h>
namespace Tellico {
namespace GUI {
@@ -22,22 +22,23 @@ namespace Tellico {
/**
* @author Robby Stephenson
*/
-class RichTextLabel : public QTextEdit {
+class RichTextLabel : public TQTextEdit {
Q_OBJECT
+ TQ_OBJECT
public:
- RichTextLabel(QWidget* parent);
- RichTextLabel(const QString& text, QWidget* parent);
+ RichTextLabel(TQWidget* tqparent);
+ RichTextLabel(const TQString& text, TQWidget* tqparent);
- virtual QSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
private:
void init();
// redefine these to disable selection
- void contentsMousePressEvent(QMouseEvent*) {}
- void contentsMouseMoveEvent(QMouseEvent*) {}
- void contentsMouseReleaseEvent(QMouseEvent*) {}
- void contentsMouseDoubleClickEvent(QMouseEvent*) {}
+ void contentsMousePressEvent(TQMouseEvent*) {}
+ void contentsMouseMoveEvent(TQMouseEvent*) {}
+ void contentsMouseReleaseEvent(TQMouseEvent*) {}
+ void contentsMouseDoubleClickEvent(TQMouseEvent*) {}
};
} // end namespace
diff --git a/src/gui/stringmapdialog.cpp b/src/gui/stringmapdialog.cpp
index 4a5374f..c542fe5 100644
--- a/src/gui/stringmapdialog.cpp
+++ b/src/gui/stringmapdialog.cpp
@@ -19,33 +19,33 @@
#include <kbuttonbox.h>
#include <kiconloader.h>
-#include <qlayout.h>
-#include <qheader.h>
-#include <qhbox.h>
-#include <qwhatsthis.h>
-#include <qpushbutton.h>
+#include <tqlayout.h>
+#include <tqheader.h>
+#include <tqhbox.h>
+#include <tqwhatsthis.h>
+#include <tqpushbutton.h>
using Tellico::StringMapDialog;
-StringMapDialog::StringMapDialog(const QMap<QString, QString>& map_, QWidget* parent_, const char* name_/*=0*/, bool modal_/*=false*/)
- : KDialogBase(parent_, name_, modal_, QString::null, Ok|Cancel) {
- QWidget* page = new QWidget(this);
- QVBoxLayout* l = new QVBoxLayout(page, 0, KDialog::spacingHint());
+StringMapDialog::StringMapDialog(const TQMap<TQString, TQString>& map_, TQWidget* tqparent_, const char* name_/*=0*/, bool modal_/*=false*/)
+ : KDialogBase(tqparent_, name_, modal_, TQString(), Ok|Cancel) {
+ TQWidget* page = new TQWidget(this);
+ TQVBoxLayout* l = new TQVBoxLayout(page, 0, KDialog::spacingHint());
m_listView = new KListView(page);
m_listView->setAllColumnsShowFocus(true);
m_listView->setShowSortIndicator(true);
- m_listView->addColumn(QString::null);
- m_listView->addColumn(QString::null);
+ m_listView->addColumn(TQString());
+ m_listView->addColumn(TQString());
m_listView->header()->hide(); // hide header since neither column has a label initially
- m_listView->setColumnWidthMode(0, QListView::Maximum);
- m_listView->setColumnWidthMode(1, QListView::Maximum);
- m_listView->setResizeMode(QListView::AllColumns);
- connect(m_listView, SIGNAL(currentChanged(QListViewItem*)), SLOT(slotUpdate(QListViewItem*)));
- connect(m_listView, SIGNAL(clicked(QListViewItem*)), SLOT(slotUpdate(QListViewItem*)));
+ m_listView->setColumnWidthMode(0, TQListView::Maximum);
+ m_listView->setColumnWidthMode(1, TQListView::Maximum);
+ m_listView->setResizeMode(TQListView::AllColumns);
+ connect(m_listView, TQT_SIGNAL(currentChanged(TQListViewItem*)), TQT_SLOT(slotUpdate(TQListViewItem*)));
+ connect(m_listView, TQT_SIGNAL(clicked(TQListViewItem*)), TQT_SLOT(slotUpdate(TQListViewItem*)));
l->addWidget(m_listView);
- QHBox* box = new QHBox(page);
+ TQHBox* box = new TQHBox(page);
box->setMargin(4);
box->setSpacing(KDialog::spacingHint());
@@ -54,16 +54,16 @@ StringMapDialog::StringMapDialog(const QMap<QString, QString>& map_, QWidget* pa
m_edit2 = new KLineEdit(box);
KButtonBox* bb = new KButtonBox(box);
bb->addStretch();
- QPushButton* btn = bb->addButton(i18n("&Set"), this, SLOT(slotAdd()));
- btn->setIconSet(BarIcon(QString::fromLatin1("filenew"), KIcon::SizeSmall));
- btn = bb->addButton(i18n("&Delete"), this, SLOT(slotDelete()));
- btn->setIconSet(BarIcon(QString::fromLatin1("editdelete"), KIcon::SizeSmall));
+ TQPushButton* btn = bb->addButton(i18n("&Set"), TQT_TQOBJECT(this), TQT_SLOT(slotAdd()));
+ btn->setIconSet(BarIcon(TQString::tqfromLatin1("filenew"), KIcon::SizeSmall));
+ btn = bb->addButton(i18n("&Delete"), TQT_TQOBJECT(this), TQT_SLOT(slotDelete()));
+ btn->setIconSet(BarIcon(TQString::tqfromLatin1("editdelete"), KIcon::SizeSmall));
l->addWidget(box);
l->addStretch(1);
setMainWidget(page);
- for(QMap<QString, QString>::ConstIterator it = map_.begin(); it != map_.end(); ++it) {
+ for(TQMap<TQString, TQString>::ConstIterator it = map_.begin(); it != map_.end(); ++it) {
if(!it.data().isEmpty()) {
(void) new KListViewItem(m_listView, it.key(), it.data());
}
@@ -74,12 +74,12 @@ StringMapDialog::StringMapDialog(const QMap<QString, QString>& map_, QWidget* pa
}
void StringMapDialog::slotAdd() {
- QString s1 = m_edit1->text();
- QString s2 = m_edit2->text();
+ TQString s1 = m_edit1->text();
+ TQString s2 = m_edit2->text();
if(s1.isEmpty() && s2.isEmpty()) {
return;
}
- QListViewItem* item = m_listView->currentItem();
+ TQListViewItem* item = m_listView->currentItem();
if(item && s1 == item->text(0)) { // only update values if same key
item->setText(1, s2);
} else {
@@ -97,7 +97,7 @@ void StringMapDialog::slotDelete() {
m_listView->setSelected(m_listView->currentItem(), true);
}
-void StringMapDialog::slotUpdate(QListViewItem* item_) {
+void StringMapDialog::slotUpdate(TQListViewItem* item_) {
if(item_) {
m_edit1->setText(item_->text(0));
m_edit2->setText(item_->text(1));
@@ -108,15 +108,15 @@ void StringMapDialog::slotUpdate(QListViewItem* item_) {
}
}
-void StringMapDialog::setLabels(const QString& label1_, const QString& label2_) {
+void StringMapDialog::setLabels(const TQString& label1_, const TQString& label2_) {
m_listView->header()->setLabel(0, label1_);
m_listView->header()->setLabel(1, label2_);
m_listView->header()->show();
}
-QMap<QString, QString> StringMapDialog::stringMap() {
- QMap<QString, QString> map;
- for(QListViewItem* item = m_listView->firstChild(); item; item = item->nextSibling()) {
+TQMap<TQString, TQString> StringMapDialog::stringMap() {
+ TQMap<TQString, TQString> map;
+ for(TQListViewItem* item = m_listView->firstChild(); item; item = item->nextSibling()) {
map.insert(item->text(0), item->text(1));
}
return map;
diff --git a/src/gui/stringmapdialog.h b/src/gui/stringmapdialog.h
index 311df70..a0dec9f 100644
--- a/src/gui/stringmapdialog.h
+++ b/src/gui/stringmapdialog.h
@@ -16,12 +16,12 @@
class KLineEdit;
class KListView;
-class QListViewItem;
+class TQListViewItem;
#include <kdialogbase.h>
template <typename T1, typename T2>
-class QMap;
+class TQMap;
namespace Tellico {
@@ -38,9 +38,10 @@ namespace Tellico {
*/
class StringMapDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- StringMapDialog(const QMap<QString, QString>& stringMap, QWidget* parent, const char* name=0, bool modal=false);
+ StringMapDialog(const TQMap<TQString, TQString>& stringMap, TQWidget* tqparent, const char* name=0, bool modal=false);
/**
* Sets the titles for the key and value columns.
@@ -48,18 +49,18 @@ public:
* @param label1 The name of the key string
* @param label2 The name of the value string
*/
- void setLabels(const QString& label1, const QString& label2);
+ void setLabels(const TQString& label1, const TQString& label2);
/**
* Returns the modified string map.
*
* @return The modified string map
*/
- QMap<QString, QString> stringMap();
+ TQMap<TQString, TQString> stringMap();
private slots:
void slotAdd();
void slotDelete();
- void slotUpdate(QListViewItem* item);
+ void slotUpdate(TQListViewItem* item);
protected:
KListView* m_listView;
diff --git a/src/gui/tabcontrol.cpp b/src/gui/tabcontrol.cpp
index 145f632..208d8e4 100644
--- a/src/gui/tabcontrol.cpp
+++ b/src/gui/tabcontrol.cpp
@@ -13,25 +13,25 @@
#include "tabcontrol.h"
-#include <qtabbar.h>
-#include <qobjectlist.h>
+#include <tqtabbar.h>
+#include <tqobjectlist.h>
using Tellico::GUI::TabControl;
-TabControl::TabControl(QWidget* parent_, const char* name_/*=0*/)
- : QTabWidget(parent_, name_) {
+TabControl::TabControl(TQWidget* tqparent_, const char* name_/*=0*/)
+ : TQTabWidget(tqparent_, name_) {
}
-QTabBar* TabControl::tabBar() const {
- return QTabWidget::tabBar();
+TQTabBar* TabControl::tabBar() const {
+ return TQTabWidget::tabBar();
}
void TabControl::setFocusToFirstChild() {
- QWidget* page = currentPage();
+ TQWidget* page = currentPage();
Q_ASSERT(page);
- QObjectList* list = page->queryList("QWidget");
- for(QObjectListIt it(*list); it.current(); ++it) {
- QWidget* w = static_cast<QWidget*>(it.current());
+ TQObjectList* list = page->queryList(TQWIDGET_OBJECT_NAME_STRING);
+ for(TQObjectListIt it(*list); it.current(); ++it) {
+ TQWidget* w = TQT_TQWIDGET(it.current());
if(w->isFocusEnabled()) {
w->setFocus();
break;
@@ -43,7 +43,7 @@ void TabControl::setFocusToFirstChild() {
// have to loop backwards since count() gets decremented on delete
void TabControl::clear() {
for(int i = count(); i > 0; --i) {
- QWidget* w = page(i-1);
+ TQWidget* w = page(i-1);
if(w) {
removePage(w);
delete w;
@@ -52,8 +52,8 @@ void TabControl::clear() {
}
void TabControl::setTabBarHidden(bool hide_) {
- QWidget* rightcorner = cornerWidget(TopRight);
- QWidget* leftcorner = cornerWidget(TopLeft);
+ TQWidget* rightcorner = cornerWidget(TopRight);
+ TQWidget* leftcorner = cornerWidget(TopLeft);
if(hide_) {
if(leftcorner) {
diff --git a/src/gui/tabcontrol.h b/src/gui/tabcontrol.h
index 20d22f5..a99c94b 100644
--- a/src/gui/tabcontrol.h
+++ b/src/gui/tabcontrol.h
@@ -14,7 +14,7 @@
#ifndef TABCONTROL_H
#define TABCONTROL_H
-#include <qtabwidget.h>
+#include <tqtabwidget.h>
namespace Tellico {
namespace GUI {
@@ -22,16 +22,17 @@ namespace Tellico {
/**
* @author Robby Stephenson
*/
-class TabControl : public QTabWidget {
+class TabControl : public TQTabWidget {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor
*/
- TabControl(QWidget* parent, const char* name=0);
+ TabControl(TQWidget* tqparent, const char* name=0);
- QTabBar* tabBar() const;
+ TQTabBar* tabBar() const;
void setTabBarHidden(bool hide);
/**
diff --git a/src/gui/tablefieldwidget.cpp b/src/gui/tablefieldwidget.cpp
index 30f89b4..bac3ea0 100644
--- a/src/gui/tablefieldwidget.cpp
+++ b/src/gui/tablefieldwidget.cpp
@@ -21,7 +21,7 @@
#include <kiconloader.h>
#include <kinputdialog.h>
-#include <qtable.h>
+#include <tqtable.h>
namespace {
static const int MIN_TABLE_ROWS = 5;
@@ -30,18 +30,18 @@ namespace {
using Tellico::GUI::TableFieldWidget;
-TableFieldWidget::TableFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : FieldWidget(field_, parent_, name_), m_field(field_), m_row(-1), m_col(-1) {
+TableFieldWidget::TableFieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : FieldWidget(field_, tqparent_, name_), m_field(field_), m_row(-1), m_col(-1) {
bool ok;
- m_columns = Tellico::toUInt(field_->property(QString::fromLatin1("columns")), &ok);
+ m_columns = Tellico::toUInt(field_->property(TQString::tqfromLatin1("columns")), &ok);
if(!ok) {
m_columns = 1;
} else {
- m_columns = QMIN(m_columns, MAX_TABLE_COLS); // max of 5 columns
+ m_columns = TQMIN(m_columns, MAX_TABLE_COLS); // max of 5 columns
}
- m_table = new QTable(MIN_TABLE_ROWS, m_columns, this);
+ m_table = new TQTable(MIN_TABLE_ROWS, m_columns, this);
labelColumns(m_field);
// allow renaming of column titles
m_table->horizontalHeader()->setClickEnabled(true);
@@ -49,45 +49,45 @@ TableFieldWidget::TableFieldWidget(Data::FieldPtr field_, QWidget* parent_, cons
m_table->verticalHeader()->setClickEnabled(true);
m_table->verticalHeader()->installEventFilter(this);
- connect(m_table->verticalHeader(), SIGNAL(indexChange(int, int, int)), SIGNAL(modified()));
+ connect(m_table->verticalHeader(), TQT_SIGNAL(indexChange(int, int, int)), TQT_SIGNAL(modified()));
m_table->setDragEnabled(false);
- m_table->setFocusStyle(QTable::FollowStyle);
+ m_table->setFocusStyle(TQTable::FollowStyle);
m_table->setRowMovingEnabled(true); // rows can be moved
m_table->setColumnMovingEnabled(false); // columns remain fixed
m_table->setColumnStretchable(m_columns-1, true);
m_table->adjustColumn(m_columns-1);
- m_table->setSelectionMode(QTable::NoSelection);
- m_table->setHScrollBarMode(QScrollView::AlwaysOff);
+ m_table->setSelectionMode(TQTable::NoSelection);
+ m_table->setHScrollBarMode(TQScrollView::AlwaysOff);
- connect(m_table, SIGNAL(valueChanged(int, int)), SIGNAL(modified()));
- connect(m_table, SIGNAL(currentChanged(int, int)), SLOT(slotCheckRows(int, int)));
- connect(m_table, SIGNAL(valueChanged(int, int)), SLOT(slotResizeColumn(int, int)));
- connect(m_table, SIGNAL(contextMenuRequested(int, int, const QPoint&)), SLOT(contextMenu(int, int, const QPoint&)));
+ connect(m_table, TQT_SIGNAL(valueChanged(int, int)), TQT_SIGNAL(modified()));
+ connect(m_table, TQT_SIGNAL(currentChanged(int, int)), TQT_SLOT(slotCheckRows(int, int)));
+ connect(m_table, TQT_SIGNAL(valueChanged(int, int)), TQT_SLOT(slotResizeColumn(int, int)));
+ connect(m_table, TQT_SIGNAL(contextMenuRequested(int, int, const TQPoint&)), TQT_SLOT(contextMenu(int, int, const TQPoint&)));
registerWidget();
}
-QString TableFieldWidget::text() const {
- QString text, str, rstack, cstack, rowStr;
+TQString TableFieldWidget::text() const {
+ TQString text, str, rstack, cstack, rowStr;
for(int row = 0; row < m_table->numRows(); ++row) {
rowStr.truncate(0);
cstack.truncate(0);
for(int col = 0; col < m_table->numCols(); ++col) {
str = m_table->text(row, col).simplifyWhiteSpace();
if(str.isEmpty()) {
- cstack += QString::fromLatin1("::");
+ cstack += TQString::tqfromLatin1("::");
} else {
- rowStr += cstack + str + QString::fromLatin1("::");
+ rowStr += cstack + str + TQString::tqfromLatin1("::");
cstack.truncate(0);
}
}
if(rowStr.isEmpty()) {
- rstack += QString::fromLatin1("; ");
+ rstack += TQString::tqfromLatin1("; ");
} else {
rowStr.truncate(rowStr.length()-2); // remove last semi-colon and space
- text += rstack + rowStr + QString::fromLatin1("; ");
+ text += rstack + rowStr + TQString::tqfromLatin1("; ");
rstack.truncate(0);
}
}
@@ -114,8 +114,8 @@ QString TableFieldWidget::text() const {
return text;
}
-void TableFieldWidget::setText(const QString& text_) {
- QStringList list = Data::Field::split(text_, true);
+void TableFieldWidget::setText(const TQString& text_) {
+ TQStringList list = Data::Field::split(text_, true);
// add additional rows if needed
if(static_cast<int>(list.count()) > m_table->numRows()) {
m_table->insertRows(m_table->numRows(), list.count()-m_table->numRows());
@@ -123,12 +123,12 @@ void TableFieldWidget::setText(const QString& text_) {
int row;
for(row = 0; row < static_cast<int>(list.count()); ++row) {
for(int col = 0; col < m_table->numCols(); ++col) {
- m_table->setText(row, col, list[row].section(QString::fromLatin1("::"), col, col));
+ m_table->setText(row, col, list[row].section(TQString::tqfromLatin1("::"), col, col));
}
m_table->showRow(row);
}
// remove any un-needed rows
- int minRow = QMAX(row, MIN_TABLE_ROWS);
+ int minRow = TQMAX(row, MIN_TABLE_ROWS);
for(row = m_table->numRows()-1; row >= minRow; --row) {
m_table->removeRow(row);
}
@@ -145,7 +145,7 @@ void TableFieldWidget::clear() {
wasEmpty = false;
}
for(int col = 0; col < m_table->numCols(); ++col) {
- m_table->setText(row, col, QString::null);
+ m_table->setText(row, col, TQString());
}
if(row >= MIN_TABLE_ROWS) {
m_table->removeRow(row);
@@ -158,7 +158,7 @@ void TableFieldWidget::clear() {
}
}
-QWidget* TableFieldWidget::widget() {
+TQWidget* TableFieldWidget::widget() {
return m_table;
}
@@ -176,13 +176,13 @@ void TableFieldWidget::slotRenameColumn() {
if(m_col < 0 || m_col >= m_columns) {
return;
}
- QString name = m_table->horizontalHeader()->label(m_col);
+ TQString name = m_table->horizontalHeader()->label(m_col);
bool ok;
- QString newName = KInputDialog::getText(i18n("Rename Column"), i18n("New column name:"),
+ TQString newName = KInputDialog::getText(i18n("Rename Column"), i18n("New column name:"),
name, &ok, this);
if(ok && !newName.isEmpty()) {
Data::FieldPtr newField = new Data::Field(*m_field);
- newField->setProperty(QString::fromLatin1("column%1").arg(m_col+1), newName);
+ newField->setProperty(TQString::tqfromLatin1("column%1").tqarg(m_col+1), newName);
if(Kernel::self()->modifyField(newField)) {
m_field = newField;
labelColumns(m_field);
@@ -201,9 +201,9 @@ bool TableFieldWidget::emptyRow(int row_) const {
void TableFieldWidget::labelColumns(Data::FieldPtr field_) {
for(int i = 0; i < m_columns; ++i) {
- QString s = field_->property(QString::fromLatin1("column%1").arg(i+1));
+ TQString s = field_->property(TQString::tqfromLatin1("column%1").tqarg(i+1));
if(s.isEmpty()) {
- s = i18n("Column %1").arg(i+1);
+ s = i18n("Column %1").tqarg(i+1);
}
m_table->horizontalHeader()->setLabel(i, s);
}
@@ -211,11 +211,11 @@ void TableFieldWidget::labelColumns(Data::FieldPtr field_) {
void TableFieldWidget::updateFieldHook(Data::FieldPtr, Data::FieldPtr newField_) {
bool ok;
- m_columns = Tellico::toUInt(newField_->property(QString::fromLatin1("columns")), &ok);
+ m_columns = Tellico::toUInt(newField_->property(TQString::tqfromLatin1("columns")), &ok);
if(!ok) {
m_columns = 1;
} else {
- m_columns = QMIN(m_columns, MAX_TABLE_COLS); // max of 5 columns
+ m_columns = TQMIN(m_columns, MAX_TABLE_COLS); // max of 5 columns
}
if(m_columns != m_table->numCols()) {
m_table->setNumCols(m_columns);
@@ -224,11 +224,11 @@ void TableFieldWidget::updateFieldHook(Data::FieldPtr, Data::FieldPtr newField_)
labelColumns(newField_);
}
-bool TableFieldWidget::eventFilter(QObject* obj_, QEvent* ev_) {
- if(ev_->type() == QEvent::MouseButtonPress
- && static_cast<QMouseEvent*>(ev_)->button() == Qt::RightButton) {
- if(obj_ == m_table->horizontalHeader()) {
- QMouseEvent* ev = static_cast<QMouseEvent*>(ev_);
+bool TableFieldWidget::eventFilter(TQObject* obj_, TQEvent* ev_) {
+ if(ev_->type() == TQEvent::MouseButtonPress
+ && TQT_TQMOUSEEVENT(ev_)->button() == Qt::RightButton) {
+ if(TQT_BASE_OBJECT(obj_) == TQT_BASE_OBJECT(m_table->horizontalHeader())) {
+ TQMouseEvent* ev = TQT_TQMOUSEEVENT(ev_);
// might be scrolled
int pos = ev->x() + m_table->horizontalHeader()->offset();
int col = m_table->horizontalHeader()->sectionAt(pos);
@@ -238,12 +238,12 @@ bool TableFieldWidget::eventFilter(QObject* obj_, QEvent* ev_) {
m_row = -1;
m_col = col;
KPopupMenu menu(this);
- menu.insertItem(SmallIconSet(QString::fromLatin1("edit")), i18n("Rename Column..."),
- this, SLOT(slotRenameColumn()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("edit")), i18n("Rename Column..."),
+ this, TQT_SLOT(slotRenameColumn()));
menu.exec(ev->globalPos());
return true;
- } else if(obj_ == m_table->verticalHeader()) {
- QMouseEvent* ev = static_cast<QMouseEvent*>(ev_);
+ } else if(TQT_BASE_OBJECT(obj_) == TQT_BASE_OBJECT(m_table->verticalHeader())) {
+ TQMouseEvent* ev = TQT_TQMOUSEEVENT(ev_);
// might be scrolled
int pos = ev->y() + m_table->verticalHeader()->offset();
int row = m_table->verticalHeader()->sectionAt(pos);
@@ -260,7 +260,7 @@ bool TableFieldWidget::eventFilter(QObject* obj_, QEvent* ev_) {
return FieldWidget::eventFilter(obj_, ev_);
}
-void TableFieldWidget::contextMenu(int row_, int col_, const QPoint& p_) {
+void TableFieldWidget::contextMenu(int row_, int col_, const TQPoint& p_) {
// might get called with col == -1 for clicking on vertical header
// but a negative row means clicking outside bounds of table
if(row_ < 0) {
@@ -271,29 +271,29 @@ void TableFieldWidget::contextMenu(int row_, int col_, const QPoint& p_) {
int id;
KPopupMenu menu(this);
- menu.insertItem(SmallIconSet(QString::fromLatin1("insrow")), i18n("Insert Row"),
- this, SLOT(slotInsertRow()));
- menu.insertItem(SmallIconSet(QString::fromLatin1("remrow")), i18n("Remove Row"),
- this, SLOT(slotRemoveRow()));
- id = menu.insertItem(SmallIconSet(QString::fromLatin1("1uparrow")), i18n("Move Row Up"),
- this, SLOT(slotMoveRowUp()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("insrow")), i18n("Insert Row"),
+ this, TQT_SLOT(slotInsertRow()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("remrow")), i18n("Remove Row"),
+ this, TQT_SLOT(slotRemoveRow()));
+ id = menu.insertItem(SmallIconSet(TQString::tqfromLatin1("1uparrow")), i18n("Move Row Up"),
+ this, TQT_SLOT(slotMoveRowUp()));
if(m_row == 0) {
menu.setItemEnabled(id, false);
}
- id = menu.insertItem(SmallIconSet(QString::fromLatin1("1downarrow")), i18n("Move Row Down"),
- this, SLOT(slotMoveRowDown()));
+ id = menu.insertItem(SmallIconSet(TQString::tqfromLatin1("1downarrow")), i18n("Move Row Down"),
+ this, TQT_SLOT(slotMoveRowDown()));
if(m_row == m_table->numRows()-1) {
menu.setItemEnabled(id, false);
}
menu.insertSeparator();
- id = menu.insertItem(SmallIconSet(QString::fromLatin1("edit")), i18n("Rename Column..."),
- this, SLOT(slotRenameColumn()));
+ id = menu.insertItem(SmallIconSet(TQString::tqfromLatin1("edit")), i18n("Rename Column..."),
+ this, TQT_SLOT(slotRenameColumn()));
if(m_col < 0 || m_col > m_columns-1) {
menu.setItemEnabled(id, false);
}
menu.insertSeparator();
- menu.insertItem(SmallIconSet(QString::fromLatin1("locationbar_erase")), i18n("Clear Table"),
- this, SLOT(clear()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("locationbar_erase")), i18n("Clear Table"),
+ this, TQT_SLOT(clear()));
menu.exec(p_);
}
diff --git a/src/gui/tablefieldwidget.h b/src/gui/tablefieldwidget.h
index da9157d..03060b2 100644
--- a/src/gui/tablefieldwidget.h
+++ b/src/gui/tablefieldwidget.h
@@ -14,8 +14,8 @@
#ifndef TABLEFIELDWIDGET_H
#define TABLEFIELDWIDGET_H
-class QTable;
-class QEvent;
+class TQTable;
+class TQEvent;
#include "fieldwidget.h"
#include "../datavectors.h"
@@ -28,28 +28,29 @@ namespace Tellico {
*/
class TableFieldWidget : public FieldWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- TableFieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ TableFieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~TableFieldWidget() {}
- virtual QString text() const;
- virtual void setText(const QString& text);
+ virtual TQString text() const;
+ virtual void setText(const TQString& text);
/**
* Event filter used to popup the menu
*/
- bool eventFilter(QObject* obj, QEvent* ev);
+ bool eventFilter(TQObject* obj, TQEvent* ev);
public slots:
virtual void clear();
protected:
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual void updateFieldHook(Data::FieldPtr oldField, Data::FieldPtr newField);
private slots:
- void contextMenu(int row, int col, const QPoint& p);
+ void contextMenu(int row, int col, const TQPoint& p);
void slotCheckRows(int row, int col);
void slotResizeColumn(int row, int col);
void slotRenameColumn();
@@ -62,7 +63,7 @@ private:
bool emptyRow(int row) const;
void labelColumns(Data::FieldPtr field);
- QTable* m_table;
+ TQTable* m_table;
int m_columns;
Data::FieldPtr m_field;
int m_row;
diff --git a/src/gui/urlfieldwidget.cpp b/src/gui/urlfieldwidget.cpp
index f3c2afd..3c7c720 100644
--- a/src/gui/urlfieldwidget.cpp
+++ b/src/gui/urlfieldwidget.cpp
@@ -25,26 +25,26 @@ using Tellico::GUI::URLFieldWidget;
// subclass of KURLCompletion is needed so the KURLLabel
// can open relative links. I don't want to have to have to update
// the base directory of the completion every time a new document is opened
-QString URLFieldWidget::URLCompletion::makeCompletion(const QString& text_) {
+TQString URLFieldWidget::URLCompletion::makeCompletion(const TQString& text_) {
// KURLCompletion::makeCompletion() uses an internal variable instead
// of calling KURLCompletion::dir() so need to set the base dir before completing
setDir(Kernel::self()->URL().directory());
return KURLCompletion::makeCompletion(text_);
}
-URLFieldWidget::URLFieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/)
- : FieldWidget(field_, parent_, name_), m_run(0) {
+URLFieldWidget::URLFieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : FieldWidget(field_, tqparent_, name_), m_run(0) {
m_requester = new KURLRequester(this);
m_requester->lineEdit()->setCompletionObject(new URLCompletion());
m_requester->lineEdit()->setAutoDeleteCompletionObject(true);
- connect(m_requester, SIGNAL(textChanged(const QString&)), SIGNAL(modified()));
- connect(m_requester, SIGNAL(textChanged(const QString&)), label(), SLOT(setURL(const QString&)));
- connect(label(), SIGNAL(leftClickedURL(const QString&)), SLOT(slotOpenURL(const QString&)));
+ connect(m_requester, TQT_SIGNAL(textChanged(const TQString&)), TQT_SIGNAL(modified()));
+ connect(m_requester, TQT_SIGNAL(textChanged(const TQString&)), label(), TQT_SLOT(setURL(const TQString&)));
+ connect(label(), TQT_SIGNAL(leftClickedURL(const TQString&)), TQT_SLOT(slotOpenURL(const TQString&)));
registerWidget();
// special case, remember if it's a relative url
- m_isRelative = field_->property(QString::fromLatin1("relative")) == Latin1Literal("true");
+ m_isRelative = field_->property(TQString::tqfromLatin1("relative")) == Latin1Literal("true");
}
URLFieldWidget::~URLFieldWidget() {
@@ -53,7 +53,7 @@ URLFieldWidget::~URLFieldWidget() {
}
}
-QString URLFieldWidget::text() const {
+TQString URLFieldWidget::text() const {
if(m_isRelative) {
return KURL::relativeURL(Kernel::self()->URL(), m_requester->url());
}
@@ -63,7 +63,7 @@ QString URLFieldWidget::text() const {
return KURL(m_requester->url()).url();
}
-void URLFieldWidget::setText(const QString& text_) {
+void URLFieldWidget::setText(const TQString& text_) {
blockSignals(true);
m_requester->blockSignals(true);
@@ -80,10 +80,10 @@ void URLFieldWidget::clear() {
}
void URLFieldWidget::updateFieldHook(Data::FieldPtr, Data::FieldPtr newField_) {
- m_isRelative = newField_->property(QString::fromLatin1("relative")) == Latin1Literal("true");
+ m_isRelative = newField_->property(TQString::tqfromLatin1("relative")) == Latin1Literal("true");
}
-void URLFieldWidget::slotOpenURL(const QString& url_) {
+void URLFieldWidget::slotOpenURL(const TQString& url_) {
if(url_.isEmpty()) {
return;
}
@@ -91,7 +91,7 @@ void URLFieldWidget::slotOpenURL(const QString& url_) {
m_run = new KRun(KURL(Kernel::self()->URL(), url_));
}
-QWidget* URLFieldWidget::widget() {
+TQWidget* URLFieldWidget::widget() {
return m_requester;
}
diff --git a/src/gui/urlfieldwidget.h b/src/gui/urlfieldwidget.h
index 70e9505..15c8087 100644
--- a/src/gui/urlfieldwidget.h
+++ b/src/gui/urlfieldwidget.h
@@ -21,7 +21,7 @@ class KURLRequester;
#include <krun.h>
#include <kurlcompletion.h>
-#include <qguardedptr.h>
+#include <tqguardedptr.h>
namespace Tellico {
namespace GUI {
@@ -31,34 +31,35 @@ namespace Tellico {
*/
class URLFieldWidget : public FieldWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- URLFieldWidget(Data::FieldPtr field, QWidget* parent, const char* name=0);
+ URLFieldWidget(Data::FieldPtr field, TQWidget* tqparent, const char* name=0);
virtual ~URLFieldWidget();
- virtual QString text() const;
- virtual void setText(const QString& text);
+ virtual TQString text() const;
+ virtual void setText(const TQString& text);
public slots:
virtual void clear();
protected:
- virtual QWidget* widget();
+ virtual TQWidget* widget();
virtual void updateFieldHook(Data::FieldPtr oldField, Data::FieldPtr newField);
protected slots:
- void slotOpenURL(const QString& url);
+ void slotOpenURL(const TQString& url);
private:
class URLCompletion : public KURLCompletion {
public:
URLCompletion() : KURLCompletion() {}
- virtual QString makeCompletion(const QString& text);
+ virtual TQString makeCompletion(const TQString& text);
};
KURLRequester* m_requester;
bool m_isRelative : 1;
- QGuardedPtr<KRun> m_run;
+ TQGuardedPtr<KRun> m_run;
};
} // end GUI namespace
diff --git a/src/image.cpp b/src/image.cpp
index 35e14cb..88c134f 100644
--- a/src/image.cpp
+++ b/src/image.cpp
@@ -19,8 +19,8 @@
#include <kpixmapio.h>
#include <kstaticdeleter.h>
-#include <qbuffer.h>
-#include <qregexp.h>
+#include <tqbuffer.h>
+#include <tqregexp.h>
using Tellico::Data::Image;
using Tellico::Data::ImageInfo;
@@ -34,45 +34,45 @@ KPixmapIO* Image::io() {
return s_pixmapIO;
}
-Image::Image() : QImage(), m_id(QString::null), m_linkOnly(false) {
+Image::Image() : TQImage(), m_id(TQString()), m_linkOnly(false) {
}
// I'm using the MD5 hash as the id. I consider it rather unlikely that two images in one
// collection could ever have the same hash, and this lets me do a fast comparison of two images
// simply by comparing their ids.
-Image::Image(const QString& filename_) : QImage(filename_), m_linkOnly(false) {
- m_format = QImage::imageFormat(filename_);
+Image::Image(const TQString& filename_) : TQImage(filename_), m_linkOnly(false) {
+ m_format = TQImage::imageFormat(filename_);
calculateID();
}
-Image::Image(const QImage& img_, const QString& format_) : QImage(img_), m_format(format_), m_linkOnly(false) {
+Image::Image(const TQImage& img_, const TQString& format_) : TQImage(img_), m_format(format_), m_linkOnly(false) {
calculateID();
}
-Image::Image(const QByteArray& data_, const QString& format_, const QString& id_)
- : QImage(data_), m_id(idClean(id_)), m_format(format_), m_linkOnly(false) {
+Image::Image(const TQByteArray& data_, const TQString& format_, const TQString& id_)
+ : TQImage(data_), m_id(idClean(id_)), m_format(format_), m_linkOnly(false) {
if(isNull()) {
- m_id = QString();
+ m_id = TQString();
}
}
Image::~Image() {
}
-QByteArray Image::byteArray() const {
+TQByteArray Image::byteArray() const {
return byteArray(*this, outputFormat(m_format));
}
bool Image::isNull() const {
// 1x1 images are considered null for Tellico. Amazon returns some like that.
- return QImage::isNull() || (width() < 2 && height() < 2);
+ return TQImage::isNull() || (width() < 2 && height() < 2);
}
-QPixmap Image::convertToPixmap() const {
+TQPixmap Image::convertToPixmap() const {
return io()->convertToPixmap(*this);
}
-QPixmap Image::convertToPixmap(int w_, int h_) const {
+TQPixmap Image::convertToPixmap(int w_, int h_) const {
if(w_ < width() || h_ < height()) {
return io()->convertToPixmap(this->smoothScale(w_, h_, ScaleMin));
} else {
@@ -80,9 +80,9 @@ QPixmap Image::convertToPixmap(int w_, int h_) const {
}
}
-QCString Image::outputFormat(const QCString& inputFormat) {
- QStrList list = QImage::outputFormats();
- for(QStrListIterator it(list); it.current(); ++it) {
+TQCString Image::outputFormat(const TQCString& inputFormat) {
+ TQStrList list = TQImage::outputFormats();
+ for(TQStrListIterator it(list); it.current(); ++it) {
if(inputFormat == it.current()) {
return inputFormat;
}
@@ -91,24 +91,24 @@ QCString Image::outputFormat(const QCString& inputFormat) {
return "PNG";
}
-QByteArray Image::byteArray(const QImage& img_, const QCString& outputFormat_) {
- QByteArray ba;
- QBuffer buf(ba);
+TQByteArray Image::byteArray(const TQImage& img_, const TQCString& outputFormat_) {
+ TQByteArray ba;
+ TQBuffer buf(ba);
buf.open(IO_WriteOnly);
- QImageIO iio(&buf, outputFormat_);
+ TQImageIO iio(&buf, outputFormat_);
iio.setImage(img_);
iio.write();
buf.close();
return ba;
}
-QString Image::idClean(const QString& id_) {
- static const QRegExp rx('[' + QRegExp::escape(QString::fromLatin1("/@<>#\"&%?={}|^~[]'`\\:+")) + ']');
- QString clean = id_;
+TQString Image::idClean(const TQString& id_) {
+ static const TQRegExp rx('[' + TQRegExp::escape(TQString::tqfromLatin1("/@<>#\"&%?={}|^~[]'`\\:+")) + ']');
+ TQString clean = id_;
return clean.remove(rx);
}
-void Image::setID(const QString& id_) {
+void Image::setID(const TQString& id_) {
m_id = id_;
}
@@ -116,7 +116,7 @@ void Image::calculateID() {
// the id will eventually be used as a filename
if(!isNull()) {
KMD5 md5(byteArray());
- m_id = QString::fromLatin1(md5.hexDigest()) + QString::fromLatin1(".") + QString::fromLatin1(m_format).lower();
+ m_id = TQString::tqfromLatin1(md5.hexDigest()) + TQString::tqfromLatin1(".") + TQString::tqfromLatin1(m_format).lower();
m_id = idClean(m_id);
}
}
@@ -131,7 +131,7 @@ ImageInfo::ImageInfo(const Image& img_)
, m_height(img_.height()) {
}
-ImageInfo::ImageInfo(const QString& id_, const QCString& format_, int w_, int h_, bool l_)
+ImageInfo::ImageInfo(const TQString& id_, const TQCString& format_, int w_, int h_, bool l_)
: id(id_)
, format(format_)
, linkOnly(l_)
diff --git a/src/image.h b/src/image.h
index 9545500..264af1b 100644
--- a/src/image.h
+++ b/src/image.h
@@ -14,8 +14,8 @@
#ifndef IMAGE_H
#define IMAGE_H
-#include <qimage.h>
-#include <qstring.h>
+#include <tqimage.h>
+#include <tqstring.h>
class KPixmapIO;
@@ -28,7 +28,7 @@ namespace Tellico {
/**
* @author Robby Stephenson
*/
-class Image : public QImage {
+class Image : public TQImage {
friend class Tellico::ImageFactory;
friend class Tellico::FileHandler;
@@ -36,35 +36,35 @@ friend class Tellico::FileHandler;
public:
~Image();
- const QString& id() const { return m_id; };
- const QCString& format() const { return m_format; };
- QByteArray byteArray() const;
+ const TQString& id() const { return m_id; };
+ const TQCString& format() const { return m_format; };
+ TQByteArray byteArray() const;
bool isNull() const;
bool linkOnly() const { return m_linkOnly; }
void setLinkOnly(bool l) { m_linkOnly = l; }
- QPixmap convertToPixmap() const;
- QPixmap convertToPixmap(int width, int height) const;
+ TQPixmap convertToPixmap() const;
+ TQPixmap convertToPixmap(int width, int height) const;
- static QCString outputFormat(const QCString& inputFormat);
- static QByteArray byteArray(const QImage& img, const QCString& outputFormat);
- static QString idClean(const QString& id);
+ static TQCString outputFormat(const TQCString& inputFormat);
+ static TQByteArray byteArray(const TQImage& img, const TQCString& outputFormat);
+ static TQString idClean(const TQString& id);
private:
Image();
- explicit Image(const QString& filename);
- Image(const QImage& image, const QString& format);
- Image(const QByteArray& data, const QString& format, const QString& id);
+ explicit Image(const TQString& filename);
+ Image(const TQImage& image, const TQString& format);
+ Image(const TQByteArray& data, const TQString& format, const TQString& id);
//disable copy
Image(const Image&);
Image& operator=(const Image&);
- void setID(const QString& id);
+ void setID(const TQString& id);
void calculateID();
- QString m_id;
- QCString m_format;
+ TQString m_id;
+ TQCString m_format;
bool m_linkOnly : 1;
static KPixmapIO* s_pixmapIO;
@@ -75,10 +75,10 @@ class ImageInfo {
public:
ImageInfo() {}
explicit ImageInfo(const Image& img);
- ImageInfo(const QString& id, const QCString& format, int w, int h, bool link);
+ ImageInfo(const TQString& id, const TQCString& format, int w, int h, bool link);
bool isNull() const { return id.isEmpty(); }
- QString id;
- QCString format;
+ TQString id;
+ TQCString format;
bool linkOnly : 1;
int width(bool loadIfNecessary=true) const;
diff --git a/src/imagefactory.cpp b/src/imagefactory.cpp
index 00a980a..fe9fc6e 100644
--- a/src/imagefactory.cpp
+++ b/src/imagefactory.cpp
@@ -24,8 +24,8 @@
#include <kapplication.h>
#include <kimageeffect.h>
-#include <qfile.h>
-#include <qdir.h>
+#include <tqfile.h>
+#include <tqdir.h>
#define RELEASE_IMAGES
@@ -34,18 +34,18 @@ using Tellico::ImageFactory;
bool ImageFactory::s_needInit = true;
const Tellico::Data::Image ImageFactory::s_null;
-QDict<Tellico::Data::Image> ImageFactory::s_imageDict;
+TQDict<Tellico::Data::Image> ImageFactory::s_imageDict;
// since most images get turned into pixmaps quickly, use 10 megs
// for images and 10 megs for pixmaps
-QCache<Tellico::Data::Image> ImageFactory::s_imageCache(10 * 1024 * 1024);
-QCache<QPixmap> ImageFactory::s_pixmapCache(10 * 1024 * 1024);
+TQCache<Tellico::Data::Image> ImageFactory::s_imageCache(10 * 1024 * 1024);
+TQCache<TQPixmap> ImageFactory::s_pixmapCache(10 * 1024 * 1024);
// this image info map is just for big images that don't fit
// in the cache, so that don't have to be continually reloaded to get info
-QMap<QString, Tellico::Data::ImageInfo> ImageFactory::s_imageInfoMap;
+TQMap<TQString, Tellico::Data::ImageInfo> ImageFactory::s_imageInfoMap;
Tellico::StringSet ImageFactory::s_imagesInTmpDir;
Tellico::StringSet ImageFactory::s_imagesToRelease;
KTempDir* ImageFactory::s_tmpDir = 0;
-QString ImageFactory::s_localDir;
+TQString ImageFactory::s_localDir;
void ImageFactory::init() {
if(!s_needInit) {
@@ -58,7 +58,7 @@ void ImageFactory::init() {
s_needInit = false;
}
-QString ImageFactory::tempDir() {
+TQString ImageFactory::tempDir() {
if(!s_tmpDir) {
s_tmpDir = new KTempDir();
s_tmpDir->setAutoDelete(true);
@@ -66,19 +66,19 @@ QString ImageFactory::tempDir() {
return s_tmpDir->name();
}
-QString ImageFactory::dataDir() {
- static const QString dataDir = Tellico::saveLocation(QString::fromLatin1("data/"));
+TQString ImageFactory::dataDir() {
+ static const TQString dataDir = Tellico::saveLocation(TQString::tqfromLatin1("data/"));
return dataDir;
}
-QString ImageFactory::localDir() {
+TQString ImageFactory::localDir() {
if(s_localDir.isEmpty()) {
return dataDir();
}
return s_localDir;
}
-QString ImageFactory::addImage(const KURL& url_, bool quiet_, const KURL& refer_, bool link_) {
+TQString ImageFactory::addImage(const KURL& url_, bool quiet_, const KURL& refer_, bool link_) {
return addImageImpl(url_, quiet_, refer_, link_).id();
}
@@ -120,15 +120,15 @@ const Tellico::Data::Image& ImageFactory::addImageImpl(const KURL& url_, bool qu
return *img;
}
-QString ImageFactory::addImage(const QImage& image_, const QString& format_) {
+TQString ImageFactory::addImage(const TQImage& image_, const TQString& format_) {
return addImageImpl(image_, format_).id();
}
-QString ImageFactory::addImage(const QPixmap& pix_, const QString& format_) {
+TQString ImageFactory::addImage(const TQPixmap& pix_, const TQString& format_) {
return addImageImpl(pix_.convertToImage(), format_).id();
}
-const Tellico::Data::Image& ImageFactory::addImageImpl(const QImage& image_, const QString& format_) {
+const Tellico::Data::Image& ImageFactory::addImageImpl(const TQImage& image_, const TQString& format_) {
Data::Image* img = new Data::Image(image_, format_);
if(hasImage(img->id())) {
const Data::Image& img2 = imageById(img->id());
@@ -146,37 +146,37 @@ const Tellico::Data::Image& ImageFactory::addImageImpl(const QImage& image_, con
return *img;
}
-QString ImageFactory::addImage(const QByteArray& data_, const QString& format_, const QString& id_) {
+TQString ImageFactory::addImage(const TQByteArray& data_, const TQString& format_, const TQString& id_) {
return addImageImpl(data_, format_, id_).id();
}
-const Tellico::Data::Image& ImageFactory::addImageImpl(const QByteArray& data_, const QString& format_,
- const QString& id_) {
+const Tellico::Data::Image& ImageFactory::addImageImpl(const TQByteArray& data_, const TQString& format_,
+ const TQString& id_) {
if(id_.isEmpty()) {
return s_null;
}
// do not call imageById(), it causes infinite looping with Document::loadImage()
- Data::Image* img = s_imageCache.find(id_);
+ Data::Image* img = s_imageCache.tqfind(id_);
if(img) {
- myLog() << "ImageFactory::addImageImpl(QByteArray) - already exists in cache: " << id_ << endl;
+ myLog() << "ImageFactory::addImageImpl(TQByteArray) - already exists in cache: " << id_ << endl;
return *img;
}
- img = s_imageDict.find(id_);
+ img = s_imageDict.tqfind(id_);
if(img) {
- myLog() << "ImageFactory::addImageImpl(QByteArray) - already exists in dict: " << id_ << endl;
+ myLog() << "ImageFactory::addImageImpl(TQByteArray) - already exists in dict: " << id_ << endl;
return *img;
}
img = new Data::Image(data_, format_, id_);
if(img->isNull()) {
- myDebug() << "ImageFactory::addImageImpl(QByteArray) - NULL IMAGE!!!!!" << endl;
+ myDebug() << "ImageFactory::addImageImpl(TQByteArray) - NULL IMAGE!!!!!" << endl;
delete img;
return s_null;
}
-// myLog() << "ImageFactory::addImageImpl(QByteArray) - " << data_.size()
+// myLog() << "ImageFactory::addImageImpl(TQByteArray) - " << data_.size()
// << " bytes, format = " << format_
// << ", id = "<< img->id() << endl;
@@ -185,7 +185,7 @@ const Tellico::Data::Image& ImageFactory::addImageImpl(const QByteArray& data_,
return *img;
}
-const Tellico::Data::Image& ImageFactory::addCachedImageImpl(const QString& id_, CacheDir dir_) {
+const Tellico::Data::Image& ImageFactory::addCachedImageImpl(const TQString& id_, CacheDir dir_) {
// myLog() << "ImageFactory::addCachedImageImpl() - dir = " << (dir_ == DataDir ? "DataDir" : "TmpDir" )
// << "; id = " << id_ << endl;
KURL u;
@@ -197,7 +197,7 @@ const Tellico::Data::Image& ImageFactory::addCachedImageImpl(const QString& id_,
u.setPath(tempDir() + id_);
}
- QString newID = addImage(u, true);
+ TQString newID = addImage(u, true);
if(newID.isEmpty()) {
myLog() << "ImageFactory::addCachedImageImpl() - null image loaded" << endl;
return s_null;
@@ -237,7 +237,7 @@ const Tellico::Data::Image& ImageFactory::addCachedImageImpl(const QString& id_,
return *img;
}
-bool ImageFactory::writeImage(const QString& id_, const KURL& targetDir_, bool force_) {
+bool ImageFactory::writeImage(const TQString& id_, const KURL& targetDir_, bool force_) {
// myLog() << "ImageFactory::writeImage() - target = " << targetDir_.url() << id_ << endl;
if(targetDir_.isEmpty()) {
myDebug() << "ImageFactory::writeImage() - empty target dir!" << endl;
@@ -261,25 +261,25 @@ bool ImageFactory::writeImage(const QString& id_, const KURL& targetDir_, bool f
return FileHandler::writeDataURL(target, img.byteArray(), force_);
}
-bool ImageFactory::writeCachedImage(const QString& id_, CacheDir dir_, bool force_ /*=false*/) {
+bool ImageFactory::writeCachedImage(const TQString& id_, CacheDir dir_, bool force_ /*=false*/) {
if(id_.isEmpty()) {
return false;
}
// myLog() << "ImageFactory::writeCachedImage() - dir = " << (dir_ == DataDir ? "DataDir" : "TmpDir" )
// << "; id = " << id_ << endl;
- QString path = ( dir_ == DataDir ? dataDir() : dir_ == TempDir ? tempDir() : localDir() );
+ TQString path = ( dir_ == DataDir ? dataDir() : dir_ == TempDir ? tempDir() : localDir() );
// images in the temp directory are erased every session, so we can track
// whether they've already been written with a simple string set.
// images in the data directory are persistent, so we have to check the
// actual file existence
- bool exists = ( dir_ == TempDir ? s_imagesInTmpDir.has(id_) : QFile::exists(path + id_));
+ bool exists = ( dir_ == TempDir ? s_imagesInTmpDir.has(id_) : TQFile::exists(path + id_));
if(!force_ && exists) {
// myDebug() << "...writeCachedImage() - exists = true: " << id_ << endl;
} else if(!force_ && !exists && dir_ == LocalDir) {
- QDir dir(localDir());
+ TQDir dir(localDir());
if(!dir.exists()) {
myDebug() << "ImageFactory::writeCachedImage() - creating " << s_localDir << endl;
dir.mkdir(localDir());
@@ -314,7 +314,7 @@ bool ImageFactory::writeCachedImage(const QString& id_, CacheDir dir_, bool forc
return success;
}
-const Tellico::Data::Image& ImageFactory::imageById(const QString& id_) {
+const Tellico::Data::Image& ImageFactory::imageById(const TQString& id_) {
if(id_.isEmpty()) {
myDebug() << "ImageFactory::imageById() - empty id" << endl;
return s_null;
@@ -328,13 +328,13 @@ const Tellico::Data::Image& ImageFactory::imageById(const QString& id_) {
// first check the cache, used for images that are in the data file, or are only temporary
// then the dict, used for images downloaded, but not yet saved anywhere
- Data::Image* img = s_imageCache.find(id_);
+ Data::Image* img = s_imageCache.tqfind(id_);
if(img) {
// myLog() << "...imageById() - found in cache" << endl;
return *img;
}
- img = s_imageDict.find(id_);
+ img = s_imageDict.tqfind(id_);
if(img) {
// myLog() << "...imageById() - found in dict" << endl;
return *img;
@@ -345,7 +345,7 @@ const Tellico::Data::Image& ImageFactory::imageById(const QString& id_) {
// also, the image info cache might not have it so check if the
// id is a valid absolute url
// yeah, it's probably slow
- if((s_imageInfoMap.contains(id_) && s_imageInfoMap[id_].linkOnly) || !KURL::isRelativeURL(id_)) {
+ if((s_imageInfoMap.tqcontains(id_) && s_imageInfoMap[id_].linkOnly) || !KURL::isRelativeURL(id_)) {
KURL u = id_;
if(u.isValid()) {
return addImageImpl(u, false, KURL(), true);
@@ -369,9 +369,9 @@ const Tellico::Data::Image& ImageFactory::imageById(const QString& id_) {
// try to do a delayed loading of the image
if(Data::Document::self()->loadImage(id_)) {
// loadImage() could insert in either the cache or the dict!
- img = s_imageCache.find(id_);
+ img = s_imageCache.tqfind(id_);
if(!img) {
- img = s_imageDict.find(id_);
+ img = s_imageDict.tqfind(id_);
}
if(img) {
// myLog() << "...imageById() - found in doc" << endl;
@@ -388,7 +388,7 @@ const Tellico::Data::Image& ImageFactory::imageById(const QString& id_) {
// don't check Config::writeImagesInFile(), someday we might have problems
// and the image will exist in the data dir, but the app thinks everything should
// be in the zip file instead
- bool exists = QFile::exists(dataDir() + id_);
+ bool exists = TQFile::exists(dataDir() + id_);
if(exists) {
// if we're loading from the application data dir, but images are being saved in the
// data file instead, then consider the document to be modified since it needs
@@ -408,7 +408,7 @@ const Tellico::Data::Image& ImageFactory::imageById(const QString& id_) {
if(localDir() == dataDir()) {
return s_null;
}
- exists = QFile::exists(localDir() + id_);
+ exists = TQFile::exists(localDir() + id_);
if(exists) {
// if we're loading from the application data dir, but images are being saved in the
// data file instead, then consider the document to be modified since it needs
@@ -428,8 +428,8 @@ const Tellico::Data::Image& ImageFactory::imageById(const QString& id_) {
return s_null;
}
-Tellico::Data::ImageInfo ImageFactory::imageInfo(const QString& id_) {
- if(s_imageInfoMap.contains(id_)) {
+Tellico::Data::ImageInfo ImageFactory::imageInfo(const TQString& id_) {
+ if(s_imageInfoMap.tqcontains(id_)) {
return s_imageInfoMap[id_];
}
@@ -444,31 +444,31 @@ void ImageFactory::cacheImageInfo(const Data::ImageInfo& info) {
s_imageInfoMap.insert(info.id, info);
}
-bool ImageFactory::validImage(const QString& id_) {
+bool ImageFactory::validImage(const TQString& id_) {
// don't try s_imageInfoMap[id_] cause it inserts an empty image info
- return s_imageInfoMap.contains(id_) || hasImage(id_) || !imageById(id_).isNull();
+ return s_imageInfoMap.tqcontains(id_) || hasImage(id_) || !imageById(id_).isNull();
}
-QPixmap ImageFactory::pixmap(const QString& id_, int width_, int height_) {
+TQPixmap ImageFactory::pixmap(const TQString& id_, int width_, int height_) {
if(id_.isEmpty()) {
- return QPixmap();
+ return TQPixmap();
}
- const QString key = id_ + '|' + QString::number(width_) + '|' + QString::number(height_);
- QPixmap* pix = s_pixmapCache.find(key);
+ const TQString key = id_ + '|' + TQString::number(width_) + '|' + TQString::number(height_);
+ TQPixmap* pix = s_pixmapCache.tqfind(key);
if(pix) {
return *pix;
}
const Data::Image& img = imageById(id_);
if(img.isNull()) {
- return QPixmap();
+ return TQPixmap();
}
if(width_ > 0 && height_ > 0) {
- pix = new QPixmap(img.convertToPixmap(width_, height_));
+ pix = new TQPixmap(img.convertToPixmap(width_, height_));
} else {
- pix = new QPixmap(img.convertToPixmap());
+ pix = new TQPixmap(img.convertToPixmap());
}
// pixmap size is w x h x d, divided by 8 bits
@@ -476,7 +476,7 @@ QPixmap ImageFactory::pixmap(const QString& id_, int width_, int height_) {
kdWarning() << "ImageFactory::pixmap() - can't save in cache: " << id_ << endl;
kdWarning() << "### Current pixmap size is " << (pix->width()*pix->height()*pix->depth()/8) << endl;
kdWarning() << "### Max pixmap cache size is " << s_pixmapCache.maxCost() << endl;
- QPixmap pix2(*pix);
+ TQPixmap pix2(*pix);
delete pix;
return pix2;
}
@@ -500,35 +500,35 @@ void ImageFactory::clean(bool deleteTempDirectory_) {
void ImageFactory::createStyleImages(const StyleOptions& opt_) {
const int collType = Kernel::self()->collectionType();
- const QColor& baseColor = opt_.baseColor.isValid()
+ const TQColor& baseColor = opt_.baseColor.isValid()
? opt_.baseColor
: Config::templateBaseColor(collType);
- const QColor& highColor = opt_.highlightedBaseColor.isValid()
+ const TQColor& highColor = opt_.highlightedBaseColor.isValid()
? opt_.highlightedBaseColor
: Config::templateHighlightedBaseColor(collType);
- const QColor& bgc1 = Tellico::blendColors(baseColor, highColor, 30);
- const QColor& bgc2 = Tellico::blendColors(baseColor, highColor, 50);
+ const TQColor& bgc1 = Tellico::blendColors(baseColor, highColor, 30);
+ const TQColor& bgc2 = Tellico::blendColors(baseColor, highColor, 50);
- const QString bgname = QString::fromLatin1("gradient_bg.png");
- QImage bgImage = KImageEffect::gradient(QSize(400, 1), bgc1, baseColor,
+ const TQString bgname = TQString::tqfromLatin1("gradient_bg.png");
+ TQImage bgImage = KImageEffect::gradient(TQSize(400, 1), bgc1, baseColor,
KImageEffect::PipeCrossGradient);
bgImage = KImageEffect::rotate(bgImage, KImageEffect::Rotate90);
- const QString hdrname = QString::fromLatin1("gradient_header.png");
- QImage hdrImage = KImageEffect::unbalancedGradient(QSize(1, 10), highColor, bgc2,
+ const TQString hdrname = TQString::tqfromLatin1("gradient_header.png");
+ TQImage hdrImage = KImageEffect::unbalancedGradient(TQSize(1, 10), highColor, bgc2,
KImageEffect::VerticalGradient, 100, -100);
if(opt_.imgDir.isEmpty()) {
// write the style images both to the tmp dir and the data dir
// doesn't really hurt and lets the user switch back and forth
ImageFactory::removeImage(bgname, true /*delete */);
- ImageFactory::addImageImpl(Data::Image::byteArray(bgImage, "PNG"), QString::fromLatin1("PNG"), bgname);
+ ImageFactory::addImageImpl(Data::Image::byteArray(bgImage, "PNG"), TQString::tqfromLatin1("PNG"), bgname);
ImageFactory::writeCachedImage(bgname, DataDir, true /*force*/);
ImageFactory::writeCachedImage(bgname, TempDir, true /*force*/);
ImageFactory::removeImage(hdrname, true /*delete */);
- ImageFactory::addImageImpl(Data::Image::byteArray(hdrImage, "PNG"), QString::fromLatin1("PNG"), hdrname);
+ ImageFactory::addImageImpl(Data::Image::byteArray(hdrImage, "PNG"), TQString::tqfromLatin1("PNG"), hdrname);
ImageFactory::writeCachedImage(hdrname, DataDir, true /*force*/);
ImageFactory::writeCachedImage(hdrname, TempDir, true /*force*/);
} else {
@@ -537,7 +537,7 @@ void ImageFactory::createStyleImages(const StyleOptions& opt_) {
}
}
-void ImageFactory::removeImage(const QString& id_, bool deleteImage_) {
+void ImageFactory::removeImage(const TQString& id_, bool deleteImage_) {
//be careful using this
s_imageDict.remove(id_);
s_imageCache.remove(id_);
@@ -545,23 +545,23 @@ void ImageFactory::removeImage(const QString& id_, bool deleteImage_) {
if(deleteImage_) {
// remove from both data dir and temp dir
- QFile::remove(dataDir() + id_);
- QFile::remove(tempDir() + id_);
+ TQFile::remove(dataDir() + id_);
+ TQFile::remove(tempDir() + id_);
}
}
Tellico::StringSet ImageFactory::imagesNotInCache() {
StringSet set;
- for(QDictIterator<Tellico::Data::Image> it(s_imageDict); it.current(); ++it) {
- if(s_imageCache.find(it.currentKey()) == 0) {
+ for(TQDictIterator<Tellico::Data::Image> it(s_imageDict); it.current(); ++it) {
+ if(s_imageCache.tqfind(it.currentKey()) == 0) {
set.add(it.currentKey());
}
}
return set;
}
-bool ImageFactory::hasImage(const QString& id_) {
- return s_imageCache.find(id_, false) || s_imageDict.find(id_);
+bool ImageFactory::hasImage(const TQString& id_) {
+ return s_imageCache.tqfind(id_, false) || s_imageDict.tqfind(id_);
}
// the purpose here is to remove images from the dict if they're is on the disk somewhere,
@@ -573,17 +573,17 @@ void ImageFactory::releaseImages() {
return;
}
- const QStringList images = s_imagesToRelease.toList();
- for(QStringList::ConstIterator it = images.begin(); it != images.end(); ++it) {
+ const TQStringList images = s_imagesToRelease.toList();
+ for(TQStringList::ConstIterator it = images.begin(); it != images.end(); ++it) {
s_imagesToRelease.remove(*it);
- if(!s_imageDict.find(*it)) {
+ if(!s_imageDict.tqfind(*it)) {
continue;
}
// myLog() << "ImageFactory::releaseImage() - id = " << *it << endl;
- if(QFile::exists(dataDir() + *it)) {
+ if(TQFile::exists(dataDir() + *it)) {
// myDebug() << "...exists in dataDir() - removing from dict" << endl;
s_imageDict.remove(*it);
- } else if(QFile::exists(tempDir() + *it)) {
+ } else if(TQFile::exists(tempDir() + *it)) {
// myDebug() << "...exists in tempDir() - removing from dict" << endl;
s_imageDict.remove(*it);
}
@@ -601,8 +601,8 @@ void ImageFactory::setLocalDirectory(const KURL& url_) {
} else {
s_localDir = url_.directory(false);
// could have already been set once
- if(!url_.fileName().contains(QString::fromLatin1("_files"))) {
- s_localDir += url_.fileName().section('.', 0, 0) + QString::fromLatin1("_files/");
+ if(!url_.fileName().tqcontains(TQString::tqfromLatin1("_files"))) {
+ s_localDir += url_.fileName().section('.', 0, 0) + TQString::tqfromLatin1("_files/");
}
myLog() << "ImageFactory::setLocalDirectory() - local dir = " << s_localDir << endl;
}
diff --git a/src/imagefactory.h b/src/imagefactory.h
index efb3009..f653d83 100644
--- a/src/imagefactory.h
+++ b/src/imagefactory.h
@@ -18,8 +18,8 @@
#include <kurl.h>
-#include <qcolor.h>
-#include <qcache.h>
+#include <tqcolor.h>
+#include <tqcache.h>
class KTempDir;
@@ -31,13 +31,13 @@ namespace Tellico {
class StyleOptions {
public:
- QString fontFamily;
+ TQString fontFamily;
int fontSize;
- QColor baseColor;
- QColor textColor;
- QColor highlightedBaseColor;
- QColor highlightedTextColor;
- QString imgDir;
+ TQColor baseColor;
+ TQColor textColor;
+ TQColor highlightedBaseColor;
+ TQColor highlightedTextColor;
+ TQString imgDir;
};
/**
@@ -61,8 +61,8 @@ public:
*
* @return The full path
*/
- static QString tempDir();
- static QString dataDir();
+ static TQString tempDir();
+ static TQString dataDir();
/**
* Add an image, reading it from a URL, which is the case when adding a new image from the
@@ -72,30 +72,30 @@ public:
* @param quiet If any error should not be reported.
* @return The image id, empty if null
*/
- static QString addImage(const KURL& url, bool quiet=false,
+ static TQString addImage(const KURL& url, bool quiet=false,
const KURL& referrer = KURL(), bool linkOnly=false);
/**
- * Add an image, reading it from a regular QImage, which is the case when dragging and dropping
- * an image in the @ref ImageWidget. The format has to be included, since the QImage doesn't
+ * Add an image, reading it from a regular TQImage, which is the case when dragging and dropping
+ * an image in the @ref ImageWidget. The format has to be included, since the TQImage doesn't
* 'know' what format it came from.
*
* @param image The qimage
* @param format The image format, probably "PNG"
* @return The image id, empty if null
*/
- static QString addImage(const QImage& image, const QString& format);
- static QString addImage(const QPixmap& image, const QString& format);
+ static TQString addImage(const TQImage& image, const TQString& format);
+ static TQString addImage(const TQPixmap& image, const TQString& format);
/**
* Add an image, reading it from data, which is the case when reading from the data file. The
* @p id isn't strictly needed, since it can be reconstructed from the image data and format, but
* since it's already known, go ahead and use it.
*
* @param data The image data
- * @param format The image format, from Qt's output format list
+ * @param format The image format, from TQt's output format list
* @param id The internal id of the image
* @return The image id, empty if null
*/
- static QString addImage(const QByteArray& data, const QString& format, const QString& id);
+ static TQString addImage(const TQByteArray& data, const TQString& format, const TQString& id);
/**
* Writes an image to a file. ImageFactory keeps track of which images were already written
@@ -106,8 +106,8 @@ public:
* @param force Force the image to be written, even if it already has been
* @return Whether the save was successful
*/
- static bool writeImage(const QString& id, const KURL& targetDir, bool force=false);
- static bool writeCachedImage(const QString& id, CacheDir dir, bool force = false);
+ static bool writeImage(const TQString& id, const KURL& targetDir, bool force=false);
+ static bool writeCachedImage(const TQString& id, CacheDir dir, bool force = false);
/**
* Returns an image reference given its id. If none is found, a null image
@@ -116,13 +116,13 @@ public:
* @param id The image id
* @return The image referencenter
*/
- static const Data::Image& imageById(const QString& id);
- static Data::ImageInfo imageInfo(const QString& id);
+ static const Data::Image& imageById(const TQString& id);
+ static Data::ImageInfo imageInfo(const TQString& id);
static void cacheImageInfo(const Data::ImageInfo& info);
// basically returns !imageById().isNull()
- static bool validImage(const QString& id);
+ static bool validImage(const TQString& id);
- static QPixmap pixmap(const QString& id, int w, int h);
+ static TQPixmap pixmap(const TQString& id, int w, int h);
/**
* Clear the image cache and dict
@@ -134,12 +134,12 @@ public:
*/
static void createStyleImages(const StyleOptions& options = StyleOptions());
- static void removeImage(const QString& id_, bool deleteImage);
+ static void removeImage(const TQString& id_, bool deleteImage);
static StringSet imagesNotInCache();
static void setLocalDirectory(const KURL& url);
// local save directory
- static QString localDir();
+ static TQString localDir();
private:
/**
@@ -153,40 +153,40 @@ private:
static const Data::Image& addImageImpl(const KURL& url, bool quiet=false,
const KURL& referrer = KURL(), bool linkOnly = false);
/**
- * Add an image, reading it from a regular QImage, which is the case when dragging and dropping
- * an image in the @ref ImageWidget. The format has to be included, since the QImage doesn't
+ * Add an image, reading it from a regular TQImage, which is the case when dragging and dropping
+ * an image in the @ref ImageWidget. The format has to be included, since the TQImage doesn't
* 'know' what format it came from.
*
* @param image The qimage
* @param format The image format, probably "PNG"
* @return The image
*/
- static const Data::Image& addImageImpl(const QImage& image, const QString& format);
+ static const Data::Image& addImageImpl(const TQImage& image, const TQString& format);
/**
* Add an image, reading it from data, which is the case when reading from the data file. The
* @p id isn't strictly needed, since it can be reconstructed from the image data and format, but
* since it's already known, go ahead and use it.
*
* @param data The image data
- * @param format The image format, from Qt's output format list
+ * @param format The image format, from TQt's output format list
* @param id The internal id of the image
* @return The image
*/
- static const Data::Image& addImageImpl(const QByteArray& data, const QString& format, const QString& id);
+ static const Data::Image& addImageImpl(const TQByteArray& data, const TQString& format, const TQString& id);
- static const Data::Image& addCachedImageImpl(const QString& id, CacheDir dir);
- static bool hasImage(const QString& id);
+ static const Data::Image& addCachedImageImpl(const TQString& id, CacheDir dir);
+ static bool hasImage(const TQString& id);
static void releaseImages();
static bool s_needInit;
- static QDict<Data::Image> s_imageDict;
- static QCache<Data::Image> s_imageCache;
- static QCache<QPixmap> s_pixmapCache;
- static QMap<QString, Data::ImageInfo> s_imageInfoMap;
+ static TQDict<Data::Image> s_imageDict;
+ static TQCache<Data::Image> s_imageCache;
+ static TQCache<TQPixmap> s_pixmapCache;
+ static TQMap<TQString, Data::ImageInfo> s_imageInfoMap;
static StringSet s_imagesInTmpDir; // the id's of the images written to tmp directory
static StringSet s_imagesToRelease;
static KTempDir* s_tmpDir;
- static QString s_localDir;
+ static TQString s_localDir;
static const Data::Image s_null;
};
diff --git a/src/importdialog.cpp b/src/importdialog.cpp
index 07e0ec1..9985902 100644
--- a/src/importdialog.cpp
+++ b/src/importdialog.cpp
@@ -38,36 +38,36 @@
#include <klocale.h>
#include <kstandarddirs.h>
-#include <qlayout.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qwhatsthis.h>
-#include <qtimer.h>
+#include <tqlayout.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqcheckbox.h>
+#include <tqwhatsthis.h>
+#include <tqtimer.h>
// really according to taste or computer speed
const unsigned Tellico::Import::Importer::s_stepSize = 20;
using Tellico::ImportDialog;
-ImportDialog::ImportDialog(Import::Format format_, const KURL::List& urls_, QWidget* parent_, const char* name_)
- : KDialogBase(parent_, name_, true /*modal*/, i18n("Import Options"), Ok|Cancel),
+ImportDialog::ImportDialog(Import::Format format_, const KURL::List& urls_, TQWidget* tqparent_, const char* name_)
+ : KDialogBase(tqparent_, name_, true /*modal*/, i18n("Import Options"), Ok|Cancel),
m_coll(0),
m_importer(importer(format_, urls_)) {
- QWidget* widget = new QWidget(this);
- QVBoxLayout* topLayout = new QVBoxLayout(widget, 0, spacingHint());
+ TQWidget* widget = new TQWidget(this);
+ TQVBoxLayout* topLayout = new TQVBoxLayout(widget, 0, spacingHint());
- QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, i18n("Import Options"), widget);
+ TQButtonGroup* bg = new TQButtonGroup(1, Qt::Horizontal, i18n("Import Options"), widget);
topLayout->addWidget(bg, 0);
- m_radioReplace = new QRadioButton(i18n("&Replace current collection"), bg);
- QWhatsThis::add(m_radioReplace, i18n("Replace the current collection with the contents "
+ m_radioReplace = new TQRadioButton(i18n("&Replace current collection"), bg);
+ TQWhatsThis::add(m_radioReplace, i18n("Replace the current collection with the contents "
"of the imported file."));
- m_radioAppend = new QRadioButton(i18n("A&ppend to current collection"), bg);
- QWhatsThis::add(m_radioAppend, i18n("Append the contents of the imported file to the "
+ m_radioAppend = new TQRadioButton(i18n("A&ppend to current collection"), bg);
+ TQWhatsThis::add(m_radioAppend, i18n("Append the contents of the imported file to the "
"current collection. This is only possible when the "
"collection types match."));
- m_radioMerge = new QRadioButton(i18n("&Merge with current collection"), bg);
- QWhatsThis::add(m_radioMerge, i18n("Merge the contents of the imported file to the "
+ m_radioMerge = new TQRadioButton(i18n("&Merge with current collection"), bg);
+ TQWhatsThis::add(m_radioMerge, i18n("Merge the contents of the imported file to the "
"current collection. This is only possible when the "
"collection types match. Entries must match exactly "
"in order to be merged."));
@@ -80,13 +80,13 @@ ImportDialog::ImportDialog(Import::Format format_, const KURL::List& urls_, QWid
m_radioMerge->setEnabled(false);
}
- QWidget* w = m_importer->widget(widget, "importer_widget");
+ TQWidget* w = m_importer->widget(widget, "importer_widget");
// m_importer->readOptions(KGlobal::config());
if(w) {
topLayout->addWidget(w, 0);
}
- connect(bg, SIGNAL(clicked(int)), m_importer, SLOT(slotActionChanged(int)));
+ connect(bg, TQT_SIGNAL(clicked(int)), m_importer, TQT_SLOT(slotActionChanged(int)));
topLayout->addStretch();
setMainWidget(widget);
@@ -96,8 +96,8 @@ ImportDialog::ImportDialog(Import::Format format_, const KURL::List& urls_, QWid
setButtonOK(ok);
// want to grab default button action, too
- // since the importer might do something with widgets, don't just call it, do it after layout is done
- QTimer::singleShot(0, this, SLOT(slotUpdateAction()));
+ // since the importer might do something with widgets, don't just call it, do it after tqlayout is done
+ TQTimer::singleShot(0, this, TQT_SLOT(slotUpdateAction()));
}
ImportDialog::~ImportDialog() {
@@ -112,8 +112,8 @@ Tellico::Data::CollPtr ImportDialog::collection() {
return m_coll;
}
-QString ImportDialog::statusMessage() const {
- return m_importer ? m_importer->statusMessage() : QString::null;
+TQString ImportDialog::statusMessage() const {
+ return m_importer ? m_importer->statusMessage() : TQString();
}
Tellico::Import::Action ImportDialog::action() const {
@@ -160,7 +160,7 @@ Tellico::Import::Importer* ImportDialog::importer(Import::Format format_, const
CHECK_SIZE;
importer = new Import::XSLTImporter(firstURL);
{
- QString xsltFile = locate("appdata", QString::fromLatin1("mods2tellico.xsl"));
+ TQString xsltFile = locate("appdata", TQString::tqfromLatin1("mods2tellico.xsl"));
if(!xsltFile.isEmpty()) {
KURL u;
u.setPath(xsltFile);
@@ -237,51 +237,51 @@ Tellico::Import::Importer* ImportDialog::importer(Import::Format format_, const
}
// static
-QString ImportDialog::fileFilter(Import::Format format_) {
- QString text;
+TQString ImportDialog::fileFilter(Import::Format format_) {
+ TQString text;
switch(format_) {
case Import::TellicoXML:
- text = i18n("*.tc *.bc|Tellico Files (*.tc)") + QChar('\n');
- text += i18n("*.xml|XML Files (*.xml)") + QChar('\n');
+ text = i18n("*.tc *.bc|Tellico Files (*.tc)") + TQChar('\n');
+ text += i18n("*.xml|XML Files (*.xml)") + TQChar('\n');
break;
case Import::Bibtex:
- text = i18n("*.bib|Bibtex Files (*.bib)") + QChar('\n');
+ text = i18n("*.bib|Bibtex Files (*.bib)") + TQChar('\n');
break;
case Import::CSV:
- text = i18n("*.csv|CSV Files (*.csv)") + QChar('\n');
+ text = i18n("*.csv|CSV Files (*.csv)") + TQChar('\n');
break;
case Import::Bibtexml:
case Import::XSLT:
- text = i18n("*.xml|XML Files (*.xml)") + QChar('\n');
+ text = i18n("*.xml|XML Files (*.xml)") + TQChar('\n');
break;
case Import::MODS:
case Import::Delicious:
- text = i18n("*.xml|XML Files (*.xml)") + QChar('\n');
+ text = i18n("*.xml|XML Files (*.xml)") + TQChar('\n');
break;
case Import::RIS:
- text = i18n("*.ris|RIS Files (*.ris)") + QChar('\n');
+ text = i18n("*.ris|RIS Files (*.ris)") + TQChar('\n');
break;
case Import::GCfilms:
- text = i18n("*.gcs|GCstar Data Files (*.gcs)") + QChar('\n');
- text += i18n("*.gcf|GCfilms Data Files (*.gcf)") + QChar('\n');
+ text = i18n("*.gcs|GCstar Data Files (*.gcs)") + TQChar('\n');
+ text += i18n("*.gcf|GCfilms Data Files (*.gcf)") + TQChar('\n');
break;
case Import::AMC:
- text = i18n("*.amc|AMC Data Files (*.amc)") + QChar('\n');
+ text = i18n("*.amc|AMC Data Files (*.amc)") + TQChar('\n');
break;
case Import::PDF:
- text = i18n("*.pdf|PDF Files (*.pdf)") + QChar('\n');
+ text = i18n("*.pdf|PDF Files (*.pdf)") + TQChar('\n');
break;
case Import::Referencer:
- text = i18n("*.reflib|Referencer Files (*.reflib)") + QChar('\n');
+ text = i18n("*.reflib|Referencer Files (*.reflib)") + TQChar('\n');
break;
case Import::AudioFile:
@@ -318,18 +318,18 @@ Tellico::Import::FormatMap ImportDialog::formatMap() {
// I decided they were likely to be the same in any language
// transliteration is unlikely
Import::FormatMap map;
- map[Import::TellicoXML] = QString::fromLatin1("Tellico");
- map[Import::Bibtex] = QString::fromLatin1("Bibtex");
- map[Import::Bibtexml] = QString::fromLatin1("Bibtexml");
-// map[Import::CSV] = QString::fromLatin1("CSV");
- map[Import::MODS] = QString::fromLatin1("MODS");
- map[Import::RIS] = QString::fromLatin1("RIS");
- map[Import::GCfilms] = QString::fromLatin1("GCstar");
- map[Import::AMC] = QString::fromLatin1("AMC");
- map[Import::Griffith] = QString::fromLatin1("Griffith");
- map[Import::PDF] = QString::fromLatin1("PDF");
- map[Import::Referencer] = QString::fromLatin1("Referencer");
- map[Import::Delicious ] = QString::fromLatin1("Delicious Library");
+ map[Import::TellicoXML] = TQString::tqfromLatin1("Tellico");
+ map[Import::Bibtex] = TQString::tqfromLatin1("Bibtex");
+ map[Import::Bibtexml] = TQString::tqfromLatin1("Bibtexml");
+// map[Import::CSV] = TQString::tqfromLatin1("CSV");
+ map[Import::MODS] = TQString::tqfromLatin1("MODS");
+ map[Import::RIS] = TQString::tqfromLatin1("RIS");
+ map[Import::GCfilms] = TQString::tqfromLatin1("GCstar");
+ map[Import::AMC] = TQString::tqfromLatin1("AMC");
+ map[Import::Griffith] = TQString::tqfromLatin1("Griffith");
+ map[Import::PDF] = TQString::tqfromLatin1("PDF");
+ map[Import::Referencer] = TQString::tqfromLatin1("Referencer");
+ map[Import::Delicious ] = TQString::tqfromLatin1("Delicious Library");
return map;
}
@@ -339,15 +339,15 @@ bool ImportDialog::formatImportsText(Import::Format format_) {
format_ != Import::PDF;
}
-QString ImportDialog::startDir(Import::Format format_) {
+TQString ImportDialog::startDir(Import::Format format_) {
if(format_ == Import::GCfilms) {
- QDir dir = QDir::home();
+ TQDir dir = TQDir::home();
// able to cd if exists and readable
- if(dir.cd(QString::fromLatin1(".local/share/gcfilms/"))) {
+ if(dir.cd(TQString::tqfromLatin1(".local/share/gcfilms/"))) {
return dir.absPath();
}
}
- return QString::fromLatin1(":import");
+ return TQString::tqfromLatin1(":import");
}
void ImportDialog::slotOk() {
@@ -362,8 +362,8 @@ void ImportDialog::slotOk() {
void ImportDialog::slotUpdateAction() {
// distasteful hack
// selectedId() is new in QT 3.2
-// m_importer->slotActionChanged(dynamic_cast<QButtonGroup*>(m_radioAppend->parentWidget())->selectedId());
- QButtonGroup* bg = static_cast<QButtonGroup*>(m_radioAppend->parentWidget());
+// m_importer->slotActionChanged(dynamic_cast<TQButtonGroup*>(m_radioAppend->tqparentWidget())->selectedId());
+ TQButtonGroup* bg = static_cast<TQButtonGroup*>(m_radioAppend->tqparentWidget());
m_importer->slotActionChanged(bg->id(bg->selected()));
}
diff --git a/src/importdialog.h b/src/importdialog.h
index 3802436..70d187e 100644
--- a/src/importdialog.h
+++ b/src/importdialog.h
@@ -20,14 +20,14 @@
#include <kdialogbase.h>
#include <kurl.h>
-class QRadioButton;
-class QCheckBox;
-class QShowEvent;
+class TQRadioButton;
+class TQCheckBox;
+class TQShowEvent;
namespace Tellico {
namespace Import {
class Importer;
- typedef QMap<Import::Format, QString> FormatMap;
+ typedef TQMap<Import::Format, TQString> FormatMap;
}
/**
@@ -35,18 +35,19 @@ namespace Tellico {
*/
class ImportDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- ImportDialog(Import::Format format, const KURL::List& urls, QWidget* parent, const char* name);
+ ImportDialog(Import::Format format, const KURL::List& urls, TQWidget* tqparent, const char* name);
~ImportDialog();
Data::CollPtr collection();
- QString statusMessage() const;
+ TQString statusMessage() const;
Import::Action action() const;
- static QString fileFilter(Import::Format format);
+ static TQString fileFilter(Import::Format format);
static Import::Target importTarget(Import::Format format);
- static QString startDir(Import::Format format);
+ static TQString startDir(Import::Format format);
static Import::FormatMap formatMap();
static bool formatImportsText(Import::Format format);
@@ -62,9 +63,9 @@ private slots:
private:
Data::CollPtr m_coll;
Import::Importer* m_importer;
- QRadioButton* m_radioAppend;
- QRadioButton* m_radioReplace;
- QRadioButton* m_radioMerge;
+ TQRadioButton* m_radioAppend;
+ TQRadioButton* m_radioReplace;
+ TQRadioButton* m_radioMerge;
};
} // end namespace
diff --git a/src/isbnvalidator.cpp b/src/isbnvalidator.cpp
index 91ed099..6eb2636 100644
--- a/src/isbnvalidator.cpp
+++ b/src/isbnvalidator.cpp
@@ -17,8 +17,8 @@
using Tellico::ISBNValidator;
//static
-QString ISBNValidator::isbn10(QString isbn13) {
- if(!isbn13.startsWith(QString::fromLatin1("978"))) {
+TQString ISBNValidator::isbn10(TQString isbn13) {
+ if(!isbn13.startsWith(TQString::tqfromLatin1("978"))) {
myDebug() << "ISBNValidator::isbn10() - can't convert, must start with 978: " << isbn13 << endl;
return isbn13;
}
@@ -32,73 +32,73 @@ QString ISBNValidator::isbn10(QString isbn13) {
return isbn13;
}
-QString ISBNValidator::isbn13(QString isbn10) {
+TQString ISBNValidator::isbn13(TQString isbn10) {
isbn10.remove('-');
- if(isbn10.startsWith(QString::fromLatin1("978")) ||
- isbn10.startsWith(QString::fromLatin1("979"))) {
+ if(isbn10.startsWith(TQString::tqfromLatin1("978")) ||
+ isbn10.startsWith(TQString::tqfromLatin1("979"))) {
return isbn10;
}
// remove checksum
isbn10.truncate(isbn10.length()-1);
// begins with 978
- isbn10.prepend(QString::fromLatin1("978"));
+ isbn10.prepend(TQString::tqfromLatin1("978"));
// add new checksum
isbn10 += checkSum13(isbn10);
staticFixup(isbn10);
return isbn10;
}
-QString ISBNValidator::cleanValue(QString isbn) {
- isbn.remove(QRegExp(QString::fromLatin1("[^xX0123456789]")));
+TQString ISBNValidator::cleanValue(TQString isbn) {
+ isbn.remove(TQRegExp(TQString::tqfromLatin1("[^xX0123456789]")));
return isbn;
}
-ISBNValidator::ISBNValidator(QObject* parent_, const char* name_/*=0*/)
- : QValidator(parent_, name_) {
+ISBNValidator::ISBNValidator(TQObject* tqparent_, const char* name_/*=0*/)
+ : TQValidator(tqparent_, name_) {
}
-QValidator::State ISBNValidator::validate(QString& input_, int& pos_) const {
- if(input_.startsWith(QString::fromLatin1("978")) ||
- input_.startsWith(QString::fromLatin1("979"))) {
+TQValidator::State ISBNValidator::validate(TQString& input_, int& pos_) const {
+ if(input_.startsWith(TQString::tqfromLatin1("978")) ||
+ input_.startsWith(TQString::tqfromLatin1("979"))) {
return validate13(input_, pos_);
} else {
return validate10(input_, pos_);
}
}
-void ISBNValidator::fixup(QString& input_) const {
+void ISBNValidator::fixup(TQString& input_) const {
return staticFixup(input_);
}
-void ISBNValidator::staticFixup(QString& input_) {
- if((input_.startsWith(QString::fromLatin1("978"))
- || input_.startsWith(QString::fromLatin1("979")))
- && input_.contains(QRegExp(QString::fromLatin1("\\d"))) > 10) {
+void ISBNValidator::staticFixup(TQString& input_) {
+ if((input_.startsWith(TQString::tqfromLatin1("978"))
+ || input_.startsWith(TQString::tqfromLatin1("979")))
+ && input_.tqcontains(TQRegExp(TQString::tqfromLatin1("\\d"))) > 10) {
return fixup13(input_);
}
return fixup10(input_);
}
-QValidator::State ISBNValidator::validate10(QString& input_, int& pos_) const {
+TQValidator::State ISBNValidator::validate10(TQString& input_, int& pos_) const {
// first check to see if it's a "perfect" ISBN
// A perfect ISBN has 9 digits plus either an 'X' or another digit
// A perfect ISBN may have 2 or 3 hyphens
// The final digit or 'X' is the correct check sum
- static const QRegExp isbn(QString::fromLatin1("(\\d-?){9,11}-[\\dX]"));
+ static const TQRegExp isbn(TQString::tqfromLatin1("(\\d-?){9,11}-[\\dX]"));
uint len = input_.length();
/*
// Don't do this since the hyphens may be in the wrong place, can't put that in a regexp
if(isbn.exactMatch(input_) // put the exactMatch() first since I use matchedLength() later
&& (len == 12 || len == 13)
&& input_[len-1] == checkSum(input_)) {
- return QValidator::Acceptable;
+ return TQValidator::Acceptable;
}
*/
// two easy invalid cases are too many hyphens and the 'X' not in the last position
- if(input_.contains('-') > 3
- || input_.contains('X', false) > 1
- || (input_.find('X', 0, false) != -1 && input_[len-1].upper() != 'X')) {
- return QValidator::Invalid;
+ if(input_.tqcontains('-') > 3
+ || input_.tqcontains('X', false) > 1
+ || (input_.tqfind('X', 0, false) != -1 && input_[len-1].upper() != 'X')) {
+ return TQValidator::Invalid;
}
// remember if the cursor is at the end
@@ -113,8 +113,8 @@ QValidator::State ISBNValidator::validate10(QString& input_, int& pos_) const {
// fix the case where the user attempts to delete the checksum; the
// solution is to delete the last digit as well
- static const QRegExp digit(QString::fromLatin1("\\d"));
- if(atEnd && input_.contains(digit) == 9 && input_[len-1] == '-') {
+ static const TQRegExp digit(TQString::tqfromLatin1("\\d"));
+ if(atEnd && input_.tqcontains(digit) == 9 && input_[len-1] == '-') {
input_.truncate(len-2);
pos_ -= 2;
len -= 2;
@@ -128,30 +128,30 @@ QValidator::State ISBNValidator::validate10(QString& input_, int& pos_) const {
}
if(isbn.exactMatch(input_) && (len == 12 || len == 13)) {
- return QValidator::Acceptable;
+ return TQValidator::Acceptable;
} else {
- return QValidator::Intermediate;
+ return TQValidator::Intermediate;
}
}
-QValidator::State ISBNValidator::validate13(QString& input_, int& pos_) const {
+TQValidator::State ISBNValidator::validate13(TQString& input_, int& pos_) const {
// first check to see if it's a "perfect" ISBN13
// A perfect ISBN13 has 13 digits
// A perfect ISBN13 may have 3 or 4 hyphens
// The final digit is the correct check sum
- static const QRegExp isbn(QString::fromLatin1("(\\d-?){13,17}"));
+ static const TQRegExp isbn(TQString::tqfromLatin1("(\\d-?){13,17}"));
uint len = input_.length();
- const uint countX = input_.contains('X', false);
+ const uint countX = input_.tqcontains('X', false);
// two easy invalid cases are too many hyphens or 'X'
- if(input_.contains('-') > 4 || countX > 1) {
- return QValidator::Invalid;
+ if(input_.tqcontains('-') > 4 || countX > 1) {
+ return TQValidator::Invalid;
}
// now, it's not certain that we're getting a EAN-13,
// it could be a ISBN-10 from Nigeria or Indonesia
if(countX > 0 && (input_[len-1].upper() != 'X' || len > 13)) {
- return QValidator::Invalid;
+ return TQValidator::Invalid;
}
// remember if the cursor is at the end
@@ -166,8 +166,8 @@ QValidator::State ISBNValidator::validate13(QString& input_, int& pos_) const {
// fix the case where the user attempts to delete the checksum; the
// solution is to delete the last digit as well
- static const QRegExp digit(QString::fromLatin1("\\d"));
- const uint countN = input_.contains(digit);
+ static const TQRegExp digit(TQString::tqfromLatin1("\\d"));
+ const uint countN = input_.tqcontains(digit);
if(atEnd && (countN == 12 || countN == 9) && input_[len-1] == '-') {
input_.truncate(len-2);
pos_ -= 2;
@@ -187,22 +187,22 @@ QValidator::State ISBNValidator::validate13(QString& input_, int& pos_) const {
}
if(isbn.exactMatch(input_)) {
- return QValidator::Acceptable;
+ return TQValidator::Acceptable;
} else {
- return QValidator::Intermediate;
+ return TQValidator::Intermediate;
}
}
-void ISBNValidator::fixup10(QString& input_) {
+void ISBNValidator::fixup10(TQString& input_) {
if(input_.isEmpty()) {
return;
}
- //replace "x" with "X"
- input_.replace('x', QString::fromLatin1("X"));
+ //tqreplace "x" with "X"
+ input_.tqreplace('x', TQString::tqfromLatin1("X"));
// remove invalid chars
- static const QRegExp badChars(QString::fromLatin1("[^\\d-X]"));
+ static const TQRegExp badChars(TQString::tqfromLatin1("[^\\d-X]"));
input_.remove(badChars);
// special case for EAN values that start with 978 or 979. That's the case
@@ -214,8 +214,8 @@ void ISBNValidator::fixup10(QString& input_) {
// I consider the likelihood that someone wants to input an EAN to be higher than someone
// using a Nigerian ISBN and not noticing that the checksum gets added automatically.
if(input_.length() > 12
- && (input_.startsWith(QString::fromLatin1("978"))
- || input_.startsWith(QString::fromLatin1("979")))) {
+ && (input_.startsWith(TQString::tqfromLatin1("978"))
+ || input_.startsWith(TQString::tqfromLatin1("979")))) {
// Strip the first 4 characters (the invalid publisher)
input_ = input_.right(input_.length() - 3);
}
@@ -226,11 +226,11 @@ void ISBNValidator::fixup10(QString& input_) {
// the user inserts one, then be sure to put it back
// Find the first hyphen. If there is none,
- // input_.find('-') returns -1 and hyphen2_position = 0
- int hyphen2_position = input_.find('-') + 1;
+ // input_.tqfind('-') returns -1 and hyphen2_position = 0
+ int hyphen2_position = input_.tqfind('-') + 1;
// Find the second one. If none, hyphen2_position = -2
- hyphen2_position = input_.find('-', hyphen2_position) - 1;
+ hyphen2_position = input_.tqfind('-', hyphen2_position) - 1;
// The second hyphen can not be in the last characters
if(hyphen2_position >= 9) {
@@ -240,7 +240,7 @@ void ISBNValidator::fixup10(QString& input_) {
// Remove all existing hyphens. We will insert ours.
input_.remove('-');
// the only place that 'X' can be is last spot
- for(int xpos = input_.find('X'); xpos > -1; xpos = input_.find('X', xpos+1)) {
+ for(int xpos = input_.tqfind('X'); xpos > -1; xpos = input_.tqfind('X', xpos+1)) {
if(xpos < 9) { // remove if not 10th char
input_.remove(xpos, 1);
--xpos;
@@ -251,8 +251,8 @@ void ISBNValidator::fixup10(QString& input_) {
// If we can find it, add the checksum
// but only if not started with 978 or 979
if(input_.length() > 8
- && !input_.startsWith(QString::fromLatin1("978"))
- && !input_.startsWith(QString::fromLatin1("979"))) {
+ && !input_.startsWith(TQString::tqfromLatin1("978"))
+ && !input_.startsWith(TQString::tqfromLatin1("979"))) {
input_[9] = checkSum10(input_);
}
@@ -287,13 +287,13 @@ void ISBNValidator::fixup10(QString& input_) {
}
}
-void ISBNValidator::fixup13(QString& input_) {
+void ISBNValidator::fixup13(TQString& input_) {
if(input_.isEmpty()) {
return;
}
// remove invalid chars
- static const QRegExp badChars(QString::fromLatin1("[^\\d-]"));
+ static const TQRegExp badChars(TQString::tqfromLatin1("[^\\d-]"));
input_.remove(badChars);
// hyphen placement for some languages publishers is well-defined
@@ -301,17 +301,17 @@ void ISBNValidator::fixup13(QString& input_) {
// some countries have ill-defined second hyphen positions, and if
// the user inserts one, then be sure to put it back
- QString after = input_.mid(3);
+ TQString after = input_.mid(3);
if(after[0] == '-') {
after = after.mid(1);
}
// Find the first hyphen. If there is none,
- // input_.find('-') returns -1 and hyphen2_position = 0
- int hyphen2_position = after.find('-') + 1;
+ // input_.tqfind('-') returns -1 and hyphen2_position = 0
+ int hyphen2_position = after.tqfind('-') + 1;
// Find the second one. If none, hyphen2_position = -2
- hyphen2_position = after.find('-', hyphen2_position) - 1;
+ hyphen2_position = after.tqfind('-', hyphen2_position) - 1;
// The second hyphen can not be in the last characters
if(hyphen2_position >= 9) {
@@ -359,7 +359,7 @@ void ISBNValidator::fixup13(QString& input_) {
input_ = input_.left(3) + '-' + after;
}
-QChar ISBNValidator::checkSum10(const QString& input_) {
+TQChar ISBNValidator::checkSum10(const TQString& input_) {
uint sum = 0;
uint multiplier = 10;
@@ -370,21 +370,21 @@ QChar ISBNValidator::checkSum10(const QString& input_) {
sum %= 11;
sum = 11-sum;
- QChar c;
+ TQChar c;
if(sum == 10) {
c = 'X';
} else if(sum == 11) {
c = '0';
} else {
- c = QString::number(sum)[0];
+ c = TQString::number(sum)[0];
}
return c;
}
-QChar ISBNValidator::checkSum13(const QString& input_) {
+TQChar ISBNValidator::checkSum13(const TQString& input_) {
uint sum = 0;
- const uint len = QMIN(12, input_.length());
+ const uint len = TQMIN(12, input_.length());
// hyphens are already gone, only use first twelve digits
for(uint i = 0; i < len; ++i) {
sum += input_[i].digitValue() * (1 + 2*(i%2));
@@ -393,11 +393,11 @@ QChar ISBNValidator::checkSum13(const QString& input_) {
sum %= 10;
sum = 10-sum;
- QChar c;
+ TQChar c;
if(sum == 10) {
c = '0';
} else {
- c = QString::number(sum)[0];
+ c = TQString::number(sum)[0];
}
return c;
}
diff --git a/src/isbnvalidator.h b/src/isbnvalidator.h
index 763f7ff..0747823 100644
--- a/src/isbnvalidator.h
+++ b/src/isbnvalidator.h
@@ -14,7 +14,7 @@
#ifndef ISBNVALIDATOR_H
#define ISBNVALIDATOR_H
-#include <qvalidator.h>
+#include <tqvalidator.h>
namespace Tellico {
@@ -25,9 +25,9 @@ namespace Tellico {
* @see http://www.eblong.com/zarf/bookscan/
* @see http://doc.trolltech.com/qq/qq01-seriously-weird-qregexp.html
*/
-class ISBNValidator : public QValidator {
+class ISBNValidator : public TQValidator {
public:
- ISBNValidator(QObject* parent, const char* name=0);
+ ISBNValidator(TQObject* tqparent, const char* name=0);
/**
* Certain conditions are checked. Character, length and position
@@ -40,7 +40,7 @@ public:
* @param pos The position of the cursor
* @return The condition of the text
*/
- virtual QValidator::State validate(QString& input, int& pos) const;
+ virtual TQValidator::State validate(TQString& input, int& pos) const;
/**
* The input string is examined. Hyphens are inserted appropriately,
@@ -110,12 +110,12 @@ public:
*
* @param input The raw string, hyphens included
*/
- virtual void fixup(QString& input) const;
- static void staticFixup(QString& input);
+ virtual void fixup(TQString& input) const;
+ static void staticFixup(TQString& input);
- static QString isbn10(QString isbn13);
- static QString isbn13(QString isbn10);
- static QString cleanValue(QString isbn);
+ static TQString isbn10(TQString isbn13);
+ static TQString isbn13(TQString isbn10);
+ static TQString cleanValue(TQString isbn);
private:
static struct isbn_band {
@@ -125,11 +125,11 @@ private:
unsigned int Last;
} bands[];
- QValidator::State validate10(QString& input, int& pos) const;
- QValidator::State validate13(QString& input, int& pos) const;
+ TQValidator::State validate10(TQString& input, int& pos) const;
+ TQValidator::State validate13(TQString& input, int& pos) const;
- static void fixup10(QString& input);
- static void fixup13(QString& input);
+ static void fixup10(TQString& input);
+ static void fixup13(TQString& input);
/**
* This function calculates and returns the ISBN checksum. The
@@ -140,8 +140,8 @@ private:
*
* @param input The raw string, with no hyphens
*/
- static QChar checkSum10(const QString& input);
- static QChar checkSum13(const QString& input);
+ static TQChar checkSum10(const TQString& input);
+ static TQChar checkSum13(const TQString& input);
};
} // end namespace
diff --git a/src/iso5426converter.cpp b/src/iso5426converter.cpp
index bac132a..14324ab 100644
--- a/src/iso5426converter.cpp
+++ b/src/iso5426converter.cpp
@@ -24,13 +24,13 @@
#include "iso5426converter.h"
#include "tellico_debug.h"
-#include <qstring.h>
+#include <tqstring.h>
using Tellico::Iso5426Converter;
-QString Iso5426Converter::toUtf8(const QCString& text_) {
+TQString Iso5426Converter::toUtf8(const TQCString& text_) {
const uint len = text_.length();
- QString result;
+ TQString result;
result.reserve(len);
uint pos = 0;
for(uint i = 0; i < len; ++i) {
@@ -44,7 +44,7 @@ QString Iso5426Converter::toUtf8(const QCString& text_) {
if(c == 0xC9) {
c = 0xC8;
}
- QChar d = getCombiningChar(c * 256 + text_[i + 1]);
+ TQChar d = getCombiningChar(c * 256 + text_[i + 1]);
if(!d.isNull()) {
result[pos++] = d;
++i;
@@ -75,7 +75,7 @@ bool Iso5426Converter::isCombining(uchar c) {
}
// Source : http://www.itscj.ipsj.or.jp/ISO-IR/053.pdf
-QChar Iso5426Converter::getChar(uchar c) {
+TQChar Iso5426Converter::getChar(uchar c) {
switch(c) {
case 0xA1:
return 0x00A1; // 2/1 inverted exclamation mark
@@ -190,7 +190,7 @@ QChar Iso5426Converter::getChar(uchar c) {
}
}
-QChar Iso5426Converter::getCombiningChar(uint c) {
+TQChar Iso5426Converter::getCombiningChar(uint c) {
switch(c) {
// 4/0 low rising tone mark
case 0xC041:
@@ -878,6 +878,6 @@ QChar Iso5426Converter::getCombiningChar(uint c) {
default:
myDebug() << "Iso5426Converter::getCombiningChar() - no match for " << c << endl;
- return QChar();
+ return TQChar();
}
}
diff --git a/src/iso5426converter.h b/src/iso5426converter.h
index 6bd1fd3..efaaeaa 100644
--- a/src/iso5426converter.h
+++ b/src/iso5426converter.h
@@ -14,11 +14,11 @@
#ifndef TELLICO_ISO5426CONVERTER_H
#define TELLICO_ISO5426CONVERTER_H
-class QCString;
-class QString;
-class QChar;
+class TQCString;
+class TQString;
+class TQChar;
-#include <qglobal.h>
+#include <tqglobal.h>
namespace Tellico {
@@ -27,15 +27,15 @@ namespace Tellico {
*/
class Iso5426Converter {
public:
- static QString toUtf8(const QCString& text);
+ static TQString toUtf8(const TQCString& text);
private:
static bool hasNext(uint pos, uint len);
static bool isAscii(uchar c);
static bool isCombining(uchar c);
- static QChar getChar(uchar c);
- static QChar getCombiningChar(uint i);
+ static TQChar getChar(uchar c);
+ static TQChar getCombiningChar(uint i);
};
} // end namespace
diff --git a/src/iso6937converter.cpp b/src/iso6937converter.cpp
index 3a3bcfb..1651f60 100644
--- a/src/iso6937converter.cpp
+++ b/src/iso6937converter.cpp
@@ -24,13 +24,13 @@
#include "iso6937converter.h"
#include "tellico_debug.h"
-#include <qstring.h>
+#include <tqstring.h>
using Tellico::Iso6937Converter;
-QString Iso6937Converter::toUtf8(const QCString& text_) {
+TQString Iso6937Converter::toUtf8(const TQCString& text_) {
const uint len = text_.length();
- QString result;
+ TQString result;
result.reserve(len);
uint pos = 0;
for(uint i = 0; i < len; ++i) {
@@ -38,7 +38,7 @@ QString Iso6937Converter::toUtf8(const QCString& text_) {
if(isAscii(c)) {
result[pos++] = c;
} else if(isCombining(c) && hasNext(i, len)) {
- QChar d = getCombiningChar(c * 256 + text_[i + 1]);
+ TQChar d = getCombiningChar(c * 256 + text_[i + 1]);
if(!d.isNull()) {
result[pos++] = d;
++i;
@@ -69,7 +69,7 @@ bool Iso6937Converter::isCombining(uchar c) {
}
// Source : http://anubis.dkuug.dk/JTC1/SC2/WG3/docs/6937cd.pdf
-QChar Iso6937Converter::getChar(uchar c) {
+TQChar Iso6937Converter::getChar(uchar c) {
switch(c) {
case 0xA0:
return 0x00A0; // 10/00 NO-BREAK SPACE
@@ -88,11 +88,11 @@ QChar Iso6937Converter::getChar(uchar c) {
case 0xA8:
return 0x00A4; // 10/08 CURRENCY SIGN
case 0xA9:
- return 0x2018; // 10/09 LEFT SINGLE QUOTATION MARK
+ return 0x2018; // 10/09 LEFT SINGLE TQUOTATION MARK
case 0xAA:
- return 0x201C; // 10/10 LEFT DOUBLE QUOTATION MARK
+ return 0x201C; // 10/10 LEFT DOUBLE TQUOTATION MARK
case 0xAB:
- return 0x00AB; // 10/11 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ return 0x00AB; // 10/11 LEFT-POINTING DOUBLE ANGLE TQUOTATION MARK
case 0xAC:
return 0x2190; // 10/12 LEFTWARDS ARROW
case 0xAD:
@@ -121,17 +121,17 @@ QChar Iso6937Converter::getChar(uchar c) {
case 0xB8:
return 0x00F7; // 11/08 DIVISION SIGN
case 0xB9:
- return 0x2019; // 11/09 RIGHT SINGLE QUOTATION MARK
+ return 0x2019; // 11/09 RIGHT SINGLE TQUOTATION MARK
case 0xBA:
- return 0x201D; // 11/10 RIGHT DOUBLE QUOTATION MARK
+ return 0x201D; // 11/10 RIGHT DOUBLE TQUOTATION MARK
case 0xBB:
- return 0x00BB; // 11/11 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+ return 0x00BB; // 11/11 RIGHT-POINTING DOUBLE ANGLE TQUOTATION MARK
case 0xBC:
- return 0x00BC; // 11/12 VULGAR FRACTION ONE QUARTER
+ return 0x00BC; // 11/12 VULGAR FRACTION ONE TQUARTER
case 0xBD:
return 0x00BD; // 11/13 VULGAR FRACTION ONE HALF
case 0xBE:
- return 0x00BE; // 11/14 VULGAR FRACTION THREE QUARTERS
+ return 0x00BE; // 11/14 VULGAR FRACTION THREE TQUARTERS
case 0xBF:
return 0x00BF; // 11/15 INVERTED QUESTION MARK
@@ -231,7 +231,7 @@ QChar Iso6937Converter::getChar(uchar c) {
}
}
-QChar Iso6937Converter::getCombiningChar(uint c) {
+TQChar Iso6937Converter::getCombiningChar(uint c) {
switch(c) {
// 12/00 (This position shall not be used)
@@ -592,6 +592,6 @@ QChar Iso6937Converter::getCombiningChar(uint c) {
default:
myDebug() << "Iso6937Converter::getCombiningChar() - no match for " << c << endl;
- return QChar();
+ return TQChar();
}
}
diff --git a/src/iso6937converter.h b/src/iso6937converter.h
index 1d168ba..8a411ed 100644
--- a/src/iso6937converter.h
+++ b/src/iso6937converter.h
@@ -14,9 +14,9 @@
#ifndef TELLICO_ISO6937CONVERTER_H
#define TELLICO_ISO6937CONVERTER_H
-class QCString;
-class QString;
-class QChar;
+class TQCString;
+class TQString;
+class TQChar;
namespace Tellico {
@@ -25,15 +25,15 @@ namespace Tellico {
*/
class Iso6937Converter {
public:
- static QString toUtf8(const QCString& text);
+ static TQString toUtf8(const TQCString& text);
private:
static bool hasNext(unsigned int pos, unsigned int len);
static bool isAscii(unsigned char c);
static bool isCombining(unsigned char c);
- static QChar getChar(unsigned char c);
- static QChar getCombiningChar(unsigned int c);
+ static TQChar getChar(unsigned char c);
+ static TQChar getCombiningChar(unsigned int c);
};
} // end namespace
diff --git a/src/latin1literal.h b/src/latin1literal.h
index 03e2293..72bc880 100644
--- a/src/latin1literal.h
+++ b/src/latin1literal.h
@@ -18,18 +18,18 @@
#ifndef LATIN1LITERAL_H
#define LATIN1LITERAL_H
-#include <qstring.h>
+#include <tqstring.h>
namespace Tellico {
/**
* A class for explicit marking of string literals encoded in the ISO
* 8859-1 character set. Allows for efficient, still (in terms of the
- * chosen encoding) safe comparison with QString instances. To be used
+ * chosen encoding) safe comparison with TQString instances. To be used
* like this:
*
* \code
- * QString s = .....
+ * TQString s = .....
* if (s == Latin1Literal("o")) { ..... }
* \endcode
*
@@ -52,8 +52,8 @@ public:
} // end namespace
inline
-bool operator==(const QString& s1, const Tellico::Latin1LiteralInternal& s2) {
- const QChar* uc = s1.unicode();
+bool operator==(const TQString& s1, const Tellico::Latin1LiteralInternal& s2) {
+ const TQChar* uc = s1.tqunicode();
const char* c = s2.str;
if(!c || !uc) {
return (!c && !uc);
@@ -65,7 +65,7 @@ bool operator==(const QString& s1, const Tellico::Latin1LiteralInternal& s2) {
}
for(size_t i = 0; i < l; ++i, ++uc, ++c) {
- if(uc->unicode() != static_cast<uchar>(*c)) {
+ if(uc->tqunicode() != static_cast<uchar>(*c)) {
return false;
}
}
@@ -73,17 +73,17 @@ bool operator==(const QString& s1, const Tellico::Latin1LiteralInternal& s2) {
}
inline
-bool operator!=(const QString& s1, const Tellico::Latin1LiteralInternal& s2) {
+bool operator!=(const TQString& s1, const Tellico::Latin1LiteralInternal& s2) {
return !(s1 == s2);
}
inline
-bool operator==(const Tellico::Latin1LiteralInternal& s1, const QString& s2) {
+bool operator==(const Tellico::Latin1LiteralInternal& s1, const TQString& s2) {
return s2 == s1;
}
inline
-bool operator!=(const Tellico::Latin1LiteralInternal& s1, const QString& s2) {
+bool operator!=(const Tellico::Latin1LiteralInternal& s1, const TQString& s2) {
return !(s2 == s1);
}
diff --git a/src/lccnvalidator.cpp b/src/lccnvalidator.cpp
index 8c47931..9b103dd 100644
--- a/src/lccnvalidator.cpp
+++ b/src/lccnvalidator.cpp
@@ -16,8 +16,8 @@
using Tellico::LCCNValidator;
-LCCNValidator::LCCNValidator(QObject* parent_) : QRegExpValidator(parent_) {
- QRegExp rx(QString::fromLatin1("[a-z ]{0,3}"
+LCCNValidator::LCCNValidator(TQObject* tqparent_) : TQRegExpValidator(tqparent_) {
+ TQRegExp rx(TQString::tqfromLatin1("[a-z ]{0,3}"
"("
"\\d{2}-?\\d{1,6}"
"|"
@@ -28,24 +28,24 @@ LCCNValidator::LCCNValidator(QObject* parent_) : QRegExpValidator(parent_) {
}
// static
-QString LCCNValidator::formalize(const QString& value_) {
+TQString LCCNValidator::formalize(const TQString& value_) {
const int len = value_.length();
// first remove alpha prefix
- QString alpha;
+ TQString alpha;
for(int pos = 0; pos < len; ++pos) {
- QChar c = value_.at(pos);
+ TQChar c = value_.at(pos);
if(c.isNumber()) {
break;
}
alpha += value_.at(pos);
}
- QString afterAlpha = value_.mid(alpha.length());
+ TQString afterAlpha = value_.mid(alpha.length());
alpha = alpha.stripWhiteSpace(); // possible to have a space at the end
- QString year;
- QString serial;
+ TQString year;
+ TQString serial;
// have to be able to differentiate 2 and 4-digit years, first check for hyphen position
- int pos = afterAlpha.find('-');
+ int pos = afterAlpha.tqfind('-');
if(pos > -1) {
year = afterAlpha.section('-', 0, 0);
serial = afterAlpha.section('-', 1);
@@ -54,7 +54,7 @@ QString LCCNValidator::formalize(const QString& value_) {
// or from any year after 2100. Reasonable, right?
// so if the string starts with '20' we take the first 4 digits as the year
// otherwise the first 2
- if(afterAlpha.startsWith(QString::fromLatin1("20"))) {
+ if(afterAlpha.startsWith(TQString::tqfromLatin1("20"))) {
year = afterAlpha.left(4);
serial = afterAlpha.mid(4);
} else {
@@ -66,7 +66,7 @@ QString LCCNValidator::formalize(const QString& value_) {
// now check for non digits in the serial
pos = 0;
for( ; pos < serial.length() && serial.at(pos).isNumber(); ++pos) { ; }
- QString suffix = serial.mid(pos);
+ TQString suffix = serial.mid(pos);
serial = serial.left(pos);
// serial must be left-padded with zeros to 6 characters
serial = serial.rightJustify(6, '0');
diff --git a/src/lccnvalidator.h b/src/lccnvalidator.h
index 60ab807..27a7366 100644
--- a/src/lccnvalidator.h
+++ b/src/lccnvalidator.h
@@ -14,7 +14,7 @@
#ifndef TELLICO_LCCNVALIDATOR_H
#define TELLICO_LCCNVALIDATOR_H
-#include <qvalidator.h>
+#include <tqvalidator.h>
namespace Tellico {
@@ -28,16 +28,16 @@ namespace Tellico {
* - 2001-1114
* - gm 71-2450
*/
-class LCCNValidator : public QRegExpValidator {
+class LCCNValidator : public TQRegExpValidator {
public:
- LCCNValidator(QObject* parent);
+ LCCNValidator(TQObject* tqparent);
/**
* Returns the formalized version as dictated by LOC search
* http://catalog.loc.gov/help/number.htm
*/
- static QString formalize(const QString& value);
+ static TQString formalize(const TQString& value);
};
}
diff --git a/src/listviewcomparison.cpp b/src/listviewcomparison.cpp
index 9bdd10c..e15b1d8 100644
--- a/src/listviewcomparison.cpp
+++ b/src/listviewcomparison.cpp
@@ -18,13 +18,13 @@
#include "document.h"
#include "entryitem.h"
-#include <qlistview.h>
-#include <qiconview.h>
-#include <qpixmap.h>
-#include <qdatetime.h>
+#include <tqlistview.h>
+#include <tqiconview.h>
+#include <tqpixmap.h>
+#include <tqdatetime.h>
namespace {
- int compareFloat(const QString& s1, const QString& s2) {
+ int compareFloat(const TQString& s1, const TQString& s2) {
bool ok1, ok2;
float n1 = s1.toFloat(&ok1);
float n2 = s2.toFloat(&ok2);
@@ -51,7 +51,7 @@ Tellico::ListViewComparison* Tellico::ListViewComparison::create(Data::ConstFiel
} else if(field_->formatFlag() == Data::Field::FormatTitle) {
// Dependent could be title, so put this test after
return new TitleComparison(field_);
- } else if(field_->property(QString::fromLatin1("lcc")) == Latin1Literal("true") ||
+ } else if(field_->property(TQString::tqfromLatin1("lcc")) == Latin1Literal("true") ||
(field_->name() == Latin1Literal("lcc") &&
Data::Document::self()->collection() &&
(Data::Document::self()->collection()->type() == Data::Collection::Book ||
@@ -73,8 +73,8 @@ int Tellico::ListViewComparison::compare(int col_,
return compare(item1_->key(col_, asc_), item2_->key(col_, asc_));
}
-int Tellico::ListViewComparison::compare(const QIconViewItem* item1_,
- const QIconViewItem* item2_)
+int Tellico::ListViewComparison::compare(const TQIconViewItem* item1_,
+ const TQIconViewItem* item2_)
{
return compare(item1_->key(), item2_->key());
}
@@ -82,23 +82,23 @@ int Tellico::ListViewComparison::compare(const QIconViewItem* item1_,
Tellico::StringComparison::StringComparison(Data::ConstFieldPtr field) : ListViewComparison(field) {
}
-int Tellico::StringComparison::compare(const QString& str1_, const QString& str2_) {
+int Tellico::StringComparison::compare(const TQString& str1_, const TQString& str2_) {
return str1_.localeAwareCompare(str2_);
}
Tellico::TitleComparison::TitleComparison(Data::ConstFieldPtr field) : ListViewComparison(field) {
}
-int Tellico::TitleComparison::compare(const QString& str1_, const QString& str2_) {
- const QString title1 = Data::Field::sortKeyTitle(str1_);
- const QString title2 = Data::Field::sortKeyTitle(str2_);
+int Tellico::TitleComparison::compare(const TQString& str1_, const TQString& str2_) {
+ const TQString title1 = Data::Field::sortKeyTitle(str1_);
+ const TQString title2 = Data::Field::sortKeyTitle(str2_);
return title1.localeAwareCompare(title2);
}
Tellico::NumberComparison::NumberComparison(Data::ConstFieldPtr field) : ListViewComparison(field) {
}
-int Tellico::NumberComparison::compare(const QString& str1_, const QString& str2_) {
+int Tellico::NumberComparison::compare(const TQString& str1_, const TQString& str2_) {
// by default, an empty string would get sorted before "1" because toFloat() turns it into "0"
// I want the empty strings to be at the end
bool ok1, ok2;
@@ -119,15 +119,15 @@ int Tellico::NumberComparison::compare(const QString& str1_, const QString& str2
// http://www.mcgees.org/2001/08/08/sort-by-library-of-congress-call-number-in-perl/
Tellico::LCCComparison::LCCComparison(Data::ConstFieldPtr field) : StringComparison(field),
- m_regexp(QString::fromLatin1("^([A-Z]+)(\\d+(?:\\.\\d+)?)\\.?([A-Z]*)(\\d*)\\.?([A-Z]*)(\\d*)(?: (\\d\\d\\d\\d))?")) {
+ m_regexp(TQString::tqfromLatin1("^([A-Z]+)(\\d+(?:\\.\\d+)?)\\.?([A-Z]*)(\\d*)\\.?([A-Z]*)(\\d*)(?: (\\d\\d\\d\\d))?")) {
}
-int Tellico::LCCComparison::compare(const QString& str1_, const QString& str2_) {
+int Tellico::LCCComparison::compare(const TQString& str1_, const TQString& str2_) {
// myDebug() << "LCCComparison::compare() - " << str1_ << " to " << str2_ << endl;
int pos1 = m_regexp.search(str1_);
- const QStringList cap1 = m_regexp.capturedTexts();
+ const TQStringList cap1 = m_regexp.tqcapturedTexts();
int pos2 = m_regexp.search(str2_);
- const QStringList cap2 = m_regexp.capturedTexts();
+ const TQStringList cap2 = m_regexp.tqcapturedTexts();
if(pos1 > -1 && pos2 > -1) {
int res = compareLCC(cap1, cap2);
// myLog() << "...result = " << res << endl;
@@ -136,17 +136,17 @@ int Tellico::LCCComparison::compare(const QString& str1_, const QString& str2_)
return StringComparison::compare(str1_, str2_);
}
-int Tellico::LCCComparison::compareLCC(const QStringList& cap1, const QStringList& cap2) const {
+int Tellico::LCCComparison::compareLCC(const TQStringList& cap1, const TQStringList& cap2) const {
// the first item in the list is the full match, so start array index at 1
int res = 0;
return (res = cap1[1].compare(cap2[1])) != 0 ? res :
(res = compareFloat(cap1[2], cap2[2])) != 0 ? res :
(res = cap1[3].compare(cap2[3])) != 0 ? res :
- (res = compareFloat(QString::fromLatin1("0.") + cap1[4],
- QString::fromLatin1("0.") + cap2[4])) != 0 ? res :
+ (res = compareFloat(TQString::tqfromLatin1("0.") + cap1[4],
+ TQString::tqfromLatin1("0.") + cap2[4])) != 0 ? res :
(res = cap1[5].compare(cap2[5])) != 0 ? res :
- (res = compareFloat(QString::fromLatin1("0.") + cap1[6],
- QString::fromLatin1("0.") + cap2[6])) != 0 ? res :
+ (res = compareFloat(TQString::tqfromLatin1("0.") + cap1[6],
+ TQString::tqfromLatin1("0.") + cap2[6])) != 0 ? res :
(res = compareFloat(cap1[7], cap2[7])) != 0 ? res : 0;
}
@@ -159,8 +159,8 @@ int Tellico::PixmapComparison::compare(int col_,
bool asc_)
{
Q_UNUSED(asc_);
- const QPixmap* pix1 = item1_->pixmap(col_);
- const QPixmap* pix2 = item2_->pixmap(col_);
+ const TQPixmap* pix1 = item1_->pixmap(col_);
+ const TQPixmap* pix2 = item2_->pixmap(col_);
if(pix1 && !pix1->isNull()) {
if(pix2 && !pix2->isNull()) {
// large images come first
@@ -173,11 +173,11 @@ int Tellico::PixmapComparison::compare(int col_,
return 0;
}
-int Tellico::PixmapComparison::compare(const QIconViewItem* item1_,
- const QIconViewItem* item2_)
+int Tellico::PixmapComparison::compare(const TQIconViewItem* item1_,
+ const TQIconViewItem* item2_)
{
- const QPixmap* pix1 = item1_->pixmap();
- const QPixmap* pix2 = item2_->pixmap();
+ const TQPixmap* pix1 = item1_->pixmap();
+ const TQPixmap* pix2 = item2_->pixmap();
if(pix1 && !pix1->isNull()) {
if(pix2 && !pix2->isNull()) {
// large images come first
@@ -205,7 +205,7 @@ int Tellico::DependentComparison::compare(int col_,
{
Q_UNUSED(col_);
Q_UNUSED(asc_);
- for(QPtrListIterator<ListViewComparison> it(m_comparisons); it.current(); ++it) {
+ for(TQPtrListIterator<ListViewComparison> it(m_comparisons); it.current(); ++it) {
int res = it.current()->compare(col_, item1_, item2_, asc_);
if(res != 0) {
return res;
@@ -214,10 +214,10 @@ int Tellico::DependentComparison::compare(int col_,
return ListViewComparison::compare(col_, item1_, item2_, asc_);
}
-int Tellico::DependentComparison::compare(const QIconViewItem* item1_,
- const QIconViewItem* item2_)
+int Tellico::DependentComparison::compare(const TQIconViewItem* item1_,
+ const TQIconViewItem* item2_)
{
- for(QPtrListIterator<ListViewComparison> it(m_comparisons); it.current(); ++it) {
+ for(TQPtrListIterator<ListViewComparison> it(m_comparisons); it.current(); ++it) {
int res = it.current()->compare(item1_, item2_);
if(res != 0) {
return res;
@@ -229,7 +229,7 @@ int Tellico::DependentComparison::compare(const QIconViewItem* item1_,
Tellico::ISODateComparison::ISODateComparison(Data::ConstFieldPtr field) : ListViewComparison(field) {
}
-int Tellico::ISODateComparison::compare(const QString& str1, const QString& str2) {
+int Tellico::ISODateComparison::compare(const TQString& str1, const TQString& str2) {
if(str1.isEmpty()) {
return str2.isEmpty() ? 0 : -1;
}
@@ -239,11 +239,11 @@ int Tellico::ISODateComparison::compare(const QString& str1, const QString& str2
// modelled after Field::formatDate()
// so dates would sort as expected without padding month and day with zero
// and accounting for "current year - 1 - 1" default scheme
- QStringList dlist1 = QStringList::split('-', str1, true);
+ TQStringList dlist1 = TQStringList::split('-', str1, true);
bool ok = true;
- int y1 = dlist1.count() > 0 ? dlist1[0].toInt(&ok) : QDate::currentDate().year();
+ int y1 = dlist1.count() > 0 ? dlist1[0].toInt(&ok) : TQDate::tqcurrentDate().year();
if(!ok) {
- y1 = QDate::currentDate().year();
+ y1 = TQDate::tqcurrentDate().year();
}
int m1 = dlist1.count() > 1 ? dlist1[1].toInt(&ok) : 1;
if(!ok) {
@@ -253,12 +253,12 @@ int Tellico::ISODateComparison::compare(const QString& str1, const QString& str2
if(!ok) {
d1 = 1;
}
- QDate date1(y1, m1, d1);
+ TQDate date1(y1, m1, d1);
- QStringList dlist2 = QStringList::split('-', str2, true);
- int y2 = dlist2.count() > 0 ? dlist2[0].toInt(&ok) : QDate::currentDate().year();
+ TQStringList dlist2 = TQStringList::split('-', str2, true);
+ int y2 = dlist2.count() > 0 ? dlist2[0].toInt(&ok) : TQDate::tqcurrentDate().year();
if(!ok) {
- y2 = QDate::currentDate().year();
+ y2 = TQDate::tqcurrentDate().year();
}
int m2 = dlist2.count() > 1 ? dlist2[1].toInt(&ok) : 1;
if(!ok) {
@@ -268,7 +268,7 @@ int Tellico::ISODateComparison::compare(const QString& str1, const QString& str2
if(!ok) {
d2 = 1;
}
- QDate date2(y2, m2, d2);
+ TQDate date2(y2, m2, d2);
if(date1 < date2) {
return -1;
diff --git a/src/listviewcomparison.h b/src/listviewcomparison.h
index 4c0ed43..28a3878 100644
--- a/src/listviewcomparison.h
+++ b/src/listviewcomparison.h
@@ -16,10 +16,10 @@
#include "datavectors.h"
-#include <qregexp.h>
+#include <tqregexp.h>
-class QStringList;
-class QIconViewItem;
+class TQStringList;
+class TQIconViewItem;
namespace Tellico {
namespace GUI {
@@ -31,19 +31,19 @@ public:
ListViewComparison(Data::ConstFieldPtr field);
virtual ~ListViewComparison() {}
- const QString& fieldName() const { return m_fieldName; }
+ const TQString& fieldName() const { return m_fieldName; }
virtual int compare(int col, const GUI::ListViewItem* item1, const GUI::ListViewItem* item2, bool asc);
- virtual int compare(const QIconViewItem* item1, const QIconViewItem* item2);
+ virtual int compare(const TQIconViewItem* item1, const TQIconViewItem* item2);
static ListViewComparison* create(Data::FieldPtr field);
static ListViewComparison* create(Data::ConstFieldPtr field);
protected:
- virtual int compare(const QString& str1, const QString& str2) = 0;
+ virtual int compare(const TQString& str1, const TQString& str2) = 0;
private:
- QString m_fieldName;
+ TQString m_fieldName;
};
class StringComparison : public ListViewComparison {
@@ -51,7 +51,7 @@ public:
StringComparison(Data::ConstFieldPtr field);
protected:
- virtual int compare(const QString& str1, const QString& str2);
+ virtual int compare(const TQString& str1, const TQString& str2);
};
class TitleComparison : public ListViewComparison {
@@ -59,7 +59,7 @@ public:
TitleComparison(Data::ConstFieldPtr field);
protected:
- virtual int compare(const QString& str1, const QString& str2);
+ virtual int compare(const TQString& str1, const TQString& str2);
};
class NumberComparison : public ListViewComparison {
@@ -67,7 +67,7 @@ public:
NumberComparison(Data::ConstFieldPtr field);
protected:
- virtual int compare(const QString& str1, const QString& str2);
+ virtual int compare(const TQString& str1, const TQString& str2);
};
class LCCComparison : public StringComparison {
@@ -75,11 +75,11 @@ public:
LCCComparison(Data::ConstFieldPtr field);
protected:
- virtual int compare(const QString& str1, const QString& str2);
+ virtual int compare(const TQString& str1, const TQString& str2);
private:
- int compareLCC(const QStringList& cap1, const QStringList& cap2) const;
- QRegExp m_regexp;
+ int compareLCC(const TQStringList& cap1, const TQStringList& cap2) const;
+ TQRegExp m_regexp;
};
class PixmapComparison : public ListViewComparison {
@@ -87,10 +87,10 @@ public:
PixmapComparison(Data::ConstFieldPtr field);
virtual int compare(int col, const GUI::ListViewItem* item1, const GUI::ListViewItem* item2, bool asc);
- virtual int compare(const QIconViewItem* item1, const QIconViewItem* item2);
+ virtual int compare(const TQIconViewItem* item1, const TQIconViewItem* item2);
protected:
- virtual int compare(const QString&, const QString&) { return 0; }
+ virtual int compare(const TQString&, const TQString&) { return 0; }
};
class DependentComparison : public StringComparison {
@@ -98,10 +98,10 @@ public:
DependentComparison(Data::ConstFieldPtr field);
virtual int compare(int col, const GUI::ListViewItem* item1, const GUI::ListViewItem* item2, bool asc);
- virtual int compare(const QIconViewItem* item1, const QIconViewItem* item2);
+ virtual int compare(const TQIconViewItem* item1, const TQIconViewItem* item2);
private:
- QPtrList<ListViewComparison> m_comparisons;
+ TQPtrList<ListViewComparison> m_comparisons;
};
class ISODateComparison : public ListViewComparison {
@@ -109,7 +109,7 @@ public:
ISODateComparison(Data::ConstFieldPtr field);
protected:
- virtual int compare(const QString& str1, const QString& str2);
+ virtual int compare(const TQString& str1, const TQString& str2);
};
}
diff --git a/src/loandialog.cpp b/src/loandialog.cpp
index e34ecc7..5835c53 100644
--- a/src/loandialog.cpp
+++ b/src/loandialog.cpp
@@ -28,22 +28,22 @@
#include <kiconloader.h>
#include <kabc/stdaddressbook.h>
-#include <qlayout.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qwhatsthis.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqwhatsthis.h>
using Tellico::LoanDialog;
-LoanDialog::LoanDialog(const Data::EntryVec& entries_, QWidget* parent_, const char* name_/*=0*/)
- : KDialogBase(parent_, name_, true, i18n("Loan Dialog"), Ok|Cancel),
+LoanDialog::LoanDialog(const Data::EntryVec& entries_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : KDialogBase(tqparent_, name_, true, i18n("Loan Dialog"), Ok|Cancel),
m_mode(Add), m_borrower(0), m_entries(entries_), m_loan(0) {
init();
}
-LoanDialog::LoanDialog(Data::LoanPtr loan_, QWidget* parent_, const char* name_/*=0*/)
- : KDialogBase(parent_, name_, true, i18n("Modify Loan"), Ok|Cancel),
+LoanDialog::LoanDialog(Data::LoanPtr loan_, TQWidget* tqparent_, const char* name_/*=0*/)
+ : KDialogBase(tqparent_, name_, true, i18n("Modify Loan"), Ok|Cancel),
m_mode(Modify), m_borrower(loan_->borrower()), m_loan(loan_) {
m_entries.append(m_loan->entry());
@@ -62,117 +62,117 @@ LoanDialog::LoanDialog(Data::LoanPtr loan_, QWidget* parent_, const char* name_/
}
void LoanDialog::init() {
- QWidget* mainWidget = new QWidget(this, "LoanDialog mainWidget");
+ TQWidget* mainWidget = new TQWidget(this, "LoanDialog mainWidget");
setMainWidget(mainWidget);
- QGridLayout* topLayout = new QGridLayout(mainWidget, 7, 2, 0, KDialog::spacingHint());
+ TQGridLayout* topLayout = new TQGridLayout(mainWidget, 7, 2, 0, KDialog::spacingHint());
- QHBox* hbox = new QHBox(mainWidget);
+ TQHBox* hbox = new TQHBox(mainWidget);
hbox->setSpacing(KDialog::spacingHint());
- QLabel* pixLabel = new QLabel(hbox);
- pixLabel->setPixmap(DesktopIcon(QString::fromLatin1("tellico"), 64));
- pixLabel->setAlignment(Qt::AlignAuto | Qt::AlignTop);
+ TQLabel* pixLabel = new TQLabel(hbox);
+ pixLabel->setPixmap(DesktopIcon(TQString::tqfromLatin1("tellico"), 64));
+ pixLabel->tqsetAlignment(TQt::AlignAuto | TQt::AlignTop);
hbox->setStretchFactor(pixLabel, 0);
- QString entryString = QString::fromLatin1("<qt><p>");
+ TQString entryString = TQString::tqfromLatin1("<qt><p>");
if(m_mode == Add) {
entryString += i18n("The following items are being checked out:");
- entryString += QString::fromLatin1("</p><ol>");
+ entryString += TQString::tqfromLatin1("</p><ol>");
for(Data::EntryVec::ConstIterator entry = m_entries.constBegin(); entry != m_entries.constEnd(); ++entry) {
- entryString += QString::fromLatin1("<li>") + entry->title() + QString::fromLatin1("</li>");
+ entryString += TQString::tqfromLatin1("<li>") + entry->title() + TQString::tqfromLatin1("</li>");
}
} else {
entryString += i18n("The following item is on-loan:");
- entryString += QString::fromLatin1("</p><ol>");
- entryString += QString::fromLatin1("<li>") + m_loan->entry()->title() + QString::fromLatin1("</li>");
+ entryString += TQString::tqfromLatin1("</p><ol>");
+ entryString += TQString::tqfromLatin1("<li>") + m_loan->entry()->title() + TQString::tqfromLatin1("</li>");
}
- entryString += QString::fromLatin1("</ol></qt>");
+ entryString += TQString::tqfromLatin1("</ol></qt>");
GUI::RichTextLabel* entryLabel = new GUI::RichTextLabel(entryString, hbox);
hbox->setStretchFactor(entryLabel, 1);
topLayout->addMultiCellWidget(hbox, 0, 0, 0, 1);
- QLabel* l = new QLabel(i18n("&Lend to:"), mainWidget);
+ TQLabel* l = new TQLabel(i18n("&Lend to:"), mainWidget);
topLayout->addWidget(l, 1, 0);
- hbox = new QHBox(mainWidget);
+ hbox = new TQHBox(mainWidget);
hbox->setSpacing(KDialog::spacingHint());
topLayout->addWidget(hbox, 1, 1);
m_borrowerEdit = new KLineEdit(hbox);
l->setBuddy(m_borrowerEdit);
m_borrowerEdit->completionObject()->setIgnoreCase(true);
- connect(m_borrowerEdit, SIGNAL(textChanged(const QString&)),
- SLOT(slotBorrowerNameChanged(const QString&)));
+ connect(m_borrowerEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_SLOT(slotBorrowerNameChanged(const TQString&)));
actionButton(Ok)->setEnabled(false); // disable until a name is entered
- KPushButton* pb = new KPushButton(SmallIconSet(QString::fromLatin1("kaddressbook")), QString::null, hbox);
- connect(pb, SIGNAL(clicked()), SLOT(slotGetBorrower()));
- QString whats = i18n("Enter the name of the person borrowing the items from you. "
+ KPushButton* pb = new KPushButton(SmallIconSet(TQString::tqfromLatin1("kaddressbook")), TQString(), hbox);
+ connect(pb, TQT_SIGNAL(clicked()), TQT_SLOT(slotGetBorrower()));
+ TQString whats = i18n("Enter the name of the person borrowing the items from you. "
"Clicking the button allows you to select from your address book.");
- QWhatsThis::add(l, whats);
- QWhatsThis::add(hbox, whats);
+ TQWhatsThis::add(l, whats);
+ TQWhatsThis::add(hbox, whats);
// only enable for new loans
if(m_mode == Modify) {
m_borrowerEdit->setEnabled(false);
pb->setEnabled(false);
}
- l = new QLabel(i18n("&Loan date:"), mainWidget);
+ l = new TQLabel(i18n("&Loan date:"), mainWidget);
topLayout->addWidget(l, 2, 0);
m_loanDate = new GUI::DateWidget(mainWidget);
- m_loanDate->setDate(QDate::currentDate());
+ m_loanDate->setDate(TQDate::tqcurrentDate());
l->setBuddy(m_loanDate);
topLayout->addWidget(m_loanDate, 2, 1);
whats = i18n("The check-out date is the date that you lent the items. By default, "
"today's date is used.");
- QWhatsThis::add(l, whats);
- QWhatsThis::add(m_loanDate, whats);
+ TQWhatsThis::add(l, whats);
+ TQWhatsThis::add(m_loanDate, whats);
// only enable for new loans
if(m_mode == Modify) {
m_loanDate->setEnabled(false);
}
- l = new QLabel(i18n("D&ue date:"), mainWidget);
+ l = new TQLabel(i18n("D&ue date:"), mainWidget);
topLayout->addWidget(l, 3, 0);
m_dueDate = new GUI::DateWidget(mainWidget);
l->setBuddy(m_dueDate);
topLayout->addWidget(m_dueDate, 3, 1);
// valid due dates will enable the calendar adding checkbox
- connect(m_dueDate, SIGNAL(signalModified()), SLOT(slotDueDateChanged()));
+ connect(m_dueDate, TQT_SIGNAL(signalModified()), TQT_SLOT(slotDueDateChanged()));
whats = i18n("The due date is when the items are due to be returned. The due date "
"is not required, unless you want to add the loan to your active calendar.");
- QWhatsThis::add(l, whats);
- QWhatsThis::add(m_dueDate, whats);
+ TQWhatsThis::add(l, whats);
+ TQWhatsThis::add(m_dueDate, whats);
- l = new QLabel(i18n("&Note:"), mainWidget);
+ l = new TQLabel(i18n("&Note:"), mainWidget);
topLayout->addWidget(l, 4, 0);
m_note = new KTextEdit(mainWidget);
l->setBuddy(m_note);
topLayout->addMultiCellWidget(m_note, 5, 5, 0, 1);
topLayout->setRowStretch(5, 1);
whats = i18n("You can add notes about the loan, as well.");
- QWhatsThis::add(l, whats);
- QWhatsThis::add(m_note, whats);
+ TQWhatsThis::add(l, whats);
+ TQWhatsThis::add(m_note, whats);
- m_addEvent = new QCheckBox(i18n("&Add a reminder to the active calendar"), mainWidget);
+ m_addEvent = new TQCheckBox(i18n("&Add a reminder to the active calendar"), mainWidget);
topLayout->addMultiCellWidget(m_addEvent, 6, 6, 0, 1);
m_addEvent->setEnabled(false); // gets enabled when valid due date is entered
- QWhatsThis::add(m_addEvent, i18n("<qt>Checking this box will add a <em>To-do</em> item "
+ TQWhatsThis::add(m_addEvent, i18n("<qt>Checking this box will add a <em>To-do</em> item "
"to your active calendar, which can be viewed using KOrganizer. "
"The box is only active if you set a due date."));
- resize(configDialogSize(QString::fromLatin1("Loan Dialog Options")));
+ resize(configDialogSize(TQString::tqfromLatin1("Loan Dialog Options")));
KABC::AddressBook* abook = KABC::StdAddressBook::self(true);
- connect(abook, SIGNAL(addressBookChanged(AddressBook*)),
- SLOT(slotLoadAddressBook()));
- connect(abook, SIGNAL(loadingFinished(Resource*)),
- SLOT(slotLoadAddressBook()));
+ connect(abook, TQT_SIGNAL(addressBookChanged(AddressBook*)),
+ TQT_SLOT(slotLoadAddressBook()));
+ connect(abook, TQT_SIGNAL(loadingFinished(Resource*)),
+ TQT_SLOT(slotLoadAddressBook()));
slotLoadAddressBook();
}
LoanDialog::~LoanDialog() {
- saveDialogSize(QString::fromLatin1("Loan Dialog Options"));
+ saveDialogSize(TQString::tqfromLatin1("Loan Dialog Options"));
}
-void LoanDialog::slotBorrowerNameChanged(const QString& str_) {
+void LoanDialog::slotBorrowerNameChanged(const TQString& str_) {
actionButton(Ok)->setEnabled(!str_.isEmpty());
}
@@ -200,11 +200,11 @@ void LoanDialog::slotLoadAddressBook() {
}
// add current borrowers, too
- QStringList items = m_borrowerEdit->completionObject()->items();
+ TQStringList items = m_borrowerEdit->completionObject()->items();
Data::BorrowerVec borrowers = m_entries.begin()->collection()->borrowers();
for(Data::BorrowerVec::ConstIterator it = borrowers.constBegin(), end = borrowers.constEnd();
it != end; ++it) {
- if(items.findIndex(it->name()) == -1) {
+ if(items.tqfindIndex(it->name()) == -1) {
m_borrowerEdit->completionObject()->addItem(it->name());
}
}
@@ -212,7 +212,7 @@ void LoanDialog::slotLoadAddressBook() {
KCommand* LoanDialog::createCommand() {
// first, check to see if the borrower is empty
- QString name = m_borrowerEdit->text();
+ TQString name = m_borrowerEdit->text();
if(name.isEmpty()) {
return 0;
}
@@ -230,7 +230,7 @@ KCommand* LoanDialog::addLoansCommand() {
return 0;
}
- const QString name = m_borrowerEdit->text();
+ const TQString name = m_borrowerEdit->text();
// see if there's a borrower with this name already
m_borrower = 0;
diff --git a/src/loandialog.h b/src/loandialog.h
index b51abf0..5cf8354 100644
--- a/src/loandialog.h
+++ b/src/loandialog.h
@@ -17,7 +17,7 @@
class KLineEdit;
class KTextEdit;
class KCommand;
-class QCheckBox;
+class TQCheckBox;
#include "datavectors.h"
#include "borrower.h"
@@ -34,22 +34,23 @@ namespace Tellico {
*/
class LoanDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* The constructor sets up the dialog.
*
- * @param parent A pointer to the parent widget
+ * @param tqparent A pointer to the tqparent widget
* @param name The widget name
*/
- LoanDialog(const Data::EntryVec& entries, QWidget* parent, const char* name=0);
- LoanDialog(Data::LoanPtr loan, QWidget* parent, const char* name=0);
+ LoanDialog(const Data::EntryVec& entries, TQWidget* tqparent, const char* name=0);
+ LoanDialog(Data::LoanPtr loan, TQWidget* tqparent, const char* name=0);
virtual ~LoanDialog();
KCommand* createCommand();
private slots:
- void slotBorrowerNameChanged(const QString& str);
+ void slotBorrowerNameChanged(const TQString& str);
void slotGetBorrower();
void slotLoadAddressBook();
void slotDueDateChanged();
@@ -73,9 +74,9 @@ private:
GUI::DateWidget* m_loanDate;
GUI::DateWidget* m_dueDate;
KTextEdit* m_note;
- QCheckBox* m_addEvent;
+ TQCheckBox* m_addEvent;
- QString m_uid;
+ TQString m_uid;
};
} // end namespace
diff --git a/src/loanitem.cpp b/src/loanitem.cpp
index 744397d..3bdb757 100644
--- a/src/loanitem.cpp
+++ b/src/loanitem.cpp
@@ -17,8 +17,8 @@
using Tellico::LoanItem;
-LoanItem::LoanItem(GUI::CountedItem* parent_, Tellico::Data::LoanPtr loan_)
- : Tellico::EntryItem(parent_, loan_->entry()), m_loan(loan_) {
+LoanItem::LoanItem(GUI::CountedItem* tqparent_, Tellico::Data::LoanPtr loan_)
+ : Tellico::EntryItem(tqparent_, loan_->entry()), m_loan(loan_) {
}
void LoanItem::doubleClicked() {
diff --git a/src/loanitem.h b/src/loanitem.h
index 5e79139..e1e60a1 100644
--- a/src/loanitem.h
+++ b/src/loanitem.h
@@ -24,7 +24,7 @@ namespace Tellico {
*/
class LoanItem : public Tellico::EntryItem {
public:
- LoanItem(GUI::CountedItem* parent, Data::LoanPtr loan);
+ LoanItem(GUI::CountedItem* tqparent, Data::LoanPtr loan);
virtual bool isLoanItem() const { return true; }
Data::LoanPtr loan() { return m_loan; }
diff --git a/src/loanview.cpp b/src/loanview.cpp
index 875f267..f18c6ab 100644
--- a/src/loanview.cpp
+++ b/src/loanview.cpp
@@ -25,27 +25,27 @@
#include <kpopupmenu.h>
#include <kiconloader.h>
-#include <qheader.h>
+#include <tqheader.h>
using Tellico::LoanView;
-LoanView::LoanView(QWidget* parent_, const char* name_) : GUI::ListView(parent_, name_), m_notSortedYet(true) {
+LoanView::LoanView(TQWidget* tqparent_, const char* name_) : GUI::ListView(tqparent_, name_), m_notSortedYet(true) {
addColumn(i18n("Borrower"));
header()->setStretchEnabled(true, 0);
- setResizeMode(QListView::NoColumn);
+ setResizeMode(TQListView::NoColumn);
setRootIsDecorated(true);
setShowSortIndicator(true);
setTreeStepSize(15);
setFullWidth(true);
- connect(this, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)),
- SLOT(contextMenuRequested(QListViewItem*, const QPoint&, int)));
+ connect(this, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)),
+ TQT_SLOT(contextMenuRequested(TQListViewItem*, const TQPoint&, int)));
- connect(this, SIGNAL(expanded(QListViewItem*)),
- SLOT(slotExpanded(QListViewItem*)));
+ connect(this, TQT_SIGNAL(expanded(TQListViewItem*)),
+ TQT_SLOT(slotExpanded(TQListViewItem*)));
- connect(this, SIGNAL(collapsed(QListViewItem*)),
- SLOT(slotCollapsed(QListViewItem*)));
+ connect(this, TQT_SIGNAL(collapsed(TQListViewItem*)),
+ TQT_SLOT(slotCollapsed(TQListViewItem*)));
}
bool LoanView::isSelectable(GUI::ListViewItem* item_) const {
@@ -62,7 +62,7 @@ bool LoanView::isSelectable(GUI::ListViewItem* item_) const {
return true;
}
-void LoanView::contextMenuRequested(QListViewItem* item_, const QPoint& point_, int) {
+void LoanView::contextMenuRequested(TQListViewItem* item_, const TQPoint& point_, int) {
if(!item_) {
return;
}
@@ -70,10 +70,10 @@ void LoanView::contextMenuRequested(QListViewItem* item_, const QPoint& point_,
GUI::ListViewItem* item = static_cast<GUI::ListViewItem*>(item_);
if(item->isLoanItem()) {
KPopupMenu menu(this);
- menu.insertItem(SmallIconSet(QString::fromLatin1("2downarrow")),
- i18n("Check-in"), this, SLOT(slotCheckIn()));
- menu.insertItem(SmallIconSet(QString::fromLatin1("2downarrow")),
- i18n("Modify Loan..."), this, SLOT(slotModifyLoan()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("2downarrow")),
+ i18n("Check-in"), this, TQT_SLOT(slotCheckIn()));
+ menu.insertItem(SmallIconSet(TQString::tqfromLatin1("2downarrow")),
+ i18n("Modify Loan..."), this, TQT_SLOT(slotModifyLoan()));
menu.exec(point_);
}
}
@@ -101,7 +101,7 @@ void LoanView::addCollection(Data::CollPtr coll_) {
for(Data::BorrowerVec::Iterator it = borrowers.begin(); it != borrowers.end(); ++it) {
addBorrower(it);
}
- Data::FieldPtr f = coll_->fieldByName(QString::fromLatin1("title"));
+ Data::FieldPtr f = coll_->fieldByName(TQString::tqfromLatin1("title"));
if(f) {
setComparison(0, ListViewComparison::create(f));
}
@@ -151,14 +151,14 @@ void LoanView::modifyBorrower(Data::BorrowerPtr borrower_) {
borrowerItem->setOpen(open);
}
-void LoanView::slotCollapsed(QListViewItem* item_) {
+void LoanView::slotCollapsed(TQListViewItem* item_) {
// only change icon for group items
if(static_cast<GUI::ListViewItem*>(item_)->isBorrowerItem()) {
static_cast<GUI::ListViewItem*>(item_)->clear();
}
}
-void LoanView::slotExpanded(QListViewItem* item_) {
+void LoanView::slotExpanded(TQListViewItem* item_) {
// only change icon for group items
if(!static_cast<GUI::ListViewItem*>(item_)->isBorrowerItem()) {
kdWarning() << "GroupView::slotExpanded() - non entry group item - " << item_->text(0) << endl;
@@ -225,7 +225,7 @@ void LoanView::resetComparisons() {
if(!coll) {
return;
}
- Data::FieldPtr f = coll->fieldByName(QString::fromLatin1("title"));
+ Data::FieldPtr f = coll->fieldByName(TQString::tqfromLatin1("title"));
if(f) {
setComparison(0, ListViewComparison::create(f));
}
diff --git a/src/loanview.h b/src/loanview.h
index 59e4df4..60ee88a 100644
--- a/src/loanview.h
+++ b/src/loanview.h
@@ -18,7 +18,7 @@
#include "observer.h"
#include "borroweritem.h"
-#include <qdict.h>
+#include <tqdict.h>
namespace Tellico {
namespace Data {
@@ -30,9 +30,10 @@ namespace Tellico {
*/
class LoanView : public GUI::ListView, public Observer {
Q_OBJECT
+ TQ_OBJECT
public:
- LoanView(QWidget* parent, const char* name=0);
+ LoanView(TQWidget* tqparent, const char* name=0);
virtual bool isSelectable(GUI::ListViewItem*) const;
@@ -53,9 +54,9 @@ private slots:
* @param point The location point
* @param col The column number, not currently used
*/
- void contextMenuRequested(QListViewItem* item, const QPoint& point, int col);
- void slotExpanded(QListViewItem* item);
- void slotCollapsed(QListViewItem* item);
+ void contextMenuRequested(TQListViewItem* item, const TQPoint& point, int col);
+ void slotExpanded(TQListViewItem* item);
+ void slotCollapsed(TQListViewItem* item);
void slotCheckIn();
void slotModifyLoan();
@@ -64,7 +65,7 @@ private:
void resetComparisons();
bool m_notSortedYet;
- QDict<BorrowerItem> m_itemDict;
+ TQDict<BorrowerItem> m_itemDict;
};
} // end namespace
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index bb5db7a..d915d72 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -77,17 +77,17 @@
#include <dcopclient.h>
#include <kaction.h>
-#include <qsplitter.h>
-//#include <qpainter.h>
-#include <qsignalmapper.h>
-#include <qtimer.h>
-#include <qmetaobject.h> // needed for copy, cut, paste slots
-#include <qwhatsthis.h>
-#include <qvbox.h>
+#include <tqsplitter.h>
+//#include <tqpainter.h>
+#include <tqsignalmapper.h>
+#include <tqtimer.h>
+#include <tqmetaobject.h> // needed for copy, cut, paste slots
+#include <tqwhatsthis.h>
+#include <tqvbox.h>
// the null string and bool are dummy arguments
#define MIME_ICON(s) \
- KMimeType::mimeType(QString::fromLatin1(s))->icon(QString::null, false)
+ KMimeType::mimeType(TQString::tqfromLatin1(s))->icon(TQString(), false)
namespace {
static const int MAIN_WINDOW_MIN_WIDTH = 600;
@@ -97,7 +97,7 @@ namespace {
using Tellico::MainWindow;
-MainWindow::MainWindow(QWidget* parent_/*=0*/, const char* name_/*=0*/) : KMainWindow(parent_, name_),
+MainWindow::MainWindow(TQWidget* tqparent_/*=0*/, const char* name_/*=0*/) : KMainWindow(tqparent_, name_),
ApplicationInterface(),
m_updateAll(0),
m_statusBar(0),
@@ -126,7 +126,7 @@ MainWindow::MainWindow(QWidget* parent_/*=0*/, const char* name_/*=0*/) : KMainW
// has to be after controller init
Kernel::init(this); // the only time this is ever called!
- setIcon(DesktopIcon(QString::fromLatin1("tellico")));
+ setIcon(DesktopIcon(TQString::tqfromLatin1("tellico")));
// initialize the status bar and progress bar
initStatusBar();
@@ -146,11 +146,11 @@ MainWindow::MainWindow(QWidget* parent_/*=0*/, const char* name_/*=0*/) : KMainW
readOptions();
setAcceptDrops(true);
- DropHandler* drophandler = new DropHandler(this);
+ DropHandler* drophandler = new DropHandler(TQT_TQOBJECT(this));
installEventFilter(drophandler);
MARK_LINE;
- QTimer::singleShot(0, this, SLOT(slotInit()));
+ TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotInit()));
}
void MainWindow::slotInit() {
@@ -181,155 +181,155 @@ void MainWindow::initActions() {
/*************************************************
* File->New menu
*************************************************/
- QSignalMapper* collectionMapper = new QSignalMapper(this);
- connect(collectionMapper, SIGNAL(mapped(int)),
- this, SLOT(slotFileNew(int)));
+ TQSignalMapper* collectionMapper = new TQSignalMapper(TQT_TQOBJECT(this));
+ connect(collectionMapper, TQT_SIGNAL(mapped(int)),
+ TQT_TQOBJECT(this), TQT_SLOT(slotFileNew(int)));
KActionMenu* fileNewMenu = new KActionMenu(actionCollection(), "file_new_collection");
fileNewMenu->setText(i18n("New"));
-// fileNewMenu->setIconSet(BarIconSet(QString::fromLatin1("filenew"))); // doesn't work
- fileNewMenu->setIconSet(BarIcon(QString::fromLatin1("filenew")));
+// fileNewMenu->setIconSet(BarIconSet(TQString::tqfromLatin1("filenew"))); // doesn't work
+ fileNewMenu->setIconSet(BarIcon(TQString::tqfromLatin1("filenew")));
fileNewMenu->setToolTip(i18n("Create a new collection"));
fileNewMenu->setDelayed(false);
KAction* action = new KAction(actionCollection(), "new_book_collection");
action->setText(i18n("New &Book Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("book")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("book")));
action->setToolTip(i18n("Create a new book collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::Book);
action = new KAction(actionCollection(), "new_bibtex_collection");
action->setText(i18n("New B&ibliography"));
- action->setIconSet(UserIconSet(QString::fromLatin1("bibtex")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("bibtex")));
action->setToolTip(i18n("Create a new bibtex bibliography"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::Bibtex);
action = new KAction(actionCollection(), "new_comic_book_collection");
action->setText(i18n("New &Comic Book Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("comic")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("comic")));
action->setToolTip(i18n("Create a new comic book collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::ComicBook);
action = new KAction(actionCollection(), "new_video_collection");
action->setText(i18n("New &Video Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("video")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("video")));
action->setToolTip(i18n("Create a new video collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::Video);
action = new KAction(actionCollection(), "new_music_collection");
action->setText(i18n("New &Music Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("album")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("album")));
action->setToolTip(i18n("Create a new music collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::Album);
action = new KAction(actionCollection(), "new_coin_collection");
action->setText(i18n("New C&oin Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("coin")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("coin")));
action->setToolTip(i18n("Create a new coin collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::Coin);
action = new KAction(actionCollection(), "new_stamp_collection");
action->setText(i18n("New &Stamp Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("stamp")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("stamp")));
action->setToolTip(i18n("Create a new stamp collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::Stamp);
action = new KAction(actionCollection(), "new_card_collection");
action->setText(i18n("New C&ard Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("card")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("card")));
action->setToolTip(i18n("Create a new trading card collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::Card);
action = new KAction(actionCollection(), "new_wine_collection");
action->setText(i18n("New &Wine Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("wine")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("wine")));
action->setToolTip(i18n("Create a new wine collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::Wine);
action = new KAction(actionCollection(), "new_game_collection");
action->setText(i18n("New &Game Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("game")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("game")));
action->setToolTip(i18n("Create a new game collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::Game);
action = new KAction(actionCollection(), "new_boardgame_collection");
action->setText(i18n("New Boa&rd Game Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("boardgame")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("boardgame")));
action->setToolTip(i18n("Create a new board game collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::BoardGame);
action = new KAction(actionCollection(), "new_file_catalog");
action->setText(i18n("New &File Catalog"));
- action->setIconSet(UserIconSet(QString::fromLatin1("file")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("file")));
action->setToolTip(i18n("Create a new file catalog"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::File);
action = new KAction(actionCollection(), "new_custom_collection");
action->setText(i18n("New C&ustom Collection"));
- action->setIconSet(UserIconSet(QString::fromLatin1("filenew")));
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("filenew")));
action->setToolTip(i18n("Create a new custom collection"));
fileNewMenu->insert(action);
- connect(action, SIGNAL(activated()), collectionMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), collectionMapper, TQT_SLOT(map()));
collectionMapper->setMapping(action, Data::Collection::Base);
/*************************************************
* File menu
*************************************************/
- action = KStdAction::open(this, SLOT(slotFileOpen()), actionCollection());
+ action = KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(slotFileOpen()), actionCollection());
action->setToolTip(i18n("Open an existing document"));
- m_fileOpenRecent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection());
+ m_fileOpenRecent = KStdAction::openRecent(TQT_TQOBJECT(this), TQT_SLOT(slotFileOpenRecent(const KURL&)), actionCollection());
m_fileOpenRecent->setToolTip(i18n("Open a recently used file"));
- m_fileSave = KStdAction::save(this, SLOT(slotFileSave()), actionCollection());
+ m_fileSave = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotFileSave()), actionCollection());
m_fileSave->setToolTip(i18n("Save the document"));
- action = KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection());
+ action = KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(slotFileSaveAs()), actionCollection());
action->setToolTip(i18n("Save the document as a different file..."));
- action = KStdAction::print(this, SLOT(slotFilePrint()), actionCollection());
+ action = KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(slotFilePrint()), actionCollection());
action->setToolTip(i18n("Print the contents of the document..."));
- action = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection());
+ action = KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotFileQuit()), actionCollection());
action->setToolTip(i18n("Quit the application"));
/**************** Import Menu ***************************/
- QSignalMapper* importMapper = new QSignalMapper(this);
- connect(importMapper, SIGNAL(mapped(int)),
- this, SLOT(slotFileImport(int)));
+ TQSignalMapper* importMapper = new TQSignalMapper(TQT_TQOBJECT(this));
+ connect(importMapper, TQT_SIGNAL(mapped(int)),
+ TQT_TQOBJECT(this), TQT_SLOT(slotFileImport(int)));
KActionMenu* importMenu = new KActionMenu(actionCollection(), "file_import");
importMenu->setText(i18n("&Import"));
- importMenu->setIconSet(BarIconSet(QString::fromLatin1("fileimport")));
+ importMenu->setIconSet(BarIconSet(TQString::tqfromLatin1("fileimport")));
importMenu->setToolTip(i18n("Import collection data from other formats"));
importMenu->setDelayed(false);
action = new KAction(actionCollection(), "file_import_tellico");
action->setText(i18n("Import Tellico Data..."));
action->setToolTip(i18n("Import another Tellico data file"));
- action->setIcon(QString::fromLatin1("tellico"));
+ action->setIcon(TQString::tqfromLatin1("tellico"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::TellicoXML);
action = new KAction(actionCollection(), "file_import_csv");
@@ -337,7 +337,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import a CSV file"));
action->setIcon(MIME_ICON("text/x-csv"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::CSV);
action = new KAction(actionCollection(), "file_import_mods");
@@ -345,15 +345,15 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import a MODS data file"));
action->setIcon(MIME_ICON("text/xml"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::MODS);
action = new KAction(actionCollection(), "file_import_alexandria");
action->setText(i18n("Import Alexandria Data..."));
action->setToolTip(i18n("Import data from the Alexandria book collection manager"));
- action->setIcon(QString::fromLatin1("alexandria"));
+ action->setIcon(TQString::tqfromLatin1("alexandria"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::Alexandria);
action = new KAction(actionCollection(), "file_import_delicious");
@@ -361,15 +361,15 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import data from Delicious Library"));
action->setIcon(MIME_ICON("text/xml"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::Delicious);
action = new KAction(actionCollection(), "file_import_referencer");
action->setText(i18n("Import Referencer Data..."));
action->setToolTip(i18n("Import data from Referencer"));
- action->setIcon(QString::fromLatin1("referencer"));
+ action->setIcon(TQString::tqfromLatin1("referencer"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::Referencer);
action = new KAction(actionCollection(), "file_import_bibtex");
@@ -377,7 +377,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import a bibtex bibliography file"));
action->setIcon(MIME_ICON("text/x-bibtex"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::Bibtex);
action = new KAction(actionCollection(), "file_import_bibtexml");
@@ -385,7 +385,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import a Bibtexml bibliography file"));
action->setIcon(MIME_ICON("text/xml"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::Bibtexml);
action = new KAction(actionCollection(), "file_import_ris");
@@ -393,7 +393,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import an RIS reference file"));
action->setIcon(MIME_ICON("application/x-research-info-systems"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::RIS);
action = new KAction(actionCollection(), "file_import_pdf");
@@ -401,7 +401,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import a PDF file"));
action->setIcon(MIME_ICON("application/pdf"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::PDF);
action = new KAction(actionCollection(), "file_import_audiofile");
@@ -409,7 +409,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import meta-data from audio files"));
action->setIcon(MIME_ICON("audio/x-mp3"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::AudioFile);
#ifndef HAVE_TAGLIB
action->setEnabled(false);
@@ -420,7 +420,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import audio CD information"));
action->setIcon(MIME_ICON("media/audiocd"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::FreeDB);
#ifndef HAVE_KCDDB
action->setEnabled(false);
@@ -429,17 +429,17 @@ void MainWindow::initActions() {
action = new KAction(actionCollection(), "file_import_gcfilms");
action->setText(i18n("Import GCstar Data..."));
action->setToolTip(i18n("Import a GCstar data file"));
- action->setIcon(QString::fromLatin1("gcstar"));
+ action->setIcon(TQString::tqfromLatin1("gcstar"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::GCfilms);
action = new KAction(actionCollection(), "file_import_griffith");
action->setText(i18n("Import Griffith Data..."));
action->setToolTip(i18n("Import a Griffith database"));
- action->setIcon(QString::fromLatin1("griffith"));
+ action->setIcon(TQString::tqfromLatin1("griffith"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::Griffith);
action = new KAction(actionCollection(), "file_import_amc");
@@ -447,7 +447,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import an Ant Movie Catalog data file"));
action->setIcon(MIME_ICON("application/x-crossover-amc"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::AMC);
action = new KAction(actionCollection(), "file_import_filelisting");
@@ -455,7 +455,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import information about files in a folder"));
action->setIcon(MIME_ICON("inode/directory"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::FileListing);
action = new KAction(actionCollection(), "file_import_xslt");
@@ -463,35 +463,35 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Import using an XSL Transform"));
action->setIcon(MIME_ICON("text/x-xslt"));
importMenu->insert(action);
- connect(action, SIGNAL(activated()), importMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), importMapper, TQT_SLOT(map()));
importMapper->setMapping(action, Import::XSLT);
/**************** Export Menu ***************************/
- QSignalMapper* exportMapper = new QSignalMapper(this);
- connect(exportMapper, SIGNAL(mapped(int)),
- this, SLOT(slotFileExport(int)));
+ TQSignalMapper* exportMapper = new TQSignalMapper(TQT_TQOBJECT(this));
+ connect(exportMapper, TQT_SIGNAL(mapped(int)),
+ TQT_TQOBJECT(this), TQT_SLOT(slotFileExport(int)));
KActionMenu* exportMenu = new KActionMenu(actionCollection(), "file_export");
exportMenu->setText(i18n("&Export"));
- exportMenu->setIconSet(BarIconSet(QString::fromLatin1("fileexport")));
+ exportMenu->setIconSet(BarIconSet(TQString::tqfromLatin1("fileexport")));
exportMenu->setToolTip(i18n("Export the collection data to other formats"));
exportMenu->setDelayed(false);
action = new KAction(actionCollection(), "file_export_xml");
action->setText(i18n("Export to XML..."));
action->setToolTip(i18n("Export to a Tellico XML file"));
- action->setIcon(QString::fromLatin1("tellico"));
+ action->setIcon(TQString::tqfromLatin1("tellico"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::TellicoXML);
action = new KAction(actionCollection(), "file_export_zip");
action->setText(i18n("Export to Zip..."));
action->setToolTip(i18n("Export to a Tellico Zip file"));
- action->setIcon(QString::fromLatin1("tellico"));
+ action->setIcon(TQString::tqfromLatin1("tellico"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::TellicoZip);
action = new KAction(actionCollection(), "file_export_html");
@@ -499,7 +499,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Export to an HTML file"));
action->setIcon(MIME_ICON("text/html"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::HTML);
action = new KAction(actionCollection(), "file_export_csv");
@@ -507,7 +507,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Export to a comma-separated values file"));
action->setIcon(MIME_ICON("text/x-csv"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::CSV);
action = new KAction(actionCollection(), "file_export_pilotdb");
@@ -515,15 +515,15 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Export to a PilotDB database"));
action->setIcon(MIME_ICON("application/vnd.palm"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::PilotDB);
action = new KAction(actionCollection(), "file_export_alexandria");
action->setText(i18n("Export to Alexandria..."));
action->setToolTip(i18n("Export to an Alexandria library"));
- action->setIcon(QString::fromLatin1("alexandria"));
+ action->setIcon(TQString::tqfromLatin1("alexandria"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::Alexandria);
action = new KAction(actionCollection(), "file_export_bibtex");
@@ -531,7 +531,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Export to a bibtex file"));
action->setIcon(MIME_ICON("text/x-bibtex"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::Bibtex);
action = new KAction(actionCollection(), "file_export_bibtexml");
@@ -539,7 +539,7 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Export to a Bibtexml file"));
action->setIcon(MIME_ICON("text/xml"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::Bibtexml);
action = new KAction(actionCollection(), "file_export_onix");
@@ -547,20 +547,20 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Export to an ONIX file"));
action->setIcon(MIME_ICON("text/xml"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::ONIX);
action = new KAction(actionCollection(), "file_export_gcfilms");
action->setText(i18n("Export to GCfilms..."));
action->setToolTip(i18n("Export to a GCfilms data file"));
- action->setIcon(QString::fromLatin1("gcstar"));
+ action->setIcon(TQString::tqfromLatin1("gcstar"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::GCfilms);
#if 0
- QString dummy1 = i18n("Export to GCstar...");
- QString dummy2 = i18n("Export to a GCstar data file");
+ TQString dummy1 = i18n("Export to GCstar...");
+ TQString dummy2 = i18n("Export to a GCstar data file");
#endif
action = new KAction(actionCollection(), "file_export_xslt");
@@ -568,178 +568,178 @@ void MainWindow::initActions() {
action->setToolTip(i18n("Export using an XSL Transform"));
action->setIcon(MIME_ICON("text/x-xslt"));
exportMenu->insert(action);
- connect(action, SIGNAL(activated()), exportMapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), exportMapper, TQT_SLOT(map()));
exportMapper->setMapping(action, Export::XSLT);
/*************************************************
* Edit menu
*************************************************/
- action = KStdAction::cut(this, SLOT(slotEditCut()), actionCollection());
+ action = KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(slotEditCut()), actionCollection());
action->setToolTip(i18n("Cut the selected text and puts it in the clipboard"));
- action = KStdAction::copy(this, SLOT(slotEditCopy()), actionCollection());
+ action = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(slotEditCopy()), actionCollection());
action->setToolTip(i18n("Copy the selected text to the clipboard"));
- action = KStdAction::paste(this, SLOT(slotEditPaste()), actionCollection());
+ action = KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(slotEditPaste()), actionCollection());
action->setToolTip(i18n("Paste the clipboard contents"));
- action = KStdAction::selectAll(this, SLOT(slotEditSelectAll()), actionCollection());
+ action = KStdAction::selectAll(TQT_TQOBJECT(this), TQT_SLOT(slotEditSelectAll()), actionCollection());
action->setToolTip(i18n("Select all the entries in the collection"));
- action = KStdAction::deselect(this, SLOT(slotEditDeselect()), actionCollection());
+ action = KStdAction::deselect(TQT_TQOBJECT(this), TQT_SLOT(slotEditDeselect()), actionCollection());
action->setToolTip(i18n("Deselect all the entries in the collection"));
- action = new KAction(i18n("Internet Search..."), QString::fromLatin1("wizard"), CTRL + Key_M,
- this, SLOT(slotShowFetchDialog()),
+ action = new KAction(i18n("Internet Search..."), TQString::tqfromLatin1("wizard"), CTRL + Key_M,
+ TQT_TQOBJECT(this), TQT_SLOT(slotShowFetchDialog()),
actionCollection(), "edit_search_internet");
action->setToolTip(i18n("Search the internet..."));
- action = new KAction(i18n("Advanced &Filter..."), QString::fromLatin1("filter"), CTRL + Key_J,
- this, SLOT(slotShowFilterDialog()),
+ action = new KAction(i18n("Advanced &Filter..."), TQString::tqfromLatin1("filter"), CTRL + Key_J,
+ TQT_TQOBJECT(this), TQT_SLOT(slotShowFilterDialog()),
actionCollection(), "filter_dialog");
action->setToolTip(i18n("Filter the collection"));
/*************************************************
* Collection menu
*************************************************/
- m_newEntry = new KAction(i18n("&New Entry..."), QString::fromLatin1("filenew"), CTRL + Key_N,
- this, SLOT(slotNewEntry()),
+ m_newEntry = new KAction(i18n("&New Entry..."), TQString::tqfromLatin1("filenew"), CTRL + Key_N,
+ TQT_TQOBJECT(this), TQT_SLOT(slotNewEntry()),
actionCollection(), "coll_new_entry");
m_newEntry->setToolTip(i18n("Create a new entry"));
- m_editEntry = new KAction(i18n("&Edit Entry..."), QString::fromLatin1("edit"), CTRL + Key_E,
- this, SLOT(slotShowEntryEditor()),
+ m_editEntry = new KAction(i18n("&Edit Entry..."), TQString::tqfromLatin1("edit"), CTRL + Key_E,
+ TQT_TQOBJECT(this), TQT_SLOT(slotShowEntryEditor()),
actionCollection(), "coll_edit_entry");
m_editEntry->setToolTip(i18n("Edit the selected entries"));
- m_copyEntry = new KAction(i18n("D&uplicate Entry"), QString::fromLatin1("editcopy"), CTRL + Key_Y,
- Controller::self(), SLOT(slotCopySelectedEntries()),
+ m_copyEntry = new KAction(i18n("D&uplicate Entry"), TQString::tqfromLatin1("editcopy"), CTRL + Key_Y,
+ Controller::self(), TQT_SLOT(slotCopySelectedEntries()),
actionCollection(), "coll_copy_entry");
m_copyEntry->setToolTip(i18n("Copy the selected entries"));
- m_deleteEntry = new KAction(i18n("&Delete Entry"), QString::fromLatin1("editdelete"), CTRL + Key_D,
- Controller::self(), SLOT(slotDeleteSelectedEntries()),
+ m_deleteEntry = new KAction(i18n("&Delete Entry"), TQString::tqfromLatin1("editdelete"), CTRL + Key_D,
+ Controller::self(), TQT_SLOT(slotDeleteSelectedEntries()),
actionCollection(), "coll_delete_entry");
m_deleteEntry->setToolTip(i18n("Delete the selected entries"));
- m_mergeEntry = new KAction(i18n("&Merge Entries"), QString::fromLatin1("editcopy"), CTRL + Key_G,
- Controller::self(), SLOT(slotMergeSelectedEntries()),
+ m_mergeEntry = new KAction(i18n("&Merge Entries"), TQString::tqfromLatin1("editcopy"), CTRL + Key_G,
+ Controller::self(), TQT_SLOT(slotMergeSelectedEntries()),
actionCollection(), "coll_merge_entry");
m_mergeEntry->setToolTip(i18n("Merge the selected entries"));
m_mergeEntry->setEnabled(false); // gets enabled when more than 1 entry is selected
- action = new KAction(i18n("&Generate Reports..."), QString::fromLatin1("document"), 0, this,
- SLOT(slotShowReportDialog()),
+ action = new KAction(i18n("&Generate Reports..."), TQString::tqfromLatin1("document"), 0, TQT_TQOBJECT(this),
+ TQT_SLOT(slotShowReportDialog()),
actionCollection(), "coll_reports");
action->setToolTip(i18n("Generate collection reports"));
- m_checkOutEntry = new KAction(i18n("Check-&out..."), QString::fromLatin1("2uparrow"), 0,
- Controller::self(), SLOT(slotCheckOut()),
+ m_checkOutEntry = new KAction(i18n("Check-&out..."), TQString::tqfromLatin1("2uparrow"), 0,
+ Controller::self(), TQT_SLOT(slotCheckOut()),
actionCollection(), "coll_checkout");
m_checkOutEntry->setToolTip(i18n("Check-out the selected items"));
- m_checkInEntry = new KAction(i18n("Check-&in"), QString::fromLatin1("2downarrow"), 0,
- Controller::self(), SLOT(slotCheckIn()),
+ m_checkInEntry = new KAction(i18n("Check-&in"), TQString::tqfromLatin1("2downarrow"), 0,
+ Controller::self(), TQT_SLOT(slotCheckIn()),
actionCollection(), "coll_checkin");
m_checkInEntry->setToolTip(i18n("Check-in the selected items"));
- action = new KAction(i18n("&Rename Collection..."), QString::fromLatin1("editclear"), CTRL + Key_R,
- this, SLOT(slotRenameCollection()),
+ action = new KAction(i18n("&Rename Collection..."), TQString::tqfromLatin1("editclear"), CTRL + Key_R,
+ TQT_TQOBJECT(this), TQT_SLOT(slotRenameCollection()),
actionCollection(), "coll_rename_collection");
action->setToolTip(i18n("Rename the collection"));
- action = new KAction(i18n("Collection &Fields..."), QString::fromLatin1("edit"), CTRL + Key_U,
- this, SLOT(slotShowCollectionFieldsDialog()),
+ action = new KAction(i18n("Collection &Fields..."), TQString::tqfromLatin1("edit"), CTRL + Key_U,
+ TQT_TQOBJECT(this), TQT_SLOT(slotShowCollectionFieldsDialog()),
actionCollection(), "coll_fields");
action->setToolTip(i18n("Modify the collection fields"));
action = new KAction(i18n("Convert to &Bibliography"), 0,
- this, SLOT(slotConvertToBibliography()),
+ TQT_TQOBJECT(this), TQT_SLOT(slotConvertToBibliography()),
actionCollection(), "coll_convert_bibliography");
action->setToolTip(i18n("Convert a book collection to a bibliography"));
- action->setIconSet(UserIconSet(QString::fromLatin1("bibtex")));
- action = new KAction(i18n("String &Macros..."), QString::fromLatin1("view_text"), 0,
- this, SLOT(slotShowStringMacroDialog()),
+ action->setIconSet(UserIconSet(TQString::tqfromLatin1("bibtex")));
+ action = new KAction(i18n("String &Macros..."), TQString::tqfromLatin1("view_text"), 0,
+ TQT_TQOBJECT(this), TQT_SLOT(slotShowStringMacroDialog()),
actionCollection(), "coll_string_macros");
action->setToolTip(i18n("Edit the bibtex string macros"));
- QSignalMapper* citeMapper = new QSignalMapper(this);
- connect(citeMapper, SIGNAL(mapped(int)),
- this, SLOT(slotCiteEntry(int)));
+ TQSignalMapper* citeMapper = new TQSignalMapper(TQT_TQOBJECT(this));
+ connect(citeMapper, TQT_SIGNAL(mapped(int)),
+ TQT_TQOBJECT(this), TQT_SLOT(slotCiteEntry(int)));
action = new KAction(actionCollection(), "cite_clipboard");
action->setText(i18n("Copy Bibtex to Cli&pboard"));
action->setToolTip(i18n("Copy bibtex citations to the clipboard"));
- action->setIcon(QString::fromLatin1("editpaste"));
- connect(action, SIGNAL(activated()), citeMapper, SLOT(map()));
+ action->setIcon(TQString::tqfromLatin1("editpaste"));
+ connect(action, TQT_SIGNAL(activated()), citeMapper, TQT_SLOT(map()));
citeMapper->setMapping(action, Cite::CiteClipboard);
action = new KAction(actionCollection(), "cite_lyxpipe");
action->setText(i18n("Cite Entry in &LyX"));
action->setToolTip(i18n("Cite the selected entries in LyX"));
- action->setIcon(QString::fromLatin1("lyx"));
- connect(action, SIGNAL(activated()), citeMapper, SLOT(map()));
+ action->setIcon(TQString::tqfromLatin1("lyx"));
+ connect(action, TQT_SIGNAL(activated()), citeMapper, TQT_SLOT(map()));
citeMapper->setMapping(action, Cite::CiteLyxpipe);
action = new KAction(actionCollection(), "cite_openoffice");
action->setText(i18n("Ci&te Entry in OpenOffice.org"));
action->setToolTip(i18n("Cite the selected entries in OpenOffice.org"));
- action->setIcon(QString::fromLatin1("ooo-writer"));
- connect(action, SIGNAL(activated()), citeMapper, SLOT(map()));
+ action->setIcon(TQString::tqfromLatin1("ooo-writer"));
+ connect(action, TQT_SIGNAL(activated()), citeMapper, TQT_SLOT(map()));
citeMapper->setMapping(action, Cite::CiteOpenOffice);
- QSignalMapper* updateMapper = new QSignalMapper(this, "update_mapper");
- connect(updateMapper, SIGNAL(mapped(const QString&)),
- Controller::self(), SLOT(slotUpdateSelectedEntries(const QString&)));
+ TQSignalMapper* updateMapper = new TQSignalMapper(TQT_TQOBJECT(this), "update_mapper");
+ connect(updateMapper, TQT_SIGNAL(mapped(const TQString&)),
+ Controller::self(), TQT_SLOT(slotUpdateSelectedEntries(const TQString&)));
m_updateEntryMenu = new KActionMenu(i18n("&Update Entry"), actionCollection(), "coll_update_entry");
-// m_updateEntryMenu->setIconSet(BarIconSet(QString::fromLatin1("fileexport")));
+// m_updateEntryMenu->setIconSet(BarIconSet(TQString::tqfromLatin1("fileexport")));
m_updateEntryMenu->setDelayed(false);
m_updateAll = new KAction(actionCollection(), "update_entry_all");
m_updateAll->setText(i18n("All Sources"));
m_updateAll->setToolTip(i18n("Update entry data from all available sources"));
// m_updateEntryMenu->insert(action);
- connect(m_updateAll, SIGNAL(activated()), updateMapper, SLOT(map()));
- updateMapper->setMapping(m_updateAll, QString::fromLatin1("_all"));
+ connect(m_updateAll, TQT_SIGNAL(activated()), updateMapper, TQT_SLOT(map()));
+ updateMapper->setMapping(m_updateAll, TQString::tqfromLatin1("_all"));
/*************************************************
* Settings menu
*************************************************/
setStandardToolBarMenuEnabled(true);
createStandardStatusBarAction();
- KStdAction::configureToolbars(this, SLOT(slotConfigToolbar()), actionCollection());
- KStdAction::keyBindings(this, SLOT(slotConfigKeys()), actionCollection());
+ KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(slotConfigToolbar()), actionCollection());
+ KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(slotConfigKeys()), actionCollection());
m_toggleGroupWidget = new KToggleAction(i18n("Show Grou&p View"), 0,
- this, SLOT(slotToggleGroupWidget()),
+ TQT_TQOBJECT(this), TQT_SLOT(slotToggleGroupWidget()),
actionCollection(), "toggle_group_widget");
m_toggleGroupWidget->setToolTip(i18n("Enable/disable the group view"));
m_toggleGroupWidget->setCheckedState(i18n("Hide Grou&p View"));
m_toggleEntryEditor = new KToggleAction(i18n("Show Entry &Editor"), 0,
- this, SLOT(slotToggleEntryEditor()),
+ TQT_TQOBJECT(this), TQT_SLOT(slotToggleEntryEditor()),
actionCollection(), "toggle_edit_widget");
m_toggleEntryEditor->setToolTip(i18n("Enable/disable the editor"));
m_toggleEntryEditor->setCheckedState(i18n("Hide Entry &Editor"));
m_toggleEntryView = new KToggleAction(i18n("Show Entry &View"), 0,
- this, SLOT(slotToggleEntryView()),
+ TQT_TQOBJECT(this), TQT_SLOT(slotToggleEntryView()),
actionCollection(), "toggle_entry_view");
m_toggleEntryView->setToolTip(i18n("Enable/disable the entry view"));
m_toggleEntryView->setCheckedState(i18n("Hide Entry &View"));
- KStdAction::preferences(this, SLOT(slotShowConfigDialog()), actionCollection());
+ KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotShowConfigDialog()), actionCollection());
/*************************************************
* Help menu
*************************************************/
- KStdAction::tipOfDay(this, SLOT(slotShowTipOfDay()), actionCollection(), "tipOfDay");
+ KStdAction::tipOfDay(TQT_TQOBJECT(this), TQT_SLOT(slotShowTipOfDay()), actionCollection(), "tipOfDay");
/*************************************************
* Collection Toolbar
*************************************************/
(void) new KAction(i18n("Change Grouping"), CTRL + Key_G,
- this, SLOT(slotGroupLabelActivated()),
+ TQT_TQOBJECT(this), TQT_SLOT(slotGroupLabelActivated()),
actionCollection(), "change_entry_grouping_accel");
- m_entryGrouping = new KSelectAction(i18n("&Group Selection"), 0, this,
- SLOT(slotChangeGrouping()),
+ m_entryGrouping = new KSelectAction(i18n("&Group Selection"), 0, TQT_TQOBJECT(this),
+ TQT_SLOT(slotChangeGrouping()),
actionCollection(), "change_entry_grouping");
m_entryGrouping->setToolTip(i18n("Change the grouping of the collection"));
(void) new KAction(i18n("Filter"), CTRL + Key_F,
- this, SLOT(slotFilterLabelActivated()),
+ TQT_TQOBJECT(this), TQT_SLOT(slotFilterLabelActivated()),
actionCollection(), "quick_filter_accel");
- (void) new KAction(i18n("Clear Filter"), QString::fromLatin1("locationbar_erase"), 0,
- this, SLOT(slotClearFilter()),
+ (void) new KAction(i18n("Clear Filter"), TQString::tqfromLatin1("locationbar_erase"), 0,
+ TQT_TQOBJECT(this), TQT_SLOT(slotClearFilter()),
actionCollection(), "quick_filter_clear");
m_quickFilter = new GUI::LineEdit();
@@ -747,8 +747,8 @@ void MainWindow::initActions() {
// about 10 characters wide
m_quickFilter->setFixedWidth(m_quickFilter->fontMetrics().maxWidth()*10);
// want to update every time the filter text changes
- connect(m_quickFilter, SIGNAL(textChanged(const QString&)),
- this, SLOT(slotQueueFilter()));
+ connect(m_quickFilter, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_TQOBJECT(this), TQT_SLOT(slotQueueFilter()));
KWidgetAction* wAction = new KWidgetAction(m_quickFilter, i18n("Filter"), 0, 0, 0,
actionCollection(), "quick_filter");
@@ -758,16 +758,16 @@ void MainWindow::initActions() {
// show tool tips in status bar
actionCollection()->setHighlightingEnabled(true);
- connect(actionCollection(), SIGNAL(actionStatusText(const QString &)),
- SLOT(slotStatusMsg(const QString &)));
- connect(actionCollection(), SIGNAL(clearStatusText()),
- SLOT(slotClearStatus()));
+ connect(actionCollection(), TQT_SIGNAL(actionStatusText(const TQString &)),
+ TQT_SLOT(slotStatusMsg(const TQString &)));
+ connect(actionCollection(), TQT_SIGNAL(clearStatusText()),
+ TQT_SLOT(slotCleartqStatus()));
#ifdef UIFILE
kdWarning() << "MainWindow::initActions() - change createGUI() call!" << endl;
createGUI(UIFILE, false);
#else
- createGUI(QString::null, false);
+ createGUI(TQString(), false);
#endif
}
@@ -779,57 +779,57 @@ void MainWindow::initDocument() {
doc->setLoadAllImages(config.readBoolEntry("Load All Images", false));
// allow status messages from the document
- connect(doc, SIGNAL(signalStatusMsg(const QString&)),
- SLOT(slotStatusMsg(const QString&)));
+ connect(doc, TQT_SIGNAL(signalStatusMsg(const TQString&)),
+ TQT_SLOT(slotStatusMsg(const TQString&)));
// do stuff that changes when the doc is modified
- connect(doc, SIGNAL(signalModified(bool)),
- SLOT(slotEnableModifiedActions(bool)));
+ connect(doc, TQT_SIGNAL(signalModified(bool)),
+ TQT_SLOT(slotEnableModifiedActions(bool)));
- connect(Kernel::self()->commandHistory(), SIGNAL(commandExecuted()),
- doc, SLOT(slotSetModified()));
- connect(Kernel::self()->commandHistory(), SIGNAL(documentRestored()),
- doc, SLOT(slotDocumentRestored()));
+ connect(Kernel::self()->commandHistory(), TQT_SIGNAL(commandExecuted()),
+ doc, TQT_SLOT(slotSetModified()));
+ connect(Kernel::self()->commandHistory(), TQT_SIGNAL(documentRestored()),
+ doc, TQT_SLOT(slotDocumentRestored()));
}
void MainWindow::initView() {
MARK;
- m_split = new QSplitter(Qt::Horizontal, this);
+ m_split = new TQSplitter(Qt::Horizontal, this);
setCentralWidget(m_split);
m_viewTabs = new GUI::TabControl(m_split);
m_viewTabs->setTabBarHidden(true);
m_groupView = new GroupView(m_viewTabs, "groupview");
Controller::self()->addObserver(m_groupView);
- m_viewTabs->addTab(m_groupView, SmallIcon(QString::fromLatin1("folder")), i18n("Groups"));
- QWhatsThis::add(m_groupView, i18n("<qt>The <i>Group View</i> sorts the entries into groupings "
+ m_viewTabs->addTab(m_groupView, SmallIcon(TQString::tqfromLatin1("folder")), i18n("Groups"));
+ TQWhatsThis::add(m_groupView, i18n("<qt>The <i>Group View</i> sorts the entries into groupings "
"based on a selected field.</qt>"));
- m_rightSplit = new QSplitter(Qt::Vertical, m_split);
+ m_rightSplit = new TQSplitter(Qt::Vertical, m_split);
m_detailedView = new DetailedListView(m_rightSplit, "detailedlistview");
Controller::self()->addObserver(m_detailedView);
- QWhatsThis::add(m_detailedView, i18n("<qt>The <i>Column View</i> shows the value of multiple fields "
+ TQWhatsThis::add(m_detailedView, i18n("<qt>The <i>Column View</i> shows the value of multiple fields "
"for each entry.</qt>"));
- connect(Data::Document::self(), SIGNAL(signalCollectionImagesLoaded(Tellico::Data::CollPtr)),
- m_detailedView, SLOT(slotRefreshImages()));
+ connect(Data::Document::self(), TQT_SIGNAL(signalCollectionImagesLoaded(Tellico::Data::CollPtr)),
+ m_detailedView, TQT_SLOT(slotRefreshImages()));
m_viewStack = new ViewStack(m_rightSplit, "viewstack");
Controller::self()->addObserver(m_viewStack->iconView());
- connect(m_viewStack->entryView(), SIGNAL(signalAction(const KURL&)),
- SLOT(slotURLAction(const KURL&)));
+ connect(m_viewStack->entryView(), TQT_SIGNAL(signalAction(const KURL&)),
+ TQT_SLOT(slotURLAction(const KURL&)));
setMinimumWidth(MAIN_WINDOW_MIN_WIDTH);
}
void MainWindow::initConnections() {
// have to toggle the menu item if the dialog gets closed
- connect(m_editDialog, SIGNAL(finished()),
- this, SLOT(slotEditDialogFinished()));
+ connect(m_editDialog, TQT_SIGNAL(finished()),
+ TQT_TQOBJECT(this), TQT_SLOT(slotEditDialogFinished()));
// let the group view call filters, too
- connect(m_groupView, SIGNAL(signalUpdateFilter(Tellico::FilterPtr)),
- Controller::self(), SLOT(slotUpdateFilter(Tellico::FilterPtr)));
+ connect(m_groupView, TQT_SIGNAL(signalUpdateFilter(Tellico::FilterPtr)),
+ Controller::self(), TQT_SLOT(slotUpdateFilter(Tellico::FilterPtr)));
}
void MainWindow::initFileOpen(bool nofile_) {
@@ -856,16 +856,16 @@ void MainWindow::initFileOpen(bool nofile_) {
slotEntryCount();
const int type = Kernel::self()->collectionType();
- QString welcomeFile = locate("appdata", QString::fromLatin1("welcome.html"));
- QString text = FileHandler::readTextFile(welcomeFile);
- text.replace(QString::fromLatin1("$FGCOLOR$"), Config::templateTextColor(type).name());
- text.replace(QString::fromLatin1("$BGCOLOR$"), Config::templateBaseColor(type).name());
- text.replace(QString::fromLatin1("$COLOR1$"), Config::templateHighlightedTextColor(type).name());
- text.replace(QString::fromLatin1("$COLOR2$"), Config::templateHighlightedBaseColor(type).name());
- text.replace(QString::fromLatin1("$IMGDIR$"), QFile::encodeName(ImageFactory::tempDir()));
- text.replace(QString::fromLatin1("$BANNER$"),
+ TQString welcomeFile = locate("appdata", TQString::tqfromLatin1("welcome.html"));
+ TQString text = FileHandler::readTextFile(welcomeFile);
+ text.tqreplace(TQString::tqfromLatin1("$FGCOLOR$"), Config::templateTextColor(type).name());
+ text.tqreplace(TQString::tqfromLatin1("$BGCOLOR$"), Config::templateBaseColor(type).name());
+ text.tqreplace(TQString::tqfromLatin1("$COLOR1$"), Config::templateHighlightedTextColor(type).name());
+ text.tqreplace(TQString::tqfromLatin1("$COLOR2$"), Config::templateHighlightedBaseColor(type).name());
+ text.tqreplace(TQString::tqfromLatin1("$IMGDIR$"), TQFile::encodeName(ImageFactory::tempDir()));
+ text.tqreplace(TQString::tqfromLatin1("$BANNER$"),
i18n("Welcome to the Tellico Collection Manager"));
- text.replace(QString::fromLatin1("$WELCOMETEXT$"),
+ text.tqreplace(TQString::tqfromLatin1("$WELCOMETEXT$"),
i18n("<h3>Tellico is a tool for managing collections of books, "
"videos, music, and whatever else you want to catalog.</h3>"
"<h3>New entries can be added to your collection by "
@@ -883,13 +883,13 @@ void MainWindow::initFileOpen(bool nofile_) {
void MainWindow::saveOptions() {
// myDebug() << "MainWindow::saveOptions()" << endl;
- saveMainWindowSettings(KGlobal::config(), QString::fromLatin1("Main Window Options"));
+ saveMainWindowSettings(KGlobal::config(), TQString::tqfromLatin1("Main Window Options"));
Config::setShowGroupWidget(m_toggleGroupWidget->isChecked());
Config::setShowEditWidget(m_toggleEntryEditor->isChecked());
Config::setShowEntryView(m_toggleEntryView->isChecked());
- m_fileOpenRecent->saveEntries(KGlobal::config(), QString::fromLatin1("Recent Files"));
+ m_fileOpenRecent->saveEntries(KGlobal::config(), TQString::tqfromLatin1("Recent Files"));
if(!isNewDocument()) {
Config::setLastOpenFile(Data::Document::self()->URL().url());
}
@@ -916,25 +916,25 @@ void MainWindow::saveOptions() {
}
// this is used in the EntryEditDialog constructor, too
- m_editDialog->saveDialogSize(QString::fromLatin1("Edit Dialog Options"));
+ m_editDialog->saveDialogSize(TQString::tqfromLatin1("Edit Dialog Options"));
saveCollectionOptions(Data::Document::self()->collection());
Config::writeConfig();
}
void MainWindow::readCollectionOptions(Data::CollPtr coll_) {
- KConfigGroup group(KGlobal::config(), QString::fromLatin1("Options - %1").arg(coll_->typeName()));
+ KConfigGroup group(KGlobal::config(), TQString::tqfromLatin1("Options - %1").tqarg(coll_->typeName()));
- QString defaultGroup = coll_->defaultGroupField();
- QString entryGroup;
+ TQString defaultGroup = coll_->defaultGroupField();
+ TQString entryGroup;
if(coll_->type() != Data::Collection::Base) {
entryGroup = group.readEntry("Group By", defaultGroup);
} else {
KURL url = Kernel::self()->URL();
for(uint i = 0; i < Config::maxCustomURLSettings(); ++i) {
- KURL u = group.readEntry(QString::fromLatin1("URL_%1").arg(i));
+ KURL u = group.readEntry(TQString::tqfromLatin1("URL_%1").tqarg(i));
if(url == u) {
- entryGroup = group.readEntry(QString::fromLatin1("Group By_%1").arg(i), defaultGroup);
+ entryGroup = group.readEntry(TQString::tqfromLatin1("Group By_%1").tqarg(i), defaultGroup);
break;
}
}
@@ -943,16 +943,16 @@ void MainWindow::readCollectionOptions(Data::CollPtr coll_) {
entryGroup = group.readEntry("Group By", defaultGroup);
}
}
- if(entryGroup.isEmpty() || !coll_->entryGroups().contains(entryGroup)) {
+ if(entryGroup.isEmpty() || !coll_->entryGroups().tqcontains(entryGroup)) {
entryGroup = defaultGroup;
}
m_groupView->setGroupField(entryGroup);
- QString entryXSLTFile = Config::templateName(coll_->type());
+ TQString entryXSLTFile = Config::templateName(coll_->type());
if(entryXSLTFile.isEmpty()) {
- entryXSLTFile = QString::fromLatin1("Fancy"); // should never happen, but just in case
+ entryXSLTFile = TQString::tqfromLatin1("Fancy"); // should never happen, but just in case
}
- m_viewStack->entryView()->setXSLTFile(entryXSLTFile + QString::fromLatin1(".xsl"));
+ m_viewStack->entryView()->setXSLTFile(entryXSLTFile + TQString::tqfromLatin1(".xsl"));
// make sure the right combo element is selected
slotUpdateCollectionToolBar(coll_);
@@ -965,8 +965,8 @@ void MainWindow::saveCollectionOptions(Data::CollPtr coll_) {
}
int configIndex = -1;
- KConfigGroup config(KGlobal::config(), QString::fromLatin1("Options - %1").arg(coll_->typeName()));
- QString groupName;
+ KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("Options - %1").tqarg(coll_->typeName()));
+ TQString groupName;
if(m_entryGrouping->currentItem() > -1 &&
static_cast<int>(coll_->entryGroups().count()) > m_entryGrouping->currentItem()) {
groupName = Kernel::self()->fieldNameByTitle(m_entryGrouping->currentText());
@@ -978,11 +978,11 @@ void MainWindow::saveCollectionOptions(Data::CollPtr coll_) {
if(coll_->type() == Data::Collection::Base) {
// all of this is to have custom settings on a per file basis
KURL url = Kernel::self()->URL();
- QValueList<KURL> urls = QValueList<KURL>() << url;
- QStringList groupBys = QStringList() << groupName;
+ TQValueList<KURL> urls = TQValueList<KURL>() << url;
+ TQStringList groupBys = TQStringList() << groupName;
for(uint i = 0; i < Config::maxCustomURLSettings(); ++i) {
- KURL u = config.readEntry(QString::fromLatin1("URL_%1").arg(i));
- QString g = config.readEntry(QString::fromLatin1("Group By_%1").arg(i));
+ KURL u = config.readEntry(TQString::tqfromLatin1("URL_%1").tqarg(i));
+ TQString g = config.readEntry(TQString::tqfromLatin1("Group By_%1").tqarg(i));
if(!u.isEmpty() && url != u) {
urls.append(u);
groupBys.append(g);
@@ -990,10 +990,10 @@ void MainWindow::saveCollectionOptions(Data::CollPtr coll_) {
configIndex = i;
}
}
- uint limit = QMIN(urls.count(), Config::maxCustomURLSettings());
+ uint limit = TQMIN(urls.count(), Config::maxCustomURLSettings());
for(uint i = 0; i < limit; ++i) {
- config.writeEntry(QString::fromLatin1("URL_%1").arg(i), urls[i].url());
- config.writeEntry(QString::fromLatin1("Group By_%1").arg(i), groupBys[i]);
+ config.writeEntry(TQString::tqfromLatin1("URL_%1").tqarg(i), urls[i].url());
+ config.writeEntry(TQString::tqfromLatin1("Group By_%1").tqarg(i), groupBys[i]);
}
}
m_detailedView->saveConfig(coll_, configIndex);
@@ -1002,9 +1002,9 @@ void MainWindow::saveCollectionOptions(Data::CollPtr coll_) {
void MainWindow::readOptions() {
// myDebug() << "MainWindow::readOptions()" << endl;
- applyMainWindowSettings(KGlobal::config(), QString::fromLatin1("Main Window Options"));
+ applyMainWindowSettings(KGlobal::config(), TQString::tqfromLatin1("Main Window Options"));
- QValueList<int> splitList = Config::mainSplitterSizes();
+ TQValueList<int> splitList = Config::mainSplitterSizes();
if(!splitList.empty()) {
m_split->setSizes(splitList);
}
@@ -1016,7 +1016,7 @@ void MainWindow::readOptions() {
m_viewStack->iconView()->setMaxAllowedIconWidth(Config::maxIconSize());
- connect(toolBar("collectionToolBar"), SIGNAL(modechange()), SLOT(slotUpdateToolbarIcons()));
+ connect(toolBar("collectionToolBar"), TQT_SIGNAL(modechange()), TQT_SLOT(slotUpdateToolbarIcons()));
m_toggleGroupWidget->setChecked(Config::showGroupWidget());
slotToggleGroupWidget();
@@ -1025,13 +1025,13 @@ void MainWindow::readOptions() {
slotToggleEntryView();
// initialize the recent file list
- m_fileOpenRecent->loadEntries(KGlobal::config(), QString::fromLatin1("Recent Files"));
+ m_fileOpenRecent->loadEntries(KGlobal::config(), TQString::tqfromLatin1("Recent Files"));
// sort by count if column = 1
int sortStyle = Config::groupViewSortColumn();
m_groupView->setSortStyle(static_cast<GUI::ListView::SortStyle>(sortStyle));
bool sortAscending = Config::groupViewSortAscending();
- m_groupView->setSortOrder(sortAscending ? Qt::Ascending : Qt::Descending);
+ m_groupView->setSortOrder(sortAscending ? TQt::Ascending : TQt::Descending);
m_detailedView->setPixmapSize(Config::maxPixmapWidth(), Config::maxPixmapHeight());
@@ -1039,7 +1039,7 @@ void MainWindow::readOptions() {
if(useBraces) {
BibtexHandler::s_quoteStyle = BibtexHandler::BRACES;
} else {
- BibtexHandler::s_quoteStyle = BibtexHandler::QUOTES;
+ BibtexHandler::s_quoteStyle = BibtexHandler::TQUOTES;
}
// Don't read any options for the edit dialog here, since it's not yet initialized.
@@ -1053,7 +1053,7 @@ void MainWindow::saveProperties(KConfig* cfg_) {
KURL url = Data::Document::self()->URL();
cfg_->writeEntry("filename", url.url());
cfg_->writeEntry("modified", Data::Document::self()->isModified());
- QString tempname = KURL::encode_string(kapp->tempSaveName(url.url()));
+ TQString tempname = KURL::encode_string(kapp->tempSaveName(url.url()));
KURL tempurl;
tempurl.setPath(tempname);
Data::Document::self()->saveDocument(tempurl);
@@ -1061,11 +1061,11 @@ void MainWindow::saveProperties(KConfig* cfg_) {
}
void MainWindow::readProperties(KConfig* cfg_) {
- QString filename = cfg_->readEntry(QString::fromLatin1("filename"));
- bool modified = cfg_->readBoolEntry(QString::fromLatin1("modified"), false);
+ TQString filename = cfg_->readEntry(TQString::tqfromLatin1("filename"));
+ bool modified = cfg_->readBoolEntry(TQString::tqfromLatin1("modified"), false);
if(modified) {
bool canRecover;
- QString tempname = kapp->checkRecoverFile(filename, canRecover);
+ TQString tempname = kapp->checkRecoverFile(filename, canRecover);
if(canRecover) {
KURL tempurl;
@@ -1073,7 +1073,7 @@ void MainWindow::readProperties(KConfig* cfg_) {
Data::Document::self()->openDocument(tempurl);
Data::Document::self()->slotSetModified(true);
updateCaption(true);
- QFile::remove(tempname);
+ TQFile::remove(tempname);
}
} else {
if(!filename.isEmpty()) {
@@ -1127,26 +1127,26 @@ void MainWindow::slotFileNew(int type_) {
ImageFactory::clean(false);
}
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
}
void MainWindow::slotFileOpen() {
slotStatusMsg(i18n("Opening file..."));
if(m_editDialog->queryModified() && Data::Document::self()->saveModified()) {
- QString filter = i18n("*.tc *.bc|Tellico Files (*.tc)");
- filter += QString::fromLatin1("\n");
+ TQString filter = i18n("*.tc *.bc|Tellico Files (*.tc)");
+ filter += TQString::tqfromLatin1("\n");
filter += i18n("*.xml|XML Files (*.xml)");
- filter += QString::fromLatin1("\n");
+ filter += TQString::tqfromLatin1("\n");
filter += i18n("*|All Files");
// keyword 'open'
- KURL url = KFileDialog::getOpenURL(QString::fromLatin1(":open"), filter,
+ KURL url = KFileDialog::getOpenURL(TQString::tqfromLatin1(":open"), filter,
this, i18n("Open File"));
if(!url.isEmpty() && url.isValid()) {
slotFileOpen(url);
}
}
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
}
void MainWindow::slotFileOpen(const KURL& url_) {
@@ -1164,7 +1164,7 @@ void MainWindow::slotFileOpen(const KURL& url_) {
}
}
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
}
void MainWindow::slotFileOpenRecent(const KURL& url_) {
@@ -1183,10 +1183,10 @@ void MainWindow::slotFileOpenRecent(const KURL& url_) {
m_fileOpenRecent->setCurrentItem(-1);
}
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
}
-void MainWindow::openFile(const QString& file_) {
+void MainWindow::openFile(const TQString& file_) {
KURL url = KURL::fromPathOrURL(file_);
if(!url.isEmpty() && url.isValid()) {
slotFileOpen(url);
@@ -1197,7 +1197,7 @@ bool MainWindow::openURL(const KURL& url_) {
// myDebug() << "MainWindow::openURL() - " << url_.prettyURL() << endl;
// try to open document
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
bool success = Data::Document::self()->openDocument(url_);
@@ -1259,7 +1259,7 @@ bool MainWindow::fileSave() {
if(Config::imageLocation() == Config::ImagesInFile &&
Config::askWriteImagesInFile() &&
Data::Document::self()->imageCount() > MAX_IMAGES_WARN_PERFORMANCE) {
- QString msg = i18n("<qt><p>You are saving a file with many images, which causes Tellico to "
+ TQString msg = i18n("<qt><p>You are saving a file with many images, which causes Tellico to "
"slow down significantly. Do you want to save the images separately in "
"Tellico's data directory to improve performance?</p><p>Your choice can "
"always be changed in the configuration dialog.</p></qt>");
@@ -1267,25 +1267,25 @@ bool MainWindow::fileSave() {
KGuiItem yes(i18n("Save Images Separately"));
KGuiItem no(i18n("Save Images in File"));
- int res = KMessageBox::warningYesNo(this, msg, QString::null /* caption */, yes, no);
+ int res = KMessageBox::warningYesNo(this, msg, TQString() /* caption */, yes, no);
if(res == KMessageBox::No) {
Config::setImageLocation(Config::ImagesInAppDir);
}
Config::setAskWriteImagesInFile(false);
}
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
if(Data::Document::self()->saveDocument(Data::Document::self()->URL())) {
m_newDocument = false;
updateCaption(false);
m_fileSave->setEnabled(false);
- m_detailedView->resetEntryStatus();
+ m_detailedView->resetEntrytqStatus();
} else {
ret = false;
}
}
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
return ret;
}
@@ -1300,38 +1300,38 @@ bool MainWindow::fileSaveAs() {
slotStatusMsg(i18n("Saving file with a new filename..."));
- QString filter = i18n("*.tc *.bc|Tellico Files (*.tc)");
- filter += QChar('\n');
+ TQString filter = i18n("*.tc *.bc|Tellico Files (*.tc)");
+ filter += TQChar('\n');
filter += i18n("*|All Files");
// keyword 'open'
- KFileDialog dlg(QString::fromLatin1(":open"), filter, this, "filedialog", true);
+ KFileDialog dlg(TQString::tqfromLatin1(":open"), filter, this, "filedialog", true);
dlg.setCaption(i18n("Save As"));
dlg.setOperationMode(KFileDialog::Saving);
int result = dlg.exec();
- if(result == QDialog::Rejected) {
- StatusBar::self()->clearStatus();
+ if(result == TQDialog::Rejected) {
+ StatusBar::self()->cleartqStatus();
return false;
}
bool ret = true;
KURL url = dlg.selectedURL();
if(!url.isEmpty() && url.isValid()) {
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
if(Data::Document::self()->saveDocument(url)) {
KRecentDocument::add(url);
m_fileOpenRecent->addURL(url);
updateCaption(false);
m_newDocument = false;
m_fileSave->setEnabled(false);
- m_detailedView->resetEntryStatus();
+ m_detailedView->resetEntrytqStatus();
} else {
ret = false;
}
}
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
return ret;
}
@@ -1345,22 +1345,22 @@ void MainWindow::slotFilePrint() {
// If the collection is being filtered, warn the user
if(m_detailedView->filter() != 0) {
- QString str = i18n("The collection is currently being filtered to show a limited subset of "
+ TQString str = i18n("The collection is currently being filtered to show a limited subset of "
"the entries. Only the visible entries will be printed. Continue?");
- int ret = KMessageBox::warningContinueCancel(this, str, QString::null, KStdGuiItem::print(),
- QString::fromLatin1("WarnPrintVisible"));
+ int ret = KMessageBox::warningContinueCancel(this, str, TQString(), KStdGuiItem::print(),
+ TQString::tqfromLatin1("WarnPrintVisible"));
if(ret == KMessageBox::Cancel) {
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
return;
}
}
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
Export::HTMLExporter exporter(Data::Document::self()->collection());
// only print visible entries
exporter.setEntries(m_detailedView->visibleEntries());
- exporter.setXSLTFile(QString::fromLatin1("tellico-printing.xsl"));
+ exporter.setXSLTFile(TQString::tqfromLatin1("tellico-printing.xsl"));
exporter.setPrintHeaders(printHeaders);
exporter.setPrintGrouped(printGrouped);
exporter.setGroupBy(Controller::self()->expandedGroupBy());
@@ -1376,10 +1376,10 @@ void MainWindow::slotFilePrint() {
} else {
exporter.setOptions(Export::ExportUTF8);
}
- QString html = exporter.text();
+ TQString html = exporter.text();
if(html.isEmpty()) {
XSLTError();
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
return;
}
@@ -1389,7 +1389,7 @@ void MainWindow::slotFilePrint() {
slotStatusMsg(i18n("Printing..."));
doPrint(html);
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
}
void MainWindow::slotFileQuit() {
@@ -1399,34 +1399,34 @@ void MainWindow::slotFileQuit() {
//saveOptions();
close();
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
}
void MainWindow::slotEditCut() {
- activateEditSlot(SLOT(cut()));
+ activateEditSlot(TQT_SLOT(cut()));
}
void MainWindow::slotEditCopy() {
- activateEditSlot(SLOT(copy()));
+ activateEditSlot(TQT_SLOT(copy()));
}
void MainWindow::slotEditPaste() {
- activateEditSlot(SLOT(paste()));
+ activateEditSlot(TQT_SLOT(paste()));
}
void MainWindow::activateEditSlot(const char* slot_) {
// the edit widget is the only one that copies, cuts, and pastes
- QWidget* w;
+ TQWidget* w;
if(m_editDialog->isVisible()) {
- w = m_editDialog->focusWidget();
+ w = m_editDialog->tqfocusWidget();
} else {
- w = kapp->focusWidget();
+ w = kapp->tqfocusWidget();
}
if(w && w->isVisible()) {
- QMetaObject* meta = w->metaObject();
+ TQMetaObject* meta = w->tqmetaObject();
- int idx = meta->findSlot(slot_ + 1, true);
+ int idx = meta->tqfindSlot(slot_ + 1, true);
if(idx > -1) {
w->qt_invoke(idx, 0);
}
@@ -1442,22 +1442,22 @@ void MainWindow::slotEditDeselect() {
}
void MainWindow::slotConfigToolbar() {
- saveMainWindowSettings(KGlobal::config(), QString::fromLatin1("Main Window Options"));
+ saveMainWindowSettings(KGlobal::config(), TQString::tqfromLatin1("Main Window Options"));
#ifdef UIFILE
KEditToolbar dlg(actionCollection(), UIFILE);
#else
KEditToolbar dlg(actionCollection());
#endif
- connect(&dlg, SIGNAL(newToolbarConfig()), this, SLOT(slotNewToolbarConfig()));
+ connect(&dlg, TQT_SIGNAL(newToolbarConfig()), TQT_TQOBJECT(this), TQT_SLOT(slotNewToolbarConfig()));
dlg.exec();
}
void MainWindow::slotNewToolbarConfig() {
- applyMainWindowSettings(KGlobal::config(), QString::fromLatin1("Main Window Options"));
+ applyMainWindowSettings(KGlobal::config(), TQString::tqfromLatin1("Main Window Options"));
#ifdef UIFILE
createGUI(UIFILE, false);
#else
- createGUI(QString::null, false);
+ createGUI(TQString(), false);
#endif
}
@@ -1494,10 +1494,10 @@ void MainWindow::slotShowConfigDialog() {
m_configDlg = new ConfigDialog(this);
m_configDlg->show();
m_configDlg->readConfiguration();
- connect(m_configDlg, SIGNAL(signalConfigChanged()),
- SLOT(slotHandleConfigChange()));
- connect(m_configDlg, SIGNAL(finished()),
- SLOT(slotHideConfigDialog()));
+ connect(m_configDlg, TQT_SIGNAL(signalConfigChanged()),
+ TQT_SLOT(slotHandleConfigChange()));
+ connect(m_configDlg, TQT_SIGNAL(finished()),
+ TQT_SLOT(slotHideConfigDialog()));
} else {
KWin::activateWindow(m_configDlg->winId());
m_configDlg->show();
@@ -1512,16 +1512,16 @@ void MainWindow::slotHideConfigDialog() {
}
void MainWindow::slotShowTipOfDay(bool force_/*=true*/) {
- QString tipfile = locate("appdata", QString::fromLatin1("tellico.tips"));
+ TQString tipfile = locate("appdata", TQString::tqfromLatin1("tellico.tips"));
KTipDialog::showTip(this, tipfile, force_);
}
-void MainWindow::slotStatusMsg(const QString& text_) {
- m_statusBar->setStatus(text_);
+void MainWindow::slotStatusMsg(const TQString& text_) {
+ m_statusBar->settqStatus(text_);
}
-void MainWindow::slotClearStatus() {
- StatusBar::self()->clearStatus();
+void MainWindow::slotCleartqStatus() {
+ StatusBar::self()->cleartqStatus();
}
void MainWindow::slotEntryCount() {
@@ -1531,20 +1531,20 @@ void MainWindow::slotEntryCount() {
}
int count = coll->entryCount();
- QString text = i18n("Total entries: %1").arg(count);
+ TQString text = i18n("Total entries: %1").tqarg(count);
int selectCount = Controller::self()->selectedEntries().count();
int filterCount = m_detailedView->visibleItems();
// if more than one book is selected, add the number of selected books
if(filterCount < count && selectCount > 1) {
- text += QChar(' ');
- text += i18n("(%1 filtered; %2 selected)").arg(filterCount).arg(selectCount);
+ text += TQChar(' ');
+ text += i18n("(%1 filtered; %2 selected)").tqarg(filterCount).tqarg(selectCount);
} else if(filterCount < count) {
- text += QChar(' ');
- text += i18n("(%1 filtered)").arg(filterCount);
+ text += TQChar(' ');
+ text += i18n("(%1 filtered)").tqarg(filterCount);
} else if(selectCount > 1) {
- text += QChar(' ');
- text += i18n("(%1 selected)").arg(selectCount);
+ text += TQChar(' ');
+ text += i18n("(%1 selected)").tqarg(selectCount);
}
m_statusBar->setCount(text);
@@ -1573,10 +1573,10 @@ void MainWindow::slotHandleConfigChange() {
const int imageLocation = Config::imageLocation();
const bool autoCapitalize = Config::autoCapitalization();
const bool autoFormat = Config::autoFormat();
- QStringList articles = Config::articleList();
- QStringList nocaps = Config::noCapitalizationList();
- QStringList suffixes = Config::nameSuffixList();
- QStringList prefixes = Config::surnamePrefixList();
+ TQStringList articles = Config::articleList();
+ TQStringList nocaps = Config::noCapitalizationList();
+ TQStringList suffixes = Config::nameSuffixList();
+ TQStringList prefixes = Config::surnamePrefixList();
m_configDlg->saveConfiguration();
@@ -1591,14 +1591,14 @@ void MainWindow::slotHandleConfigChange() {
nocaps != Config::noCapitalizationList() ||
suffixes != Config::nameSuffixList() ||
prefixes != Config::surnamePrefixList()) {
- // invalidate all groups
- Data::Document::self()->collection()->invalidateGroups();
+ // tqinvalidate all groups
+ Data::Document::self()->collection()->tqinvalidateGroups();
// refreshing the title causes the group view to refresh
- Controller::self()->slotRefreshField(Data::Document::self()->collection()->fieldByName(QString::fromLatin1("title")));
+ Controller::self()->slotRefreshField(Data::Document::self()->collection()->fieldByName(TQString::tqfromLatin1("title")));
}
- QString entryXSLTFile = Config::templateName(Kernel::self()->collectionType());
- m_viewStack->entryView()->setXSLTFile(entryXSLTFile + QString::fromLatin1(".xsl"));
+ TQString entryXSLTFile = Config::templateName(Kernel::self()->collectionType());
+ m_viewStack->entryView()->setXSLTFile(entryXSLTFile + TQString::tqfromLatin1(".xsl"));
}
void MainWindow::slotUpdateCollectionToolBar(Data::CollPtr coll_) {
@@ -1609,34 +1609,34 @@ void MainWindow::slotUpdateCollectionToolBar(Data::CollPtr coll_) {
return;
}
- QString current = m_groupView->groupBy();
- if(current.isEmpty() || !coll_->entryGroups().contains(current)) {
+ TQString current = m_groupView->groupBy();
+ if(current.isEmpty() || !coll_->entryGroups().tqcontains(current)) {
current = coll_->defaultGroupField();
}
- const QStringList groups = coll_->entryGroups();
+ const TQStringList groups = coll_->entryGroups();
if(groups.isEmpty()) {
m_entryGrouping->clear();
return;
}
- QMap<QString, QString> groupMap; // use a map so they get sorted
- for(QStringList::ConstIterator groupIt = groups.begin(); groupIt != groups.end(); ++groupIt) {
+ TQMap<TQString, TQString> groupMap; // use a map so they get sorted
+ for(TQStringList::ConstIterator groupIt = groups.begin(); groupIt != groups.end(); ++groupIt) {
// special case for people "pseudo-group"
if(*groupIt == Data::Collection::s_peopleGroupName) {
- groupMap.insert(*groupIt, QString::fromLatin1("<") + i18n("People") + QString::fromLatin1(">"));
+ groupMap.insert(*groupIt, TQString::tqfromLatin1("<") + i18n("People") + TQString::tqfromLatin1(">"));
} else {
groupMap.insert(*groupIt, coll_->fieldTitleByName(*groupIt));
}
}
- QStringList names = groupMap.keys();
- int index = names.findIndex(current);
+ TQStringList names = groupMap.keys();
+ int index = names.tqfindIndex(current);
if(index == -1) {
current = names[0];
index = 0;
}
- QStringList titles = groupMap.values();
+ TQStringList titles = groupMap.values();
m_entryGrouping->setItems(titles);
m_entryGrouping->setCurrentItem(index);
// in case the current grouping field get modified to be non-grouping...
@@ -1649,8 +1649,8 @@ void MainWindow::slotUpdateCollectionToolBar(Data::CollPtr coll_) {
if(tb) {
KComboBox* cb = tb->getCombo(m_entryGrouping->itemId(i));
if(cb) {
- // qt caches the combobox size and never recalculates the sizeHint()
- // the source code recommends calling setFont to invalidate the sizeHint
+ // qt caches the combobox size and never recalculates the tqsizeHint()
+ // the source code recommends calling setFont to tqinvalidate the tqsizeHint
cb->setFont(cb->font());
cb->updateGeometry();
}
@@ -1660,11 +1660,11 @@ void MainWindow::slotUpdateCollectionToolBar(Data::CollPtr coll_) {
void MainWindow::slotChangeGrouping() {
// myDebug() << "MainWindow::slotChangeGrouping()" << endl;
- QString title = m_entryGrouping->currentText();
+ TQString title = m_entryGrouping->currentText();
- QString groupName = Kernel::self()->fieldNameByTitle(title);
+ TQString groupName = Kernel::self()->fieldNameByTitle(title);
if(groupName.isEmpty()) {
- if(title == QString::fromLatin1("<") + i18n("People") + QString::fromLatin1(">")) {
+ if(title == TQString::tqfromLatin1("<") + i18n("People") + TQString::tqfromLatin1(">")) {
groupName = Data::Collection::s_peopleGroupName;
} else {
groupName = Data::Document::self()->collection()->defaultGroupField();
@@ -1678,8 +1678,8 @@ void MainWindow::slotShowReportDialog() {
// myDebug() << "MainWindow::slotShowReport()" << endl;
if(!m_reportDlg) {
m_reportDlg = new ReportDialog(this);
- connect(m_reportDlg, SIGNAL(finished()),
- SLOT(slotHideReportDialog()));
+ connect(m_reportDlg, TQT_SIGNAL(finished()),
+ TQT_SLOT(slotHideReportDialog()));
} else {
KWin::activateWindow(m_reportDlg->winId());
}
@@ -1693,7 +1693,7 @@ void MainWindow::slotHideReportDialog() {
}
}
-void MainWindow::doPrint(const QString& html_) {
+void MainWindow::doPrint(const TQString& html_) {
KHTMLPart w ;
w.setJScriptEnabled(false);
w.setJavaEnabled(false);
@@ -1703,34 +1703,34 @@ void MainWindow::doPrint(const QString& html_) {
w.write(html_);
w.end();
-// the problem with doing my own layout is that the text gets truncated, both at the
+// the problem with doing my own tqlayout is that the text gets truncated, both at the
// top and at the bottom. Even adding the overlap parameter, there were problems.
// KHTMLView takes care of that with a truncatedAt() parameter, but that's hidden in
// the khtml::render_root class. So for now, just use the KHTMLView::print() method.
#if 1
w.view()->print();
#else
- KPrinter* printer = new KPrinter(QPrinter::PrinterResolution);
+ KPrinter* printer = new KPrinter(TQPrinter::PrinterResolution);
- if(printer->setup(this, i18n("Print %1").arg(Data::Document::self()->URL().prettyURL()))) {
+ if(printer->setup(this, i18n("Print %1").tqarg(Data::Document::self()->URL().prettyURL()))) {
printer->setFullPage(false);
- printer->setCreator(QString::fromLatin1("Tellico"));
+ printer->setCreator(TQString::tqfromLatin1("Tellico"));
printer->setDocName(Data::Document::self()->URL().prettyURL());
- QPainter *p = new QPainter;
+ TQPainter *p = new TQPainter;
p->begin(printer);
// mostly taken from KHTMLView::print()
- QString headerLeft = KGlobal::locale()->formatDate(QDate::currentDate(), false);
- QString headerRight = Data::Document::self()->URL().prettyURL();
- QString footerMid;
+ TQString headerLeft = KGlobal::locale()->formatDate(TQDate::tqcurrentDate(), false);
+ TQString headerRight = Data::Document::self()->URL().prettyURL();
+ TQString footerMid;
- QFont headerFont(QString::fromLatin1("helvetica"), 8);
+ TQFont headerFont(TQString::tqfromLatin1("helvetica"), 8);
p->setFont(headerFont);
const int lspace = p->fontMetrics().lineSpacing();
const int headerHeight = (lspace * 3) / 2;
- QPaintDeviceMetrics metrics(printer);
+ TQPaintDeviceMetrics metrics(printer);
const int pageHeight = metrics.height() - 2*headerHeight;
const int pageWidth = metrics.width();
@@ -1742,16 +1742,16 @@ void MainWindow::doPrint(const QString& html_) {
bool more = true;
while(more) {
- p->setPen(Qt::black);
+ p->setPen(TQt::black);
p->setFont(headerFont);
- footerMid = i18n("Page %1").arg(page);
+ footerMid = i18n("Page %1").tqarg(page);
- p->drawText(0, 0, pageWidth, lspace, Qt::AlignLeft, headerLeft);
- p->drawText(0, 0, pageWidth, lspace, Qt::AlignRight, headerRight);
- p->drawText(0, pageHeight+headerHeight, pageWidth, lspace, Qt::AlignHCenter, footerMid);
+ p->drawText(0, 0, pageWidth, lspace, TQt::AlignLeft, headerLeft);
+ p->drawText(0, 0, pageWidth, lspace, TQt::AlignRight, headerRight);
+ p->drawText(0, pageHeight+headerHeight, pageWidth, lspace, TQt::AlignHCenter, footerMid);
- w->paint(p, QRect(0, -top + 2*headerHeight, pageWidth, pageHeight+top), top, &more);
+ w->paint(p, TQRect(0, -top + 2*headerHeight, pageWidth, pageHeight+top), top, &more);
top += pageHeight - PRINTED_PAGE_OVERLAP;
@@ -1771,7 +1771,7 @@ void MainWindow::doPrint(const QString& html_) {
}
void MainWindow::XSLTError() {
- QString str = i18n("Tellico encountered an error in XSLT processing.") + QChar('\n');
+ TQString str = i18n("Tellico encountered an error in XSLT processing.") + TQChar('\n');
str += i18n("Please check your installation.");
Kernel::self()->sorry(str);
}
@@ -1781,14 +1781,14 @@ void MainWindow::slotShowFilterDialog() {
m_filterDlg = new FilterDialog(FilterDialog::CreateFilter, this); // allow saving
m_filterDlg->setFilter(m_detailedView->filter());
m_quickFilter->setEnabled(false);
- connect(m_filterDlg, SIGNAL(signalCollectionModified()),
- Data::Document::self(), SLOT(slotSetModified()));
- connect(m_filterDlg, SIGNAL(signalUpdateFilter(Tellico::FilterPtr)),
- m_quickFilter, SLOT(clear()));
- connect(m_filterDlg, SIGNAL(signalUpdateFilter(Tellico::FilterPtr)),
- Controller::self(), SLOT(slotUpdateFilter(Tellico::FilterPtr)));
- connect(m_filterDlg, SIGNAL(finished()),
- SLOT(slotHideFilterDialog()));
+ connect(m_filterDlg, TQT_SIGNAL(signalCollectionModified()),
+ Data::Document::self(), TQT_SLOT(slotSetModified()));
+ connect(m_filterDlg, TQT_SIGNAL(signalUpdateFilter(Tellico::FilterPtr)),
+ m_quickFilter, TQT_SLOT(clear()));
+ connect(m_filterDlg, TQT_SIGNAL(signalUpdateFilter(Tellico::FilterPtr)),
+ Controller::self(), TQT_SLOT(slotUpdateFilter(Tellico::FilterPtr)));
+ connect(m_filterDlg, TQT_SIGNAL(finished()),
+ TQT_SLOT(slotHideFilterDialog()));
} else {
KWin::activateWindow(m_filterDlg->winId());
}
@@ -1806,7 +1806,7 @@ void MainWindow::slotHideFilterDialog() {
void MainWindow::slotQueueFilter() {
m_queuedFilters++;
- QTimer::singleShot(200, this, SLOT(slotUpdateFilter()));
+ TQTimer::singleShot(200, TQT_TQOBJECT(this), TQT_SLOT(slotUpdateFilter()));
}
void MainWindow::slotUpdateFilter() {
@@ -1818,14 +1818,14 @@ void MainWindow::slotUpdateFilter() {
setFilter(m_quickFilter->text());
}
-void MainWindow::setFilter(const QString& text_) {
- QString text = text_.stripWhiteSpace();
+void MainWindow::setFilter(const TQString& text_) {
+ TQString text = text_.stripWhiteSpace();
Filter::Ptr filter = 0;
if(!text.isEmpty()) {
filter = new Filter(Filter::MatchAll);
- QString fieldName = QString::null;
- // if the text contains '=' assume it's a field name or title
- if(text.find('=') > -1) {
+ TQString fieldName = TQString();
+ // if the text tqcontains '=' assume it's a field name or title
+ if(text.tqfind('=') > -1) {
fieldName = text.section('=', 0, 0).stripWhiteSpace();
text = text.section('=', 1).stripWhiteSpace();
// check that the field name might be a title
@@ -1835,17 +1835,17 @@ void MainWindow::setFilter(const QString& text_) {
}
// if the text contains any non-word characters, assume it's a regexp
// but \W in qt is letter, number, or '_', I want to be a bit less strict
- QRegExp rx(QString::fromLatin1("[^\\w\\s-']"));
- if(text.find(rx) == -1) {
+ TQRegExp rx(TQString::tqfromLatin1("[^\\w\\s-']"));
+ if(text.tqfind(rx) == -1) {
// split by whitespace, and add rules for each word
- QStringList tokens = QStringList::split(QRegExp(QString::fromLatin1("\\s")), text);
- for(QStringList::Iterator it = tokens.begin(); it != tokens.end(); ++it) {
+ TQStringList tokens = TQStringList::split(TQRegExp(TQString::tqfromLatin1("\\s")), text);
+ for(TQStringList::Iterator it = tokens.begin(); it != tokens.end(); ++it) {
// an empty field string means check every field
filter->append(new FilterRule(fieldName, *it, FilterRule::FuncContains));
}
} else {
// if it isn't valid, hold off on applying the filter
- QRegExp tx(text);
+ TQRegExp tx(text);
if(!tx.isValid()) {
myDebug() << "MainWindow::slotUpdateFilter() - invalid regexp: " << text << endl;
return;
@@ -1866,8 +1866,8 @@ void MainWindow::setFilter(const QString& text_) {
void MainWindow::slotShowCollectionFieldsDialog() {
if(!m_collFieldsDlg) {
m_collFieldsDlg = new CollectionFieldsDialog(Data::Document::self()->collection(), this);
- connect(m_collFieldsDlg, SIGNAL(finished()),
- SLOT(slotHideCollectionFieldsDialog()));
+ connect(m_collFieldsDlg, TQT_SIGNAL(finished()),
+ TQT_SLOT(slotHideCollectionFieldsDialog()));
} else {
KWin::activateWindow(m_collFieldsDlg->winId());
}
@@ -1909,12 +1909,12 @@ void MainWindow::slotFileImport(int format_) {
if(checkURL) {
bool ok = !url.isEmpty() && url.isValid() && KIO::NetAccess::exists(url, true, this);
if(!ok) {
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
return;
}
}
importFile(format, url);
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
}
void MainWindow::slotFileExport(int format_) {
@@ -1923,8 +1923,8 @@ void MainWindow::slotFileExport(int format_) {
Export::Format format = static_cast<Export::Format>(format_);
ExportDialog dlg(format, Data::Document::self()->collection(), this, "exportdialog");
- if(dlg.exec() == QDialog::Rejected) {
- StatusBar::self()->clearStatus();
+ if(dlg.exec() == TQDialog::Rejected) {
+ StatusBar::self()->cleartqStatus();
return;
}
@@ -1939,25 +1939,25 @@ void MainWindow::slotFileExport(int format_) {
case Export::File:
{
- KFileDialog fileDlg(QString::fromLatin1(":export"), dlg.fileFilter(), this, "filedialog", true);
+ KFileDialog fileDlg(TQString::tqfromLatin1(":export"), dlg.fileFilter(), this, "filedialog", true);
fileDlg.setCaption(i18n("Export As"));
fileDlg.setOperationMode(KFileDialog::Saving);
- if(fileDlg.exec() == QDialog::Rejected) {
- StatusBar::self()->clearStatus();
+ if(fileDlg.exec() == TQDialog::Rejected) {
+ StatusBar::self()->cleartqStatus();
return;
}
KURL url = fileDlg.selectedURL();
if(!url.isEmpty() && url.isValid()) {
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
dlg.exportURL(url);
}
}
break;
}
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
}
void MainWindow::slotShowStringMacroDialog() {
@@ -1970,8 +1970,8 @@ void MainWindow::slotShowStringMacroDialog() {
m_stringMacroDlg = new StringMapDialog(c->macroList(), this, "StringMacroDialog", false);
m_stringMacroDlg->setCaption(i18n("String Macros"));
m_stringMacroDlg->setLabels(i18n("Macro"), i18n("String"));
- connect(m_stringMacroDlg, SIGNAL(finished()), SLOT(slotHideStringMacroDialog()));
- connect(m_stringMacroDlg, SIGNAL(okClicked()), SLOT(slotStringMacroDialogOk()));
+ connect(m_stringMacroDlg, TQT_SIGNAL(finished()), TQT_SLOT(slotHideStringMacroDialog()));
+ connect(m_stringMacroDlg, TQT_SIGNAL(okClicked()), TQT_SLOT(slotStringMacroDialogOk()));
} else {
KWin::activateWindow(m_stringMacroDlg->winId());
}
@@ -2032,16 +2032,16 @@ void MainWindow::slotConvertToBibliography() {
}
void MainWindow::slotCiteEntry(int action_) {
- StatusBar::self()->setStatus(i18n("Creating citations..."));
+ StatusBar::self()->settqStatus(i18n("Creating citations..."));
Cite::ActionManager::self()->cite(static_cast<Cite::CiteAction>(action_), Controller::self()->selectedEntries());
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
}
void MainWindow::slotShowFetchDialog() {
if(!m_fetchDlg) {
m_fetchDlg = new FetchDialog(this);
- connect(m_fetchDlg, SIGNAL(finished()), SLOT(slotHideFetchDialog()));
- connect(Controller::self(), SIGNAL(collectionAdded(int)), m_fetchDlg, SLOT(slotResetCollection()));
+ connect(m_fetchDlg, TQT_SIGNAL(finished()), TQT_SLOT(slotHideFetchDialog()));
+ connect(Controller::self(), TQT_SIGNAL(collectionAdded(int)), m_fetchDlg, TQT_SLOT(slotResetCollection()));
} else {
KWin::activateWindow(m_fetchDlg->winId());
}
@@ -2057,14 +2057,14 @@ void MainWindow::slotHideFetchDialog() {
bool MainWindow::importFile(Import::Format format_, const KURL& url_, Import::Action action_) {
// try to open document
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
bool failed = false;
Data::CollPtr coll;
if(!url_.isEmpty() && url_.isValid() && KIO::NetAccess::exists(url_, true, this)) {
coll = ImportDialog::importURL(format_, url_);
} else {
- Kernel::self()->sorry(i18n(errorLoad).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorLoad).tqarg(url_.fileName()));
failed = true;
}
@@ -2091,7 +2091,7 @@ bool MainWindow::importFile(Import::Format format_, const KURL& url_, Import::Ac
failed = !importCollection(coll, action_);
}
- StatusBar::self()->clearStatus();
+ StatusBar::self()->cleartqStatus();
return !failed; // return true means success
}
@@ -2137,14 +2137,14 @@ void MainWindow::addFilterView() {
m_filterView = new FilterView(m_viewTabs, "filterview");
Controller::self()->addObserver(m_filterView);
- m_viewTabs->insertTab(m_filterView, SmallIcon(QString::fromLatin1("filter")), i18n("Filters"), 1);
- QWhatsThis::add(m_filterView, i18n("<qt>The <i>Filter View</i> shows the entries which meet certain "
+ m_viewTabs->insertTab(m_filterView, SmallIcon(TQString::tqfromLatin1("filter")), i18n("Filters"), 1);
+ TQWhatsThis::add(m_filterView, i18n("<qt>The <i>Filter View</i> shows the entries which meet certain "
"filter rules.</qt>"));
int sortStyle = Config::filterViewSortColumn();
m_filterView->setSortStyle(static_cast<GUI::ListView::SortStyle>(sortStyle));
bool sortAscending = Config::filterViewSortAscending();
- m_filterView->setSortOrder(sortAscending ? Qt::Ascending : Qt::Descending);
+ m_filterView->setSortOrder(sortAscending ? TQt::Ascending : TQt::Descending);
}
void MainWindow::addLoanView() {
@@ -2154,24 +2154,24 @@ void MainWindow::addLoanView() {
m_loanView = new LoanView(m_viewTabs, "loanview");
Controller::self()->addObserver(m_loanView);
- m_viewTabs->insertTab(m_loanView, SmallIcon(QString::fromLatin1("kaddressbook")), i18n("Loans"), 2);
- QWhatsThis::add(m_loanView, i18n("<qt>The <i>Loan View</i> shows a list of all the people who "
+ m_viewTabs->insertTab(m_loanView, SmallIcon(TQString::tqfromLatin1("kaddressbook")), i18n("Loans"), 2);
+ TQWhatsThis::add(m_loanView, i18n("<qt>The <i>Loan View</i> shows a list of all the people who "
"have borrowed items from your collection.</qt>"));
int sortStyle = Config::loanViewSortColumn();
m_loanView->setSortStyle(static_cast<GUI::ListView::SortStyle>(sortStyle));
bool sortAscending = Config::loanViewSortAscending();
- m_loanView->setSortOrder(sortAscending ? Qt::Ascending : Qt::Descending);
+ m_loanView->setSortOrder(sortAscending ? TQt::Ascending : TQt::Descending);
}
void MainWindow::updateCaption(bool modified_) {
- QString caption;
+ TQString caption;
if(Data::Document::self()->collection()) {
caption = Data::Document::self()->collection()->title();
}
if(!m_newDocument) {
if(!caption.isEmpty()) {
- caption += QString::fromLatin1(" - ");
+ caption += TQString::tqfromLatin1(" - ");
}
KURL u = Data::Document::self()->URL();
if(u.isLocalFile()) {
@@ -2202,7 +2202,7 @@ void MainWindow::slotUpdateToolbarIcons() {
for(int i = 0; i < tb->count(); ++i) {
if(m_newEntry->isPlugged(tb, tb->idAt(i))) {
- QIconSet icons;
+ TQIconSet icons;
icons.installIconFactory(new EntryIconFactory(tb->iconSize()));
tb->setButtonIconSet(tb->idAt(i), icons);
break;
@@ -2247,17 +2247,17 @@ void MainWindow::updateCollectionActions() {
return;
}
- stateChanged(QString::fromLatin1("collection_reset"));
+ stateChanged(TQString::tqfromLatin1("collection_reset"));
Data::Collection::Type type = Data::Document::self()->collection()->type();
switch(type) {
case Data::Collection::Book:
- stateChanged(QString::fromLatin1("is_book"));
+ stateChanged(TQString::tqfromLatin1("is_book"));
break;
case Data::Collection::Bibtex:
- stateChanged(QString::fromLatin1("is_bibliography"));
+ stateChanged(TQString::tqfromLatin1("is_bibliography"));
break;
case Data::Collection::Video:
- stateChanged(QString::fromLatin1("is_video"));
+ stateChanged(TQString::tqfromLatin1("is_video"));
break;
default:
break;
@@ -2270,14 +2270,14 @@ void MainWindow::updateCollectionActions() {
}
void MainWindow::updateEntrySources() {
- QSignalMapper* mapper = ::qt_cast<QSignalMapper*>(child("update_mapper"));
+ TQSignalMapper* mapper = ::tqqt_cast<TQSignalMapper*>(child("update_mapper"));
if(!mapper) {
kdWarning() << "MainWindow::updateEntrySources() - no update mapper!" << endl;
return;
}
- unplugActionList(QString::fromLatin1("update_entry_actions"));
- for(QPtrListIterator<KAction> it(m_fetchActions); it.current(); ++it) {
+ unplugActionList(TQString::tqfromLatin1("update_entry_actions"));
+ for(TQPtrListIterator<KAction> it(m_fetchActions); it.current(); ++it) {
it.current()->unplugAll();
mapper->removeMappings(it.current());
}
@@ -2288,14 +2288,14 @@ void MainWindow::updateEntrySources() {
for(Fetch::FetcherVec::Iterator it = vec.begin(); it != vec.end(); ++it) {
KAction* action = new KAction(actionCollection());
action->setText(it->source());
- action->setToolTip(i18n("Update entry data from %1").arg(it->source()));
+ action->setToolTip(i18n("Update entry data from %1").tqarg(it->source()));
action->setIconSet(Fetch::Manager::fetcherIcon(it.data()));
- connect(action, SIGNAL(activated()), mapper, SLOT(map()));
+ connect(action, TQT_SIGNAL(activated()), mapper, TQT_SLOT(map()));
mapper->setMapping(action, it->source());
m_fetchActions.append(action);
}
- plugActionList(QString::fromLatin1("update_entry_actions"), m_fetchActions);
+ plugActionList(TQString::tqfromLatin1("update_entry_actions"), m_fetchActions);
}
void MainWindow::importFile(Import::Format format_, const KURL::List& urls_) {
@@ -2306,22 +2306,22 @@ void MainWindow::importFile(Import::Format format_, const KURL::List& urls_) {
format_ != Import::RIS &&
format_ != Import::PDF) {
KURL u = urls_.front();
- QString url = u.isLocalFile() ? u.path() : u.prettyURL();
+ TQString url = u.isLocalFile() ? u.path() : u.prettyURL();
Kernel::self()->sorry(i18n("Tellico can only import one file of this type at a time. "
- "Only %1 will be imported.").arg(url));
+ "Only %1 will be imported.").tqarg(url));
urls.clear();
urls = u;
}
ImportDialog dlg(format_, urls, this, "importdlg");
- if(dlg.exec() != QDialog::Accepted) {
+ if(dlg.exec() != TQDialog::Accepted) {
return;
}
// if edit dialog is saved ok and if replacing, then the doc is saved ok
if(m_editDialog->queryModified() &&
(dlg.action() != Import::Replace || Data::Document::self()->saveModified())) {
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
Data::CollPtr coll = dlg.collection();
if(!coll) {
if(!dlg.statusMessage().isEmpty()) {
@@ -2366,7 +2366,7 @@ bool MainWindow::importCollection(Data::CollPtr coll_, Import::Action action_) {
}
break;
- default: // replace
+ default: // tqreplace
Kernel::self()->replaceCollection(coll_);
m_fileOpenRecent->setCurrentItem(-1);
m_newDocument = true;
@@ -2379,7 +2379,7 @@ bool MainWindow::importCollection(Data::CollPtr coll_, Import::Action action_) {
void MainWindow::slotURLAction(const KURL& url_) {
Q_ASSERT(url_.protocol() == Latin1Literal("tc"));
- QString actionName = url_.fileName();
+ TQString actionName = url_.fileName();
KAction* action = this->action(actionName);
if(action) {
action->activate();
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 96ed71a..31e9517 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -31,9 +31,9 @@ class KRecentFilesAction;
class KActionMenu;
class KDialogBase;
-class QCloseEvent;
-class QSplitter;
-class QListViewItem;
+class TQCloseEvent;
+class TQSplitter;
+class TQListViewItem;
namespace Tellico {
// forward declarations
@@ -72,6 +72,7 @@ namespace Tellico {
*/
class MainWindow : public KMainWindow, public ApplicationInterface {
Q_OBJECT
+ TQ_OBJECT
friend class Controller;
friend class DropHandler;
@@ -80,7 +81,7 @@ public:
/**
* The main window constructor, calls all init functions to create the application.
*/
- MainWindow(QWidget* parent=0, const char* name=0);
+ MainWindow(TQWidget* tqparent=0, const char* name=0);
/**
* Opens the initial file.
@@ -118,8 +119,8 @@ public:
/**
* Used by DCOP
*/
- virtual void openFile(const QString& file);
- virtual void setFilter(const QString& text);
+ virtual void openFile(const TQString& file);
+ virtual void setFilter(const TQString& text);
virtual bool showEntry(long id);
public slots:
@@ -219,8 +220,8 @@ public slots:
*
* @param text The text that is displayed in the statusbar
*/
- void slotStatusMsg(const QString& text);
- void slotClearStatus();
+ void slotStatusMsg(const TQString& text);
+ void slotCleartqStatus();
/**
* Shows the configuration window for the toolbars.
*/
@@ -298,7 +299,7 @@ public slots:
private:
/**
* Saves the general options like all toolbar positions and status as well as the
- * geometry and the recent file list to the configuration file.
+ * tqgeometry and the recent file list to the configuration file.
*/
void saveOptions();
/**
@@ -329,7 +330,7 @@ private:
/**
* Initiates shutdown
*/
-// void closeEvent(QCloseEvent *e);
+// void closeEvent(TQCloseEvent *e);
/**
* Saves the window properties for each open window during session end to the
* session config file, including saving the currently opened file by a temporary
@@ -375,7 +376,7 @@ private:
*
* @param html The HTML string representing the doc to print
*/
- void doPrint(const QString& html);
+ void doPrint(const TQString& html);
void XSLTError();
/**
@@ -497,9 +498,9 @@ private:
GUI::LineEdit* m_quickFilter;
// m_split is used between the stuff on the left and stuff on the right
- QSplitter* m_split;
+ TQSplitter* m_split;
// m_leftSplit is used between detailed view and entry view
- QSplitter* m_rightSplit;
+ TQSplitter* m_rightSplit;
Tellico::StatusBar* m_statusBar;
@@ -518,7 +519,7 @@ private:
FetchDialog* m_fetchDlg;
ReportDialog* m_reportDlg;
- QPtrList<KAction> m_fetchActions;
+ TQPtrList<KAction> m_fetchActions;
CollectionInterface m_collInterface;
// keep track of the number of queued filter updates
diff --git a/src/newstuff/dialog.cpp b/src/newstuff/dialog.cpp
index c13a249..6cacc72 100644
--- a/src/newstuff/dialog.cpp
+++ b/src/newstuff/dialog.cpp
@@ -30,15 +30,15 @@
#include <knewstuff/provider.h>
#include <ktempfile.h>
-#include <qlabel.h>
-#include <qtextedit.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
-#include <qregexp.h>
-#include <qvbox.h>
-#include <qimage.h>
-#include <qtimer.h>
-#include <qprogressbar.h>
+#include <tqlabel.h>
+#include <tqtextedit.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
+#include <tqregexp.h>
+#include <tqvbox.h>
+#include <tqimage.h>
+#include <tqtimer.h>
+#include <tqprogressbar.h>
#if KDE_IS_VERSION(3,4,90)
#define ENTRYNAME(e) e->name(m_lang)
@@ -47,7 +47,7 @@
#else
#define ENTRYNAME(e) e->name()
#define ENTRYSUMM(e) e->summary()
-#define ENTRYEMAIL(e) QString()
+#define ENTRYEMAIL(e) TQString()
#endif
namespace {
@@ -60,26 +60,26 @@ using Tellico::NewStuff::Dialog;
class Dialog::Item : public GUI::ListViewItem {
public:
- Item(GUI::ListView* parent) : GUI::ListViewItem(parent) {}
+ Item(GUI::ListView* tqparent) : GUI::ListViewItem(tqparent) {}
- InstallStatus status() const { return m_status; }
- void setStatus(InstallStatus status) {
+ InstalltqStatus status() const { return m_status; }
+ void settqStatus(InstalltqStatus status) {
m_status = status;
if(m_status == Current) {
- setPixmap(0, SmallIcon(QString::fromLatin1("ok")));
+ setPixmap(0, SmallIcon(TQString::tqfromLatin1("ok")));
} else if(m_status == OldVersion) {
- setPixmap(0, SmallIcon(QString::fromLatin1("reload")));
+ setPixmap(0, SmallIcon(TQString::tqfromLatin1("reload")));
}
}
- QString key(int col, bool asc) const {
+ TQString key(int col, bool asc) const {
if(col == 2 || col == 3) {
- QString s;
+ TQString s;
s.sprintf("%08d", text(col).toInt());
return s;
} else if(col == 4) {
- QString s;
- QDate date = KGlobal::locale()->readDate(text(col));
+ TQString s;
+ TQDate date = KGlobal::locale()->readDate(text(col));
s.sprintf("%08d", date.year() * 366 + date.dayOfYear());
return s;
}
@@ -87,162 +87,162 @@ public:
}
private:
- InstallStatus m_status;
+ InstalltqStatus m_status;
};
-Dialog::Dialog(NewStuff::DataType type_, QWidget* parent_)
- : KDialogBase(KDialogBase::Plain, i18n("Get Hot New Stuff"), 0, (KDialogBase::ButtonCode)0, parent_)
- , m_manager(new Manager(this))
+Dialog::Dialog(NewStuff::DataType type_, TQWidget* tqparent_)
+ : KDialogBase(KDialogBase::Plain, i18n("Get Hot New Stuff"), 0, (KDialogBase::ButtonCode)0, tqparent_)
+ , m_manager(new Manager(TQT_TQOBJECT(this)))
, m_type(type_)
- , m_timer(new QTimer(this))
+ , m_timer(new TQTimer(this))
, m_cursorSaver(new GUI::CursorSaver())
, m_tempPreviewImage(0)
, m_lastPreviewItem(0) {
m_lang = KGlobal::locale()->language();
- QFrame* frame = plainPage();
- QBoxLayout* boxLayout = new QVBoxLayout(frame, 0, KDialog::spacingHint());
+ TQFrame* frame = plainPage();
+ TQBoxLayout* boxLayout = new TQVBoxLayout(frame, 0, KDialog::spacingHint());
- m_split = new QSplitter(Qt::Vertical, frame);
+ m_split = new TQSplitter(Qt::Vertical, frame);
boxLayout->addWidget(m_split);
m_listView = new GUI::ListView(m_split);
m_listView->setAllColumnsShowFocus(true);
- m_listView->setSelectionMode(QListView::Single);
+ m_listView->setSelectionMode(TQListView::Single);
m_listView->addColumn(i18n("Name"));
m_listView->addColumn(i18n("Version"));
m_listView->addColumn(i18n("Rating"));
m_listView->addColumn(i18n("Downloads"));
m_listView->addColumn(i18n("Release Date"));
m_listView->setSorting(2, false);
- m_listView->setResizeMode(QListView::AllColumns);
- connect(m_listView, SIGNAL(clicked(QListViewItem*)), SLOT(slotSelected(QListViewItem*)));
- QWhatsThis::add(m_listView, i18n("This is a list of all the items available for download. "
+ m_listView->setResizeMode(TQListView::AllColumns);
+ connect(m_listView, TQT_SIGNAL(clicked(TQListViewItem*)), TQT_SLOT(slotSelected(TQListViewItem*)));
+ TQWhatsThis::add(m_listView, i18n("This is a list of all the items available for download. "
"Previously installed items have a checkmark icon, while "
"items with new version available have an update icon"));
- QWidget* widget = new QWidget(m_split);
- QBoxLayout* boxLayout2 = new QVBoxLayout(widget, 0, KDialog::spacingHint());
+ TQWidget* widget = new TQWidget(m_split);
+ TQBoxLayout* boxLayout2 = new TQVBoxLayout(widget, 0, KDialog::spacingHint());
- m_iconLabel = new QLabel(widget);
- m_iconLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
+ m_iconLabel = new TQLabel(widget);
+ m_iconLabel->tqsetAlignment(TQt::AlignTop | TQt::AlignLeft);
m_iconLabel->setMargin(0);
- m_nameLabel = new QLabel(widget);
- QFont font = m_nameLabel->font();
+ m_nameLabel = new TQLabel(widget);
+ TQFont font = m_nameLabel->font();
font.setBold(true);
font.setItalic(true);
m_nameLabel->setFont(font);
- QWhatsThis::add(m_nameLabel, i18n("The name and license of the selected item"));
+ TQWhatsThis::add(m_nameLabel, i18n("The name and license of the selected item"));
- m_infoLabel = new QLabel(widget);
- QWhatsThis::add(m_infoLabel, i18n("The author of the selected item"));
+ m_infoLabel = new TQLabel(widget);
+ TQWhatsThis::add(m_infoLabel, i18n("The author of the selected item"));
m_install = new KPushButton(i18n("Install"), widget);
- m_install->setIconSet(SmallIconSet(QString::fromLatin1("knewstuff")));
+ m_install->setIconSet(SmallIconSet(TQString::tqfromLatin1("knewstuff")));
m_install->setEnabled(false);
- connect(m_install, SIGNAL(clicked()), SLOT(slotInstall()));
+ connect(m_install, TQT_SIGNAL(clicked()), TQT_SLOT(slotInstall()));
// the button's text changes later
// I don't want it resizing, so figure out the maximum size and set that
m_install->polish();
- int maxWidth = m_install->sizeHint().width();
- int maxHeight = m_install->sizeHint().height();
- m_install->setGuiItem(KGuiItem(i18n("Update"), SmallIconSet(QString::fromLatin1("knewstuff"))));
- maxWidth = QMAX(maxWidth, m_install->sizeHint().width());
- maxHeight = QMAX(maxHeight, m_install->sizeHint().height());
+ int maxWidth = m_install->tqsizeHint().width();
+ int maxHeight = m_install->tqsizeHint().height();
+ m_install->setGuiItem(KGuiItem(i18n("Update"), SmallIconSet(TQString::tqfromLatin1("knewstuff"))));
+ maxWidth = TQMAX(maxWidth, m_install->tqsizeHint().width());
+ maxHeight = TQMAX(maxHeight, m_install->tqsizeHint().height());
m_install->setMinimumWidth(maxWidth);
m_install->setMinimumHeight(maxHeight);
- QPixmap pix;
+ TQPixmap pix;
if(m_type == EntryTemplate) {
- pix = DesktopIcon(QString::fromLatin1("looknfeel"), KIcon::SizeLarge);
- QWhatsThis::add(m_install, i18n("Download and install the selected template."));
+ pix = DesktopIcon(TQString::tqfromLatin1("looknfeel"), KIcon::SizeLarge);
+ TQWhatsThis::add(m_install, i18n("Download and install the selected template."));
} else {
- pix = UserIcon(QString::fromLatin1("script"));
- QWhatsThis::add(m_install, i18n("Download and install the selected script. Some scripts "
+ pix = UserIcon(TQString::tqfromLatin1("script"));
+ TQWhatsThis::add(m_install, i18n("Download and install the selected script. Some scripts "
"may need to be configured after being installed."));
}
m_iconLabel->setPixmap(pix);
- QBoxLayout* boxLayout3 = new QHBoxLayout(boxLayout2);
+ TQBoxLayout* boxLayout3 = new TQHBoxLayout(boxLayout2);
- QBoxLayout* boxLayout4 = new QVBoxLayout(boxLayout3);
+ TQBoxLayout* boxLayout4 = new TQVBoxLayout(boxLayout3);
boxLayout4->addWidget(m_iconLabel);
boxLayout4->addStretch(10);
boxLayout3->addSpacing(4);
- QBoxLayout* boxLayout5 = new QVBoxLayout(boxLayout3);
+ TQBoxLayout* boxLayout5 = new TQVBoxLayout(boxLayout3);
boxLayout5->addWidget(m_nameLabel);
boxLayout5->addWidget(m_infoLabel);
boxLayout5->addStretch(10);
boxLayout3->addStretch(10);
- QBoxLayout* boxLayout6 = new QVBoxLayout(boxLayout3);
+ TQBoxLayout* boxLayout6 = new TQVBoxLayout(boxLayout3);
boxLayout6->addWidget(m_install);
boxLayout6->addStretch(10);
- m_descLabel = new QTextEdit(widget);
+ m_descLabel = new TQTextEdit(widget);
m_descLabel->setReadOnly(true);
- m_descLabel->setTextFormat(Qt::RichText);
- m_descLabel->setPaper(colorGroup().background());
+ m_descLabel->setTextFormat(TQt::RichText);
+ m_descLabel->setPaper(tqcolorGroup().background());
m_descLabel->setMinimumHeight(5 * fontMetrics().height());
boxLayout2->addWidget(m_descLabel, 10);
- QWhatsThis::add(m_descLabel, i18n("A description of the selected item is shown here."));
+ TQWhatsThis::add(m_descLabel, i18n("A description of the selected item is shown here."));
- QHBox* box = new QHBox(frame, "statusbox");
+ TQHBox* box = new TQHBox(frame, "statusbox");
boxLayout->addWidget(box);
box->setSpacing(KDialog::spacingHint());
m_statusBar = new KStatusBar(box, "statusbar");
- m_statusBar->insertItem(QString::null, PROGRESS_STATUS_ID, 1, false);
+ m_statusBar->insertItem(TQString(), PROGRESS_STATUS_ID, 1, false);
m_statusBar->setItemAlignment(PROGRESS_STATUS_ID, AlignLeft | AlignVCenter);
- m_progress = new QProgressBar(m_statusBar, "progress");
+ m_progress = new TQProgressBar(m_statusBar, "progress");
m_progress->setTotalSteps(0);
m_progress->setFixedHeight(fontMetrics().height()+2);
m_statusBar->addWidget(m_progress, 0, true);
KPushButton* closeButton = new KPushButton(KStdGuiItem::close(), box);
- connect(closeButton, SIGNAL(clicked()), SLOT(slotClose()));
+ connect(closeButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotClose()));
closeButton->setFocus();
- connect(m_timer, SIGNAL(timeout()), SLOT(slotMoveProgress()));
+ connect(m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotMoveProgress()));
- setMinimumWidth(QMAX(minimumWidth(), NEW_STUFF_MIN_WIDTH));
- setMinimumHeight(QMAX(minimumHeight(), NEW_STUFF_MIN_HEIGHT));
- resize(configDialogSize(QString::fromLatin1("NewStuff Dialog Options")));
+ setMinimumWidth(TQMAX(minimumWidth(), NEW_STUFF_MIN_WIDTH));
+ setMinimumHeight(TQMAX(minimumHeight(), NEW_STUFF_MIN_HEIGHT));
+ resize(configDialogSize(TQString::tqfromLatin1("NewStuff Dialog Options")));
KConfigGroup dialogConfig(KGlobal::config(), "NewStuff Dialog Options");
- QValueList<int> splitList = dialogConfig.readIntListEntry("Splitter Sizes");
+ TQValueList<int> splitList = dialogConfig.readIntListEntry("Splitter Sizes");
if(!splitList.empty()) {
m_split->setSizes(splitList);
}
- setStatus(i18n("Downloading information..."));
+ settqStatus(i18n("Downloading information..."));
ProviderLoader* loader = new Tellico::NewStuff::ProviderLoader(this);
- connect(loader, SIGNAL(providersLoaded(QPtrList<KNS::Provider>*)), SLOT(slotProviders(QPtrList<KNS::Provider>*)));
- connect(loader, SIGNAL(percent(KIO::Job*, unsigned long)), SLOT(slotShowPercent(KIO::Job*, unsigned long)));
- connect(loader, SIGNAL(error()), SLOT(slotProviderError()));
+ connect(loader, TQT_SIGNAL(providersLoaded(TQPtrList<KNS::Provider>*)), TQT_SLOT(slotProviders(TQPtrList<KNS::Provider>*)));
+ connect(loader, TQT_SIGNAL(percent(KIO::Job*, unsigned long)), TQT_SLOT(slotShowPercent(KIO::Job*, unsigned long)));
+ connect(loader, TQT_SIGNAL(error()), TQT_SLOT(slotProviderError()));
KConfigGroup config(KGlobal::config(), "KNewStuff");
- QString prov = config.readEntry("ProvidersUrl");
+ TQString prov = config.readEntry("ProvidersUrl");
if(prov.isEmpty()) {
if(m_type == EntryTemplate) {
- prov = QString::fromLatin1("http://periapsis.org/tellico/newstuff/tellicotemplates-providers.php");
- QString alt = QString::fromLatin1("http://download.kde.org/khotnewstuff/tellicotemplates-providers.xml");
+ prov = TQString::tqfromLatin1("http://periapsis.org/tellico/newstuff/tellicotemplates-providers.php");
+ TQString alt = TQString::tqfromLatin1("http://download.kde.org/khotnewstuff/tellicotemplates-providers.xml");
loader->setAlternativeProvider(alt);
} else {
- prov = QString::fromLatin1("http://periapsis.org/tellico/newstuff/tellicoscripts-providers.php");
+ prov = TQString::tqfromLatin1("http://periapsis.org/tellico/newstuff/tellicoscripts-providers.php");
}
}
if(m_type == EntryTemplate) {
- m_typeName = QString::fromLatin1("tellico/entry-template");
+ m_typeName = TQString::tqfromLatin1("tellico/entry-template");
} else {
- m_typeName = QString::fromLatin1("tellico/data-source");
+ m_typeName = TQString::tqfromLatin1("tellico/data-source");
}
loader->load(m_typeName, prov);
@@ -253,7 +253,7 @@ Dialog::~Dialog() {
delete m_cursorSaver;
m_cursorSaver = 0;
- saveDialogSize(QString::fromLatin1("NewStuff Dialog Options"));
+ saveDialogSize(TQString::tqfromLatin1("NewStuff Dialog Options"));
KConfigGroup config(KGlobal::config(), "NewStuff Dialog Options");
config.writeEntry("Splitter Sizes", m_split->sizes());
}
@@ -261,50 +261,50 @@ Dialog::~Dialog() {
void Dialog::slotProviderError() {
if(m_listView->childCount() == 0) {
myDebug() << "NewStuff::Dialog::slotCheckError() - no available items" << endl;
- setStatus(QString());
+ settqStatus(TQString());
delete m_cursorSaver;
m_cursorSaver = 0;
}
}
-void Dialog::slotProviders(QPtrList<KNS::Provider>* list_) {
+void Dialog::slotProviders(TQPtrList<KNS::Provider>* list_) {
for(KNS::Provider* prov = list_->first(); prov; prov = list_->next()) {
KIO::TransferJob* job = KIO::get(prov->downloadUrl());
m_jobs[job] = prov;
- connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- SLOT(slotData(KIO::Job*, const QByteArray&)));
- connect(job, SIGNAL(result(KIO::Job*)), SLOT(slotResult(KIO::Job*)));
- connect(job, SIGNAL(percent(KIO::Job*, unsigned long)),
- SLOT(slotShowPercent(KIO::Job*, unsigned long)));
+ connect(job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ TQT_SLOT(slotData(KIO::Job*, const TQByteArray&)));
+ connect(job, TQT_SIGNAL(result(KIO::Job*)), TQT_SLOT(slotResult(KIO::Job*)));
+ connect(job, TQT_SIGNAL(percent(KIO::Job*, unsigned long)),
+ TQT_SLOT(slotShowPercent(KIO::Job*, unsigned long)));
}
}
-void Dialog::slotData(KIO::Job* job_, const QByteArray& data_) {
- QDataStream stream(m_data[job_], IO_WriteOnly | IO_Append);
+void Dialog::slotData(KIO::Job* job_, const TQByteArray& data_) {
+ TQDataStream stream(m_data[job_], IO_WriteOnly | IO_Append);
stream.writeRawBytes(data_.data(), data_.size());
}
void Dialog::slotResult(KIO::Job* job_) {
// myDebug() << "NewStuff::Dialog::slotResult()" << endl;
- QDomDocument dom;
+ TQDomDocument dom;
if(!dom.setContent(m_data[job_])) {
KNS::Provider* prov = m_jobs[job_];
KURL u = prov ? prov->downloadUrl() : KURL();
myDebug() << "NewStuff::Dialog::slotResult() - can't load result: " << u.url() << endl;
m_jobs.remove(job_);
if(m_jobs.isEmpty()) {
- setStatus(i18n("Ready."));
+ settqStatus(i18n("Ready."));
delete m_cursorSaver;
m_cursorSaver = 0;
}
return;
}
- QDomElement knewstuff = dom.documentElement();
+ TQDomElement knewstuff = dom.documentElement();
- for(QDomNode pn = knewstuff.firstChild(); !pn.isNull(); pn = pn.nextSibling()) {
- QDomElement stuff = pn.toElement();
+ for(TQDomNode pn = knewstuff.firstChild(); !pn.isNull(); pn = pn.nextSibling()) {
+ TQDomElement stuff = pn.toElement();
if(stuff.isNull()) {
continue;
}
@@ -321,7 +321,7 @@ void Dialog::slotResult(KIO::Job* job_) {
}
m_jobs.remove(job_);
if(m_jobs.isEmpty()) {
- setStatus(i18n("Ready."));
+ settqStatus(i18n("Ready."));
delete m_cursorSaver;
m_cursorSaver = 0;
}
@@ -335,10 +335,10 @@ void Dialog::addEntry(KNS::Entry* entry_) {
Item* item = new Item(m_listView);
item->setText(0, ENTRYNAME(entry_));
item->setText(1, entry_->version());
- item->setText(2, QString::number(entry_->rating()));
- item->setText(3, QString::number(entry_->downloads()));
+ item->setText(2, TQString::number(entry_->rating()));
+ item->setText(3, TQString::number(entry_->downloads()));
item->setText(4, KGlobal::locale()->formatDate(entry_->releaseDate(), true /*short format */));
- item->setStatus(NewStuff::Manager::installStatus(entry_));
+ item->settqStatus(NewStuff::Manager::installtqStatus(entry_));
m_entryMap.insert(item, entry_);
if(!m_listView->selectedItem()) {
@@ -347,7 +347,7 @@ void Dialog::addEntry(KNS::Entry* entry_) {
}
}
-void Dialog::slotSelected(QListViewItem* item_) {
+void Dialog::slotSelected(TQListViewItem* item_) {
if(!item_) {
return;
}
@@ -365,22 +365,22 @@ void Dialog::slotSelected(QListViewItem* item_) {
KURL dest;
dest.setPath(m_tempPreviewImage->name());
KIO::FileCopyJob* job = KIO::file_copy(preview, dest, -1, true, false, false);
- connect(job, SIGNAL(result(KIO::Job*)), SLOT(slotPreviewResult(KIO::Job*)));
- connect(job, SIGNAL(percent(KIO::Job*, unsigned long)),
- SLOT(slotShowPercent(KIO::Job*, unsigned long)));
+ connect(job, TQT_SIGNAL(result(KIO::Job*)), TQT_SLOT(slotPreviewResult(KIO::Job*)));
+ connect(job, TQT_SIGNAL(percent(KIO::Job*, unsigned long)),
+ TQT_SLOT(slotShowPercent(KIO::Job*, unsigned long)));
m_lastPreviewItem = item_;
}
- QPixmap pix = m_type == EntryTemplate
- ? DesktopIcon(QString::fromLatin1("looknfeel"), KIcon::SizeLarge)
- : UserIcon(QString::fromLatin1("script"));
+ TQPixmap pix = m_type == EntryTemplate
+ ? DesktopIcon(TQString::tqfromLatin1("looknfeel"), KIcon::SizeLarge)
+ : UserIcon(TQString::tqfromLatin1("script"));
m_iconLabel->setPixmap(pix);
- QString license = entry->license();
+ TQString license = entry->license();
if(!license.isEmpty()) {
license.prepend('(').append(')');
}
- QString name = QString::fromLatin1("%1 %2").arg(ENTRYNAME(entry)).arg(license);
- QFont font = m_nameLabel->font();
+ TQString name = TQString::tqfromLatin1("%1 %2").tqarg(ENTRYNAME(entry)).tqarg(license);
+ TQFont font = m_nameLabel->font();
font.setBold(true);
font.setItalic(false);
m_nameLabel->setFont(font);
@@ -388,17 +388,17 @@ void Dialog::slotSelected(QListViewItem* item_) {
m_infoLabel->setText(entry->author());
- QString desc = entry->summary(m_lang);
- desc.replace(QRegExp(QString::fromLatin1("\\n")), QString::fromLatin1("<br>"));
+ TQString desc = entry->summary(m_lang);
+ desc.tqreplace(TQRegExp(TQString::tqfromLatin1("\\n")), TQString::tqfromLatin1("<br>"));
m_descLabel->setText(desc);
- InstallStatus installed = static_cast<Item*>(item_)->status();
+ InstalltqStatus installed = static_cast<Item*>(item_)->status();
m_install->setText(installed == OldVersion ? i18n("Update Stuff", "Update") : i18n("Install"));
m_install->setEnabled(installed != Current);
}
void Dialog::slotInstall() {
- QListViewItem* item = m_listView->currentItem();
+ TQListViewItem* item = m_listView->currentItem();
if(!item) {
return;
}
@@ -410,28 +410,28 @@ void Dialog::slotInstall() {
delete m_cursorSaver;
m_cursorSaver = new GUI::CursorSaver();
- setStatus(i18n("Installing item..."));
+ settqStatus(i18n("Installing item..."));
m_progress->show();
m_timer->start(100);
- connect(m_manager, SIGNAL(signalInstalled(KNS::Entry*)), SLOT(slotDoneInstall(KNS::Entry*)));
+ connect(m_manager, TQT_SIGNAL(signalInstalled(KNS::Entry*)), TQT_SLOT(slotDoneInstall(KNS::Entry*)));
m_manager->install(m_type, entry);
delete m_cursorSaver;
m_cursorSaver = 0;
}
void Dialog::slotDoneInstall(KNS::Entry* entry_) {
- QMap<QListViewItem*, KNS::Entry*>::Iterator it;
+ TQMap<TQListViewItem*, KNS::Entry*>::Iterator it;
for(it = m_entryMap.begin(); entry_ && it != m_entryMap.end(); ++it) {
if(it.data() == entry_) {
- InstallStatus installed = Manager::installStatus(entry_);
- static_cast<Item*>(it.key())->setStatus(installed);
+ InstalltqStatus installed = Manager::installtqStatus(entry_);
+ static_cast<Item*>(it.key())->settqStatus(installed);
m_install->setEnabled(installed != Current);
break;
}
}
delete m_cursorSaver;
m_cursorSaver = 0;
- setStatus(i18n("Ready."));
+ settqStatus(i18n("Ready."));
m_timer->stop();
m_progress->hide();
}
@@ -440,8 +440,8 @@ void Dialog::slotMoveProgress() {
m_progress->setProgress(m_progress->progress()+5);
}
-void Dialog::setStatus(const QString& text_) {
- m_statusBar->changeItem(QChar(' ') + text_, PROGRESS_STATUS_ID);
+void Dialog::settqStatus(const TQString& text_) {
+ m_statusBar->changeItem(TQChar(' ') + text_, PROGRESS_STATUS_ID);
}
void Dialog::slotShowPercent(KIO::Job*, unsigned long pct_) {
@@ -458,12 +458,12 @@ void Dialog::slotPreviewResult(KIO::Job* job_) {
if(job->error()) {
return;
}
- QString tmpFile = job->destURL().path(); // might be different than m_tempPreviewImage->name()
- QPixmap pix(tmpFile);
+ TQString tmpFile = job->destURL().path(); // might be different than m_tempPreviewImage->name()
+ TQPixmap pix(tmpFile);
if(!pix.isNull()) {
if(pix.width() > 64 || pix.height() > 64) {
- pix.convertFromImage(pix.convertToImage().smoothScale(64, 64, QImage::ScaleMin));
+ pix.convertFromImage(pix.convertToImage().smoothScale(64, 64, TQ_ScaleMin));
}
// only set label if it's still current
if(m_listView->selectedItem() == m_lastPreviewItem) {
diff --git a/src/newstuff/dialog.h b/src/newstuff/dialog.h
index f1c5e48..b719b72 100644
--- a/src/newstuff/dialog.h
+++ b/src/newstuff/dialog.h
@@ -28,10 +28,10 @@ namespace KNS {
class Provider;
}
-class QProgressBar;
-class QSplitter;
-class QLabel;
-class QTextEdit;
+class TQProgressBar;
+class TQSplitter;
+class TQLabel;
+class TQTextEdit;
namespace Tellico {
namespace GUI {
@@ -43,22 +43,23 @@ namespace Tellico {
class Dialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
- Dialog(DataType type, QWidget* parent);
+ Dialog(DataType type, TQWidget* tqparent);
virtual ~Dialog();
- QPtrList<DataSourceInfo> dataSourceInfo() const { return m_manager->dataSourceInfo(); }
+ TQPtrList<DataSourceInfo> dataSourceInfo() const { return m_manager->dataSourceInfo(); }
private slots:
- void slotProviders(QPtrList<KNS::Provider>* list);
- void slotData(KIO::Job* job, const QByteArray& data);
+ void slotProviders(TQPtrList<KNS::Provider>* list);
+ void slotData(KIO::Job* job, const TQByteArray& data);
void slotResult(KIO::Job* job);
void slotPreviewResult(KIO::Job* job);
void slotShowPercent(KIO::Job* job, unsigned long percent);
- void slotSelected(QListViewItem* item);
+ void slotSelected(TQListViewItem* item);
void slotInstall();
void slotDoneInstall(KNS::Entry* entry);
@@ -68,32 +69,32 @@ private slots:
private:
class Item;
- void setStatus(const QString& status);
+ void settqStatus(const TQString& status);
void addEntry(KNS::Entry* entry);
Manager* const m_manager;
DataType m_type;
- QString m_lang;
- QString m_typeName;
+ TQString m_lang;
+ TQString m_typeName;
- QSplitter* m_split;
+ TQSplitter* m_split;
GUI::ListView* m_listView;
- QLabel* m_iconLabel;
- QLabel* m_nameLabel;
- QLabel* m_infoLabel;
- QTextEdit* m_descLabel;
+ TQLabel* m_iconLabel;
+ TQLabel* m_nameLabel;
+ TQLabel* m_infoLabel;
+ TQTextEdit* m_descLabel;
KPushButton* m_install;
KStatusBar* m_statusBar;
- QProgressBar* m_progress;
- QTimer* m_timer;
+ TQProgressBar* m_progress;
+ TQTimer* m_timer;
GUI::CursorSaver* m_cursorSaver;
KTempFile* m_tempPreviewImage;
- QMap<KIO::Job*, KNS::Provider*> m_jobs;
- QMap<KIO::Job*, QByteArray> m_data;
+ TQMap<KIO::Job*, KNS::Provider*> m_jobs;
+ TQMap<KIO::Job*, TQByteArray> m_data;
- QMap<QListViewItem*, KNS::Entry*> m_entryMap;
- QListViewItem* m_lastPreviewItem;
+ TQMap<TQListViewItem*, KNS::Entry*> m_entryMap;
+ TQListViewItem* m_lastPreviewItem;
};
}
diff --git a/src/newstuff/manager.cpp b/src/newstuff/manager.cpp
index 3b7efbf..01d9932 100644
--- a/src/newstuff/manager.cpp
+++ b/src/newstuff/manager.cpp
@@ -31,18 +31,18 @@
#include <knewstuff/entry.h>
#include <kstandarddirs.h>
-#include <qfileinfo.h>
-#include <qdir.h>
-#include <qptrstack.h>
-#include <qvaluestack.h>
-#include <qwidget.h>
+#include <tqfileinfo.h>
+#include <tqdir.h>
+#include <tqptrstack.h>
+#include <tqvaluestack.h>
+#include <tqwidget.h>
#include <sys/types.h>
#include <sys/stat.h>
using Tellico::NewStuff::Manager;
-Manager::Manager(QObject* parent_) : QObject(parent_), m_tempFile(0) {
+Manager::Manager(TQObject* tqparent_) : TQObject(tqparent_), m_tempFile(0) {
m_infoList.setAutoDelete(true);
}
@@ -51,11 +51,11 @@ Manager::~Manager() {
m_tempFile = 0;
}
-bool Manager::installTemplate(const KURL& url_, const QString& entryName_) {
+bool Manager::installTemplate(const KURL& url_, const TQString& entryName_) {
FileHandler::FileRef* ref = FileHandler::fileRef(url_);
- QString xslFile;
- QStringList allFiles;
+ TQString xslFile;
+ TQStringList allFiles;
bool success = true;
@@ -64,23 +64,23 @@ bool Manager::installTemplate(const KURL& url_, const QString& entryName_) {
KTar archive(ref->fileName());
if(archive.open(IO_ReadOnly)) {
const KArchiveDirectory* archiveDir = archive.directory();
- archiveDir->copyTo(Tellico::saveLocation(QString::fromLatin1("entry-templates/")));
+ archiveDir->copyTo(Tellico::saveLocation(TQString::tqfromLatin1("entry-templates/")));
allFiles = archiveFiles(archiveDir);
// remember files installed for template
xslFile = findXSL(archiveDir);
} else { // assume it's an xsl file
- QString name = entryName_;
+ TQString name = entryName_;
if(name.isEmpty()) {
name = url_.fileName();
}
- if(!name.endsWith(QString::fromLatin1(".xsl"))) {
- name += QString::fromLatin1(".xsl");
+ if(!name.endsWith(TQString::tqfromLatin1(".xsl"))) {
+ name += TQString::tqfromLatin1(".xsl");
}
KURL dest;
- dest.setPath(Tellico::saveLocation(QString::fromLatin1("entry-templates/")) + name);
+ dest.setPath(Tellico::saveLocation(TQString::tqfromLatin1("entry-templates/")) + name);
success = true;
- if(QFile::exists(dest.path())) {
+ if(TQFile::exists(dest.path())) {
myDebug() << "Manager::installTemplate() - " << dest.path() << " exists!" << endl;
success = false;
} else if(KIO::NetAccess::file_copy(url_, dest)) {
@@ -105,9 +105,9 @@ bool Manager::installTemplate(const KURL& url_, const QString& entryName_) {
return success;
}
-bool Manager::removeTemplate(const QString& name_) {
+bool Manager::removeTemplate(const TQString& name_) {
KConfigGroup fileGroup(KGlobal::config(), "KNewStuffFiles");
- QStringList files = fileGroup.readListEntry(name_);
+ TQStringList files = fileGroup.readListEntry(name_);
// at least, delete xsl file
if(files.isEmpty()) {
kdWarning() << "Manager::deleteTemplate() no file list found for " << name_ << endl;
@@ -115,13 +115,13 @@ bool Manager::removeTemplate(const QString& name_) {
}
bool success = true;
- QString path = Tellico::saveLocation(QString::fromLatin1("entry-templates/"));
- for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
- if((*it).endsWith(QChar('/'))) {
+ TQString path = Tellico::saveLocation(TQString::tqfromLatin1("entry-templates/"));
+ for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
+ if((*it).endsWith(TQChar('/'))) {
// ok to not delete all directories
- QDir().rmdir(path + *it);
+ TQDir().rmdir(path + *it);
} else {
- success = success && QFile(path + *it).remove();
+ success = success && TQFile(path + *it).remove();
if(!success) {
myDebug() << "Manager::removeTemplate() - failed to remove " << (path+*it) << endl;
}
@@ -130,8 +130,8 @@ bool Manager::removeTemplate(const QString& name_) {
// remove config entries even if unsuccessful
fileGroup.deleteEntry(name_);
- KConfigGroup statusGroup(KGlobal::config(), "KNewStuffStatus");
- QString entryName = statusGroup.readEntry(name_);
+ KConfigGroup statusGroup(KGlobal::config(), "KNewStufftqStatus");
+ TQString entryName = statusGroup.readEntry(name_);
statusGroup.deleteEntry(name_);
statusGroup.deleteEntry(entryName);
@@ -149,24 +149,24 @@ bool Manager::installScript(const KURL& url_) {
const KArchiveDirectory* archiveDir = archive.directory();
- QString exeFile = findEXE(archiveDir);
+ TQString exeFile = findEXE(archiveDir);
if(exeFile.isEmpty()) {
myDebug() << "Manager::installScript() - no exe file found" << endl;
return false;
}
- QFileInfo exeInfo(exeFile);
+ TQFileInfo exeInfo(exeFile);
DataSourceInfo* info = new DataSourceInfo();
- QString copyTarget = Tellico::saveLocation(QString::fromLatin1("data-sources/"));
- QString scriptFolder;
+ TQString copyTarget = Tellico::saveLocation(TQString::tqfromLatin1("data-sources/"));
+ TQString scriptFolder;
// package could have a top-level directory or not
// it should have a directory...
const KArchiveEntry* firstEntry = archiveDir->entry(archiveDir->entries().first());
if(firstEntry->isFile()) {
copyTarget += exeInfo.baseName(true) + '/';
- if(QFile::exists(copyTarget)) {
+ if(TQFile::exists(copyTarget)) {
KURL u;
u.setPath(scriptFolder);
myLog() << "Manager::installScript() - deleting " << scriptFolder << endl;
@@ -176,7 +176,7 @@ bool Manager::installScript(const KURL& url_) {
scriptFolder = copyTarget;
} else {
scriptFolder = copyTarget + firstEntry->name() + '/';
- if(QFile::exists(copyTarget + exeFile)) {
+ if(TQFile::exists(copyTarget + exeFile)) {
info->isUpdate = true;
}
}
@@ -185,7 +185,7 @@ bool Manager::installScript(const KURL& url_) {
archiveDir->copyTo(copyTarget);
info->specFile = scriptFolder + exeInfo.baseName(true) + ".spec";
- if(!QFile::exists(info->specFile)) {
+ if(!TQFile::exists(info->specFile)) {
myDebug() << "Manager::installScript() - no spec file for script! " << info->specFile << endl;
delete info;
return false;
@@ -197,7 +197,7 @@ bool Manager::installScript(const KURL& url_) {
KURL dest;
dest.setPath(info->sourceExec);
KFileItem item(KFileItem::Unknown, KFileItem::Unknown, dest, true);
- ::chmod(QFile::encodeName(dest.path()), item.permissions() | S_IXUSR);
+ ::chmod(TQFile::encodeName(dest.path()), item.permissions() | S_IXUSR);
{
KConfig spec(info->specFile, false, false);
@@ -224,18 +224,18 @@ bool Manager::installScript(const KURL& url_) {
return true;
}
-bool Manager::removeScript(const QString& name_) {
+bool Manager::removeScript(const TQString& name_) {
KConfigGroup fileGroup(KGlobal::config(), "KNewStuffFiles");
- QStringList files = fileGroup.readListEntry(name_);
+ TQStringList files = fileGroup.readListEntry(name_);
bool success = true;
- QString path = Tellico::saveLocation(QString::fromLatin1("data-sources/"));
- for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
- if((*it).endsWith(QChar('/'))) {
+ TQString path = Tellico::saveLocation(TQString::tqfromLatin1("data-sources/"));
+ for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
+ if((*it).endsWith(TQChar('/'))) {
// ok to not delete all directories
- QDir().rmdir(path + *it);
+ TQDir().rmdir(path + *it);
} else {
- success = success && QFile(path + *it).remove();
+ success = success && TQFile(path + *it).remove();
if(!success) {
myDebug() << "Manager::removeScript() - failed to remove " << (path+*it) << endl;
}
@@ -244,22 +244,22 @@ bool Manager::removeScript(const QString& name_) {
// remove config entries even if unsuccessful
fileGroup.deleteEntry(name_);
- KConfigGroup statusGroup(KGlobal::config(), "KNewStuffStatus");
- QString entryName = statusGroup.readEntry(name_);
+ KConfigGroup statusGroup(KGlobal::config(), "KNewStufftqStatus");
+ TQString entryName = statusGroup.readEntry(name_);
statusGroup.deleteEntry(name_);
statusGroup.deleteEntry(entryName);
return success;
}
-Tellico::NewStuff::InstallStatus Manager::installStatus(KNS::Entry* entry_) {
- KConfigGroup config(KGlobal::config(), "KNewStuffStatus");
- QString datestring = config.readEntry(entry_->name());
+Tellico::NewStuff::InstalltqStatus Manager::installtqStatus(KNS::Entry* entry_) {
+ KConfigGroup config(KGlobal::config(), "KNewStufftqStatus");
+ TQString datestring = config.readEntry(entry_->name());
if(datestring.isEmpty()) {
return NotInstalled;
}
- QDate date = QDate::fromString(datestring, Qt::ISODate);
+ TQDate date = TQDate::fromString(datestring, Qt::ISODate);
if(!date.isValid()) {
return NotInstalled;
}
@@ -269,22 +269,22 @@ Tellico::NewStuff::InstallStatus Manager::installStatus(KNS::Entry* entry_) {
// also check that executable files exists
KConfigGroup fileGroup(KGlobal::config(), "KNewStuffFiles");
- QStringList files = fileGroup.readListEntry(entry_->name());
- QString path = Tellico::saveLocation(QString::fromLatin1("data-sources/"));
- for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
- if(!QFile::exists(path + *it)) {
+ TQStringList files = fileGroup.readListEntry(entry_->name());
+ TQString path = Tellico::saveLocation(TQString::tqfromLatin1("data-sources/"));
+ for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
+ if(!TQFile::exists(path + *it)) {
return NotInstalled;
}
}
return Current;
}
-QStringList Manager::archiveFiles(const KArchiveDirectory* dir_, const QString& path_) {
- QStringList list;
+TQStringList Manager::archiveFiles(const KArchiveDirectory* dir_, const TQString& path_) {
+ TQStringList list;
- const QStringList dirEntries = dir_->entries();
- for(QStringList::ConstIterator it = dirEntries.begin(); it != dirEntries.end(); ++it) {
- const QString& entry = *it;
+ const TQStringList dirEntries = dir_->entries();
+ for(TQStringList::ConstIterator it = dirEntries.begin(); it != dirEntries.end(); ++it) {
+ const TQString& entry = *it;
const KArchiveEntry* curEntry = dir_->entry(entry);
if(curEntry->isFile()) {
list += path_ + entry;
@@ -299,30 +299,30 @@ QStringList Manager::archiveFiles(const KArchiveDirectory* dir_, const QString&
}
// don't recurse, the .xsl must be in top directory
-QString Manager::findXSL(const KArchiveDirectory* dir_) {
- const QStringList entries = dir_->entries();
- for(QStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it) {
- const QString& entry = *it;
- if(entry.endsWith(QString::fromLatin1(".xsl"))) {
+TQString Manager::findXSL(const KArchiveDirectory* dir_) {
+ const TQStringList entries = dir_->entries();
+ for(TQStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it) {
+ const TQString& entry = *it;
+ if(entry.endsWith(TQString::tqfromLatin1(".xsl"))) {
return entry;
}
}
- return QString();
+ return TQString();
}
-QString Manager::findEXE(const KArchiveDirectory* dir_) {
- QPtrStack<KArchiveDirectory> dirStack;
- QValueStack<QString> dirNameStack;
+TQString Manager::findEXE(const KArchiveDirectory* dir_) {
+ TQPtrStack<KArchiveDirectory> dirStack;
+ TQValueStack<TQString> dirNameStack;
dirStack.push(dir_);
- dirNameStack.push(QString());
+ dirNameStack.push(TQString());
do {
- const QString dirName = dirNameStack.pop();
+ const TQString dirName = dirNameStack.pop();
const KArchiveDirectory* curDir = dirStack.pop();
- const QStringList entries = curDir->entries();
- for(QStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it) {
- const QString& entry = *it;
+ const TQStringList entries = curDir->entries();
+ for(TQStringList::ConstIterator it = entries.begin(); it != entries.end(); ++it) {
+ const TQString& entry = *it;
const KArchiveEntry* archEntry = curDir->entry(entry);
if(archEntry->isFile() && (archEntry->permissions() & S_IEXEC)) {
@@ -334,7 +334,7 @@ QString Manager::findEXE(const KArchiveDirectory* dir_) {
}
} while(!dirStack.isEmpty());
- return QString();
+ return TQString();
}
void Manager::install(DataType type_, KNS::Entry* entry_) {
@@ -347,14 +347,14 @@ void Manager::install(DataType type_, KNS::Entry* entry_) {
KURL destination;
destination.setPath(m_tempFile->name());
KIO::FileCopyJob* job = KIO::file_copy(entry_->payload(), destination, -1, true);
- connect(job, SIGNAL(result(KIO::Job*)), SLOT(slotDownloadJobResult(KIO::Job*)));
+ connect(job, TQT_SIGNAL(result(KIO::Job*)), TQT_SLOT(slotDownloadJobResult(KIO::Job*)));
m_jobMap.insert(job, EntryPair(entry_, type_));
}
void Manager::slotDownloadJobResult(KIO::Job* job_) {
KIO::FileCopyJob* job = static_cast<KIO::FileCopyJob*>(job_);
if(job->error()) {
- GUI::CursorSaver cs(Qt::arrowCursor);
+ GUI::CursorSaver cs(TQt::arrowCursor);
delete m_tempFile;
m_tempFile = 0;
job->showErrorDialog(Kernel::self()->widget());
@@ -372,7 +372,7 @@ void Manager::slotDownloadJobResult(KIO::Job* job_) {
#if KDE_IS_VERSION(3,3,90)
// needed so the GPG signature can be checked
NewScript* newScript = new NewScript(this, Kernel::self()->widget());
- connect(newScript, SIGNAL(installFinished()), this, SLOT(slotInstallFinished()));
+ connect(newScript, TQT_SIGNAL(installFinished()), this, TQT_SLOT(slotInstallFinished()));
// need to delete temp file if install was not a success
// if it was a success, it gets deleted later
deleteTempFile = !newScript->install(job->destURL().path());
@@ -390,16 +390,16 @@ void Manager::slotDownloadJobResult(KIO::Job* job_) {
}
void Manager::slotInstallFinished() {
- const NewScript* newScript = ::qt_cast<const NewScript*>(sender());
+ const NewScript* newScript = ::tqqt_cast<const NewScript*>(sender());
if(newScript && newScript->successfulInstall()) {
- const QString name = m_urlNameMap[newScript->url()];
+ const TQString name = m_urlNameMap[newScript->url()];
KNS::Entry* entry = m_scriptEntryMap[newScript];
- KConfigGroup config(KGlobal::config(), "KNewStuffStatus");
+ KConfigGroup config(KGlobal::config(), "KNewStufftqStatus");
// have to keep a config entry that maps the name of the file to the name
// of the newstuff entry, so we can track which entries are installed
// name and entry-name() are probably the same for scripts, but not a problem
config.writeEntry(name, entry->name());
- config.writeEntry(entry->name(), entry->releaseDate().toString(Qt::ISODate));
+ config.writeEntry(entry->name(), TQString(entry->releaseDate().toString(Qt::ISODate)));
config.sync();
emit signalInstalled(entry);
} else {
@@ -413,32 +413,32 @@ void Manager::slotInstallFinished() {
bool Manager::checkCommonFile() {
// look for a file that gets installed to know the installation directory
// need to check timestamps
- QString userDataDir = Tellico::saveLocation(QString::null);
- QString userCommonFile = userDataDir + '/' + QString::fromLatin1("tellico-common.xsl");
- if(QFile::exists(userCommonFile)) {
+ TQString userDataDir = Tellico::saveLocation(TQString());
+ TQString userCommonFile = userDataDir + '/' + TQString::tqfromLatin1("tellico-common.xsl");
+ if(TQFile::exists(userCommonFile)) {
// check timestamps
// pics/tellico.png is not likely to be in a user directory
- QString installDir = KGlobal::dirs()->findResourceDir("appdata", QString::fromLatin1("pics/tellico.png"));
- QString installCommonFile = installDir + '/' + QString::fromLatin1("tellico-common.xsl");
+ TQString installDir = KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png"));
+ TQString installCommonFile = installDir + '/' + TQString::tqfromLatin1("tellico-common.xsl");
#ifndef NDEBUG
if(userCommonFile == installCommonFile) {
kdWarning() << "Manager::checkCommonFile() - install location is same as user location" << endl;
}
#endif
- QFileInfo installInfo(installCommonFile);
- QFileInfo userInfo(userCommonFile);
+ TQFileInfo installInfo(installCommonFile);
+ TQFileInfo userInfo(userCommonFile);
if(installInfo.lastModified() > userInfo.lastModified()) {
// the installed file has been modified more recently than the user's
// remove user's tellico-common.xsl file so it gets copied again
myLog() << "Manager::checkCommonFile() - removing " << userCommonFile << endl;
myLog() << "Manager::checkCommonFile() - copying " << installCommonFile << endl;
- QFile::remove(userCommonFile);
+ TQFile::remove(userCommonFile);
} else {
return true;
}
}
KURL src, dest;
- src.setPath(KGlobal::dirs()->findResource("appdata", QString::fromLatin1("tellico-common.xsl")));
+ src.setPath(KGlobal::dirs()->findResource("appdata", TQString::tqfromLatin1("tellico-common.xsl")));
dest.setPath(userCommonFile);
return KIO::NetAccess::file_copy(src, dest);
}
diff --git a/src/newstuff/manager.h b/src/newstuff/manager.h
index 4102be3..53c6726 100644
--- a/src/newstuff/manager.h
+++ b/src/newstuff/manager.h
@@ -18,10 +18,10 @@ class KArchiveDirectory;
class KURL;
class KTempFile;
-#include <qobject.h>
-#include <qptrlist.h>
+#include <tqobject.h>
+#include <tqptrlist.h>
-class QStringList;
+class TQStringList;
namespace KNS {
class Entry;
@@ -40,7 +40,7 @@ enum DataType {
DataScript
};
-enum InstallStatus {
+enum InstalltqStatus {
NotInstalled,
OldVersion,
Current
@@ -48,29 +48,30 @@ enum InstallStatus {
struct DataSourceInfo {
DataSourceInfo() : isUpdate(false) {}
- QString specFile; // full path of .spec file
- QString sourceName;
- QString sourceExec; // full executable path of script
+ TQString specFile; // full path of .spec file
+ TQString sourceName;
+ TQString sourceExec; // full executable path of script
bool isUpdate : 1; // whether the info is for an updated source
};
-class Manager : public QObject {
+class Manager : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
- Manager(QObject* parent);
+ Manager(TQObject* tqparent);
~Manager();
void install(DataType type, KNS::Entry* entry);
- QPtrList<DataSourceInfo> dataSourceInfo() const { return m_infoList; }
+ TQPtrList<DataSourceInfo> dataSourceInfo() const { return m_infoList; }
- bool installTemplate(const KURL& url, const QString& entryName = QString::null);
- bool removeTemplate(const QString& name);
+ bool installTemplate(const KURL& url, const TQString& entryName = TQString());
+ bool removeTemplate(const TQString& name);
bool installScript(const KURL& url);
- bool removeScript(const QString& name);
+ bool removeScript(const TQString& name);
- static InstallStatus installStatus(KNS::Entry* entry);
+ static InstalltqStatus installtqStatus(KNS::Entry* entry);
static bool checkCommonFile();
signals:
@@ -81,17 +82,17 @@ private slots:
void slotInstallFinished();
private:
- static QStringList archiveFiles(const KArchiveDirectory* dir,
- const QString& path = QString::null);
+ static TQStringList archiveFiles(const KArchiveDirectory* dir,
+ const TQString& path = TQString());
- static QString findXSL(const KArchiveDirectory* dir);
- static QString findEXE(const KArchiveDirectory* dir);
+ static TQString findXSL(const KArchiveDirectory* dir);
+ static TQString findEXE(const KArchiveDirectory* dir);
- typedef QPair<KNS::Entry*, DataType> EntryPair;
- QMap<KIO::Job*, EntryPair> m_jobMap;
- QMap<KURL, QString> m_urlNameMap;
- QMap<const NewScript*, KNS::Entry*> m_scriptEntryMap;
- QPtrList<DataSourceInfo> m_infoList;
+ typedef TQPair<KNS::Entry*, DataType> EntryPair;
+ TQMap<KIO::Job*, EntryPair> m_jobMap;
+ TQMap<KURL, TQString> m_urlNameMap;
+ TQMap<const NewScript*, KNS::Entry*> m_scriptEntryMap;
+ TQPtrList<DataSourceInfo> m_infoList;
KTempFile* m_tempFile;
};
diff --git a/src/newstuff/newscript.cpp b/src/newstuff/newscript.cpp
index 045f881..e942d06 100644
--- a/src/newstuff/newscript.cpp
+++ b/src/newstuff/newscript.cpp
@@ -16,15 +16,15 @@
#include <kurl.h>
-#include <qwidget.h>
+#include <tqwidget.h>
using Tellico::NewStuff::NewScript;
-NewScript::NewScript(Manager* manager_, QWidget* parentWidget_)
+NewScript::NewScript(Manager* manager_, TQWidget* tqparentWidget_)
#if KDE_IS_VERSION(3,3,90)
- : KNewStuffSecure(QString::fromLatin1("tellico/data-source"), parentWidget_)
+ : KNewStuffSecure(TQString::tqfromLatin1("tellico/data-source"), tqparentWidget_)
#else
- : QObject(parentWidget_)
+ : TQObject(tqparentWidget_)
#endif
, m_manager(manager_), m_success(false) {
}
@@ -41,7 +41,7 @@ void NewScript::installResource() {
#include <knewstuff/knewstuffsecure.h>
#define SUPERCLASS KNewStuffSecure
#else
-#define SUPERCLASS QObject
+#define SUPERCLASS TQObject
#endif
#include "newscript.moc"
diff --git a/src/newstuff/newscript.h b/src/newstuff/newscript.h
index 8bc3154..9fd694e 100644
--- a/src/newstuff/newscript.h
+++ b/src/newstuff/newscript.h
@@ -21,10 +21,10 @@
#include <knewstuff/knewstuffsecure.h>
#define SUPERCLASS KNewStuffSecure
#else
-#define SUPERCLASS QObject
+#define SUPERCLASS TQObject
#endif
-#include <qobject.h>
+#include <tqobject.h>
namespace Tellico {
namespace NewStuff {
@@ -33,9 +33,10 @@ class Manager;
class NewScript : public SUPERCLASS {
Q_OBJECT
+ TQ_OBJECT
public:
- NewScript(Manager* manager, QWidget* parentWidget = 0);
+ NewScript(Manager* manager, TQWidget* tqparentWidget = 0);
virtual ~NewScript() {}
const KURL& url() const { return m_url; }
@@ -47,7 +48,7 @@ private:
Manager* m_manager;
#if !KDE_IS_VERSION(3,3,90)
// KNewStuffSecure has a protected variable
- QString m_tarName;
+ TQString m_tarName;
#endif
KURL m_url;
bool m_success : 1;
diff --git a/src/newstuff/providerloader.cpp b/src/newstuff/providerloader.cpp
index b3f95ae..1cad0ef 100644
--- a/src/newstuff/providerloader.cpp
+++ b/src/newstuff/providerloader.cpp
@@ -26,17 +26,17 @@
#include <kmessagebox.h>
#include <klocale.h>
-#include <qdom.h>
+#include <tqdom.h>
using Tellico::NewStuff::ProviderLoader;
-ProviderLoader::ProviderLoader( QWidget *parentWidget ) :
- mParentWidget( parentWidget ), mTryAlt(true)
+ProviderLoader::ProviderLoader( TQWidget *tqparentWidget ) :
+ mParentWidget( tqparentWidget ), mTryAlt(true)
{
mProviders.setAutoDelete( true );
}
-void ProviderLoader::load( const QString &type, const QString &providersList )
+void ProviderLoader::load( const TQString &type, const TQString &providersList )
{
mProviders.clear();
mJobData.truncate(0);
@@ -44,21 +44,21 @@ void ProviderLoader::load( const QString &type, const QString &providersList )
// myLog() << "ProviderLoader::load(): providersList: " << providersList << endl;
KIO::TransferJob *job = KIO::get( KURL( providersList ), false, false );
- connect( job, SIGNAL( result( KIO::Job * ) ),
- SLOT( slotJobResult( KIO::Job * ) ) );
- connect( job, SIGNAL( data( KIO::Job *, const QByteArray & ) ),
- SLOT( slotJobData( KIO::Job *, const QByteArray & ) ) );
- connect( job, SIGNAL( percent (KIO::Job *, unsigned long) ),
- SIGNAL( percent (KIO::Job *, unsigned long) ) );
+ connect( job, TQT_SIGNAL( result( KIO::Job * ) ),
+ TQT_SLOT( slotJobResult( KIO::Job * ) ) );
+ connect( job, TQT_SIGNAL( data( KIO::Job *, const TQByteArray & ) ),
+ TQT_SLOT( slotJobData( KIO::Job *, const TQByteArray & ) ) );
+ connect( job, TQT_SIGNAL( percent (KIO::Job *, unsigned long) ),
+ TQT_SIGNAL( percent (KIO::Job *, unsigned long) ) );
// job->dumpObjectInfo();
}
-void ProviderLoader::slotJobData( KIO::Job *, const QByteArray &data )
+void ProviderLoader::slotJobData( KIO::Job *, const TQByteArray &data )
{
if ( data.size() == 0 ) return;
- QCString str( data, data.size() + 1 );
- mJobData.append( QString::fromUtf8( str ) );
+ TQCString str( data, data.size() + 1 );
+ mJobData.append( TQString::fromUtf8( str ) );
}
void ProviderLoader::slotJobResult( KIO::Job *job )
@@ -67,29 +67,29 @@ void ProviderLoader::slotJobResult( KIO::Job *job )
job->showErrorDialog( mParentWidget );
if(mTryAlt && !mAltProvider.isEmpty()) {
mTryAlt = false;
- load(QString(), mAltProvider);
+ load(TQString(), mAltProvider);
} else {
emit error();
}
return;
}
- QDomDocument doc;
+ TQDomDocument doc;
if ( !doc.setContent( mJobData ) ) {
myDebug() << "ProviderLoader::slotJobResult() - error parsing providers list." << endl;
if(mTryAlt && !mAltProvider.isEmpty()) {
mTryAlt = false;
- load(QString(), mAltProvider);
+ load(TQString(), mAltProvider);
} else {
emit error();
}
return;
}
- QDomElement providers = doc.documentElement();
- QDomNode n;
+ TQDomElement providers = doc.documentElement();
+ TQDomNode n;
for ( n = providers.firstChild(); !n.isNull(); n = n.nextSibling() ) {
- QDomElement p = n.toElement();
+ TQDomElement p = n.toElement();
if ( p.tagName() == Latin1Literal("provider") ) {
mProviders.append( new KNS::Provider( p ) );
diff --git a/src/newstuff/providerloader.h b/src/newstuff/providerloader.h
index 3d2968c..a492dcc 100644
--- a/src/newstuff/providerloader.h
+++ b/src/newstuff/providerloader.h
@@ -21,8 +21,8 @@
#ifndef TELLICO_NEWSTUFF_PROVIDERLOADER_H
#define TELLICO_NEWSTUFF_PROVIDERLOADER_H
-#include <qobject.h>
-#include <qptrlist.h>
+#include <tqobject.h>
+#include <tqptrlist.h>
namespace KIO {
class Job;
@@ -34,15 +34,16 @@ namespace KNS {
namespace Tellico {
namespace NewStuff {
-class ProviderLoader : public QObject {
+class ProviderLoader : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor.
*
- * @param parentWidget the parent widget
+ * @param tqparentWidget the tqparent widget
*/
- ProviderLoader( QWidget *parentWidget );
+ ProviderLoader( TQWidget *tqparentWidget );
/**
* Starts asynchronously loading the list of providers of the
@@ -53,29 +54,29 @@ public:
* we first try the ProvidersUrl from KGlobal::config, then we
* fall back to a hardcoded value.
*/
- void load( const QString &type, const QString &providerList = QString::null );
+ void load( const TQString &type, const TQString &providerList = TQString() );
- void setAlternativeProvider(const QString& alt) { mAltProvider = alt; }
+ void setAlternativeProvider(const TQString& alt) { mAltProvider = alt; }
signals:
/**
* Indicates that the list of providers has been successfully loaded.
*/
- void providersLoaded( QPtrList<KNS::Provider>* );
+ void providersLoaded( TQPtrList<KNS::Provider>* );
void percent(KIO::Job *job, unsigned long percent);
void error();
protected slots:
- void slotJobData( KIO::Job *, const QByteArray & );
+ void slotJobData( KIO::Job *, const TQByteArray & );
void slotJobResult( KIO::Job * );
private:
- QWidget *mParentWidget;
+ TQWidget *mParentWidget;
- QString mJobData;
+ TQString mJobData;
- QPtrList<KNS::Provider> mProviders;
- QString mAltProvider;
+ TQPtrList<KNS::Provider> mProviders;
+ TQString mAltProvider;
bool mTryAlt;
};
diff --git a/src/progressmanager.cpp b/src/progressmanager.cpp
index a487710..ab83392 100644
--- a/src/progressmanager.cpp
+++ b/src/progressmanager.cpp
@@ -14,7 +14,7 @@
#include "progressmanager.h"
#include "tellico_debug.h"
-#include <qtimer.h>
+#include <tqtimer.h>
using Tellico::ProgressItem;
using Tellico::ProgressManager;
@@ -24,7 +24,7 @@ ProgressItem::Done::~Done() {
ProgressManager::self()->setDone(m_object);
}
-ProgressItem::ProgressItem(const QString& label_, bool canCancel_)
+ProgressItem::ProgressItem(const TQString& label_, bool canCancel_)
: m_label(label_)
, m_canCancel(canCancel_)
, m_progress(0)
@@ -56,7 +56,7 @@ void ProgressItem::setDone() {
}
emit signalDone(this);
// make sure the deleting doesn't interfere with anything
- QTimer::singleShot(3000, this, SLOT(deleteLater()));
+ TQTimer::singleShot(3000, this, TQT_SLOT(deleteLater()));
}
void ProgressItem::cancel() {
@@ -69,11 +69,11 @@ void ProgressItem::cancel() {
emit signalCancelled(this);
}
-ProgressManager::ProgressManager() : QObject() {
+ProgressManager::ProgressManager() : TQObject() {
}
-void ProgressManager::setProgress(const QObject* owner_, uint steps_) {
- if(!m_items.contains(owner_)) {
+void ProgressManager::setProgress(const TQObject* owner_, uint steps_) {
+ if(!m_items.tqcontains(owner_)) {
return;
}
@@ -82,8 +82,8 @@ void ProgressManager::setProgress(const QObject* owner_, uint steps_) {
// emit signalItemProgress(m_items[owner_]);
}
-void ProgressManager::setTotalSteps(const QObject* owner_, uint steps_) {
- if(!m_items.contains(owner_)) {
+void ProgressManager::setTotalSteps(const TQObject* owner_, uint steps_) {
+ if(!m_items.tqcontains(owner_)) {
return;
}
@@ -91,8 +91,8 @@ void ProgressManager::setTotalSteps(const QObject* owner_, uint steps_) {
// updateTotalProgress(); // called in ProgressItem::setTotalSteps()
}
-void ProgressManager::setDone(const QObject* owner_) {
- if(!m_items.contains(owner_)) {
+void ProgressManager::setDone(const TQObject* owner_) {
+ if(!m_items.tqcontains(owner_)) {
return;
}
setDone(m_items[owner_]);
@@ -120,23 +120,23 @@ void ProgressManager::slotItemDone(ProgressItem* item_) {
// emit signalItemDone(item_);
}
-ProgressItem& ProgressManager::newProgressItemImpl(const QObject* owner_,
- const QString& label_,
+ProgressItem& ProgressManager::newProgressItemImpl(const TQObject* owner_,
+ const TQString& label_,
bool canCancel_) {
// myDebug() << "ProgressManager::newProgressItem() - " << owner_->className() << ":" << label_ << endl;
- if(m_items.contains(owner_)) {
+ if(m_items.tqcontains(owner_)) {
return *m_items[owner_];
}
ProgressItem* item = new ProgressItem(label_, canCancel_);
m_items.insert(owner_, item);
- connect(item, SIGNAL(signalTotalSteps(ProgressItem*)), SLOT(slotUpdateTotalProgress()));
- connect(item, SIGNAL(signalProgress(ProgressItem*)), SLOT(slotUpdateTotalProgress()));
- connect(item, SIGNAL(signalDone(ProgressItem*)), SLOT(slotUpdateTotalProgress()));
- connect(item, SIGNAL(signalDone(ProgressItem*)), SLOT(slotItemDone(ProgressItem*)));
+ connect(item, TQT_SIGNAL(signalTotalSteps(ProgressItem*)), TQT_SLOT(slotUpdateTotalProgress()));
+ connect(item, TQT_SIGNAL(signalProgress(ProgressItem*)), TQT_SLOT(slotUpdateTotalProgress()));
+ connect(item, TQT_SIGNAL(signalDone(ProgressItem*)), TQT_SLOT(slotUpdateTotalProgress()));
+ connect(item, TQT_SIGNAL(signalDone(ProgressItem*)), TQT_SLOT(slotItemDone(ProgressItem*)));
-// connect(item, SIGNAL(signalProgress(ProgressItem*)), SIGNAL(signalItemProgress(ProgressItem*)));
+// connect(item, TQT_SIGNAL(signalProgress(ProgressItem*)), TQT_SIGNAL(signalItemProgress(ProgressItem*)));
// emit signalItemAdded(item);
return *item;
}
diff --git a/src/progressmanager.h b/src/progressmanager.h
index 5eaac3b..e82064e 100644
--- a/src/progressmanager.h
+++ b/src/progressmanager.h
@@ -17,9 +17,9 @@
#ifndef TELLICO_PROGRESSMANAGER_H
#define TELLICO_PROGRESSMANAGER_H
-#include <qobject.h>
-#include <qmap.h>
-#include <qguardedptr.h>
+#include <tqobject.h>
+#include <tqmap.h>
+#include <tqguardedptr.h>
namespace Tellico {
@@ -28,23 +28,24 @@ class ProgressManager;
/**
* @author Robby Stephenson
*/
-class ProgressItem : public QObject {
+class ProgressItem : public TQObject {
Q_OBJECT
+ TQ_OBJECT
friend class ProgressManager;
public:
class Done {
public:
- Done(const QObject* obj) : m_object(obj) {}
+ Done(const TQObject* obj) : m_object(obj) {}
~Done();
private:
- const QObject* m_object;
+ const TQObject* m_object;
};
bool canCancel() const { return m_canCancel; }
- const QString& label() const { return m_label; }
- void setLabel(const QString& label);
+ const TQString& label() const { return m_label; }
+ void setLabel(const TQString& label);
// uint progress() const { return m_total ? (100*m_completed/m_total) : 0; }
uint progress() const { return m_progress; }
@@ -63,11 +64,11 @@ signals:
protected:
/* Only to be used by the ProgressManager */
- ProgressItem(const QString& label, bool canCancel);
+ ProgressItem(const TQString& label, bool canCancel);
virtual ~ProgressItem();
private:
- QString m_label;
+ TQString m_label;
bool m_canCancel;
uint m_progress;
uint m_total;
@@ -77,21 +78,22 @@ private:
/**
* @author Robby Stephenson
*/
-class ProgressManager : public QObject {
+class ProgressManager : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
virtual ~ProgressManager() {}
static ProgressManager* self() { if(!s_self) s_self = new ProgressManager(); return s_self; }
- ProgressItem& newProgressItem(const QObject* owner, const QString& label, bool canCancel = false) {
+ ProgressItem& newProgressItem(const TQObject* owner, const TQString& label, bool canCancel = false) {
return newProgressItemImpl(owner, label, canCancel);
}
- void setProgress(const QObject* owner, uint steps);
- void setTotalSteps(const QObject* owner, uint steps);
- void setDone(const QObject* owner);
+ void setProgress(const TQObject* owner, uint steps);
+ void setTotalSteps(const TQObject* owner, uint steps);
+ void setDone(const TQObject* owner);
bool anyCanBeCancelled() const;
@@ -113,10 +115,10 @@ private:
ProgressManager();
ProgressManager(const ProgressManager&); // no copies
- ProgressItem& newProgressItemImpl(const QObject* owner, const QString& label, bool canCancel);
+ ProgressItem& newProgressItemImpl(const TQObject* owner, const TQString& label, bool canCancel);
void setDone(ProgressItem* item);
- typedef QMap<QGuardedPtr<const QObject>, QGuardedPtr<ProgressItem> > ProgressMap;
+ typedef TQMap<TQGuardedPtr<const TQObject>, TQGuardedPtr<ProgressItem> > ProgressMap;
ProgressMap m_items;
static ProgressManager* s_self;
diff --git a/src/ptrvector.h b/src/ptrvector.h
index 1dd66ea..a27c884 100644
--- a/src/ptrvector.h
+++ b/src/ptrvector.h
@@ -17,7 +17,7 @@
#include <kdebug.h>
#include <ksharedptr.h>
-#include <qvaluevector.h>
+#include <tqvaluevector.h>
namespace Tellico {
@@ -134,7 +134,7 @@ public:
m_baseVector.insert(&m_baseVector[pos.m_index], t);
}
- Iterator find(Ptr t) {
+ Iterator tqfind(Ptr t) {
for(size_t i = 0; i < count(); ++i) {
if(m_baseVector[i].data() == t) {
return Iterator(this, i);
@@ -143,16 +143,16 @@ public:
return end();
}
- bool contains(Ptr t) const { return qFind(m_baseVector.begin(), m_baseVector.end(), Ptr(t)) != m_baseVector.end(); }
+ bool tqcontains(Ptr t) const { return tqFind(m_baseVector.begin(), m_baseVector.end(), Ptr(t)) != m_baseVector.end(); }
bool remove(const Ptr& t) {
- Ptr* it = qFind(m_baseVector.begin(), m_baseVector.end(), t);
+ Ptr* it = tqFind(m_baseVector.begin(), m_baseVector.end(), t);
if(it == m_baseVector.end()) return false;
m_baseVector.erase(it);
return true;
}
private:
- QValueVector<Ptr> m_baseVector;
+ TQValueVector<Ptr> m_baseVector;
};
template <class T> class PtrVector;
@@ -259,7 +259,7 @@ public:
void push_back(T* ptr) { m_baseVector.push_back(ptr); }
bool remove(T* ptr);
bool remove(Iterator it);
- bool contains(const T* ptr) const;
+ bool tqcontains(const T* ptr) const;
private:
#ifndef NDEBUG
@@ -268,7 +268,7 @@ private:
void check(size_t) const {}
#endif
- QValueVector<T*> m_baseVector;
+ TQValueVector<T*> m_baseVector;
bool m_autoDelete : 1;
};
@@ -287,7 +287,7 @@ bool Tellico::PtrVector<T>::remove(T* t) {
if(!t) {
return false;
}
- T** ptr = qFind(m_baseVector.begin(), m_baseVector.end(), t);
+ T** ptr = tqFind(m_baseVector.begin(), m_baseVector.end(), t);
if(ptr == m_baseVector.end()) {
return false;
}
@@ -311,11 +311,11 @@ bool Tellico::PtrVector<T>::remove(Iterator it) {
}
template <class T>
-bool Tellico::PtrVector<T>::contains(const T* t) const {
+bool Tellico::PtrVector<T>::tqcontains(const T* t) const {
if(!t) {
return false;
}
- const T* const* ptr = qFind(m_baseVector.begin(), m_baseVector.end(), t);
+ const T* const* ptr = tqFind(m_baseVector.begin(), m_baseVector.end(), t);
return ptr != m_baseVector.end();
}
diff --git a/src/reportdialog.cpp b/src/reportdialog.cpp
index ee879de..cfdfe8b 100644
--- a/src/reportdialog.cpp
+++ b/src/reportdialog.cpp
@@ -35,11 +35,11 @@
#include <ksortablevaluelist.h>
#include <kfiledialog.h>
-#include <qlayout.h>
-#include <qfile.h>
-#include <qlabel.h>
-#include <qfileinfo.h>
-#include <qtimer.h>
+#include <tqlayout.h>
+#include <tqfile.h>
+#include <tqlabel.h>
+#include <tqfileinfo.h>
+#include <tqtimer.h>
namespace {
static const int REPORT_MIN_WIDTH = 600;
@@ -49,50 +49,50 @@ namespace {
using Tellico::ReportDialog;
// default button is going to be used as a print button, so it's separated
-ReportDialog::ReportDialog(QWidget* parent_, const char* name_/*=0*/)
- : KDialogBase(parent_, name_, false, i18n("Collection Report"), Close, Close),
+ReportDialog::ReportDialog(TQWidget* tqparent_, const char* name_/*=0*/)
+ : KDialogBase(tqparent_, name_, false, i18n("Collection Report"), Close, Close),
m_exporter(0) {
- QWidget* mainWidget = new QWidget(this, "ReportDialog mainWidget");
+ TQWidget* mainWidget = new TQWidget(this, "ReportDialog mainWidget");
setMainWidget(mainWidget);
- QVBoxLayout* topLayout = new QVBoxLayout(mainWidget, 0, KDialog::spacingHint());
+ TQVBoxLayout* topLayout = new TQVBoxLayout(mainWidget, 0, KDialog::spacingHint());
- QHBoxLayout* hlay = new QHBoxLayout(topLayout);
- QLabel* l = new QLabel(i18n("&Report template:"), mainWidget);
+ TQHBoxLayout* hlay = new TQHBoxLayout(topLayout);
+ TQLabel* l = new TQLabel(i18n("&Report template:"), mainWidget);
hlay->addWidget(l);
-// KStandardDirs::findAllResources(const char *type, const QString &filter, bool recursive, bool uniq)
- QStringList files = KGlobal::dirs()->findAllResources("appdata", QString::fromLatin1("report-templates/*.xsl"),
+// KStandardDirs::findAllResources(const char *type, const TQString &filter, bool recursive, bool uniq)
+ TQStringList files = KGlobal::dirs()->findAllResources("appdata", TQString::tqfromLatin1("report-templates/*.xsl"),
false, true);
- KSortableValueList<QString, QString> templates;
- for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
- QFileInfo fi(*it);
- QString file = fi.fileName();
- QString name = file.section('.', 0, -2);
- name.replace('_', ' ');
- QString title = i18n((name + QString::fromLatin1(" XSL Template")).utf8(), name.utf8());
+ KSortableValueList<TQString, TQString> templates;
+ for(TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
+ TQFileInfo fi(*it);
+ TQString file = fi.fileName();
+ TQString name = file.section('.', 0, -2);
+ name.tqreplace('_', ' ');
+ TQString title = i18n((name + TQString::tqfromLatin1(" XSL Template")).utf8(), name.utf8());
templates.insert(title, file);
}
templates.sort();
m_templateCombo = new GUI::ComboBox(mainWidget);
- for(KSortableValueList<QString, QString>::iterator it = templates.begin(); it != templates.end(); ++it) {
+ for(KSortableValueList<TQString, TQString>::iterator it = templates.begin(); it != templates.end(); ++it) {
m_templateCombo->insertItem((*it).index(), (*it).value());
}
hlay->addWidget(m_templateCombo);
l->setBuddy(m_templateCombo);
- KPushButton* pb1 = new KPushButton(SmallIconSet(QString::fromLatin1("exec")), i18n("&Generate"), mainWidget);
+ KPushButton* pb1 = new KPushButton(SmallIconSet(TQString::tqfromLatin1("exec")), i18n("&Generate"), mainWidget);
hlay->addWidget(pb1);
- connect(pb1, SIGNAL(clicked()), SLOT(slotGenerate()));
+ connect(pb1, TQT_SIGNAL(clicked()), TQT_SLOT(slotGenerate()));
hlay->addStretch();
KPushButton* pb2 = new KPushButton(KStdGuiItem::saveAs(), mainWidget);
hlay->addWidget(pb2);
- connect(pb2, SIGNAL(clicked()), SLOT(slotSaveAs()));
+ connect(pb2, TQT_SIGNAL(clicked()), TQT_SLOT(slotSaveAs()));
KPushButton* pb3 = new KPushButton(KStdGuiItem::print(), mainWidget);
hlay->addWidget(pb3);
- connect(pb3, SIGNAL(clicked()), SLOT(slotPrint()));
+ connect(pb3, TQT_SIGNAL(clicked()), TQT_SLOT(slotPrint()));
m_HTMLPart = new KHTMLPart(mainWidget);
m_HTMLPart->setJScriptEnabled(false);
@@ -101,33 +101,33 @@ ReportDialog::ReportDialog(QWidget* parent_, const char* name_/*=0*/)
m_HTMLPart->setPluginsEnabled(false);
topLayout->addWidget(m_HTMLPart->view());
- QString text = QString::fromLatin1("<html><style>p{font-weight:bold;width:50%;"
+ TQString text = TQString::tqfromLatin1("<html><style>p{font-weight:bold;width:50%;"
"margin:20% auto auto auto;text-align:center;"
- "background:white;color:%1;}</style><body><p>").arg(contrastColor.name())
+ "background:white;color:%1;}</style><body><p>").tqarg(contrastColor.name())
+ i18n("Select a report template and click <em>Generate</em>.") + ' '
+ i18n("Some reports may take several seconds to generate for large collections.");
- + QString::fromLatin1("</p></body></html>");
+ + TQString::tqfromLatin1("</p></body></html>");
m_HTMLPart->begin();
m_HTMLPart->write(text);
m_HTMLPart->end();
- setMinimumWidth(QMAX(minimumWidth(), REPORT_MIN_WIDTH));
- setMinimumHeight(QMAX(minimumHeight(), REPORT_MIN_HEIGHT));
- resize(configDialogSize(QString::fromLatin1("Report Dialog Options")));
+ setMinimumWidth(TQMAX(minimumWidth(), REPORT_MIN_WIDTH));
+ setMinimumHeight(TQMAX(minimumHeight(), REPORT_MIN_HEIGHT));
+ resize(configDialogSize(TQString::tqfromLatin1("Report Dialog Options")));
}
ReportDialog::~ReportDialog() {
delete m_exporter;
m_exporter = 0;
- saveDialogSize(QString::fromLatin1("Report Dialog Options"));
+ saveDialogSize(TQString::tqfromLatin1("Report Dialog Options"));
}
void ReportDialog::slotGenerate() {
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
- QString fileName = QString::fromLatin1("report-templates/") + m_templateCombo->currentData().toString();
- QString xsltFile = locate("appdata", fileName);
+ TQString fileName = TQString::tqfromLatin1("report-templates/") + m_templateCombo->currentData().toString();
+ TQString xsltFile = locate("appdata", fileName);
if(xsltFile.isEmpty()) {
kdWarning() << "ReportDialog::setXSLTFile() - can't locate " << m_templateCombo->currentData().toString() << endl;
return;
@@ -174,16 +174,16 @@ void ReportDialog::slotRefresh() {
m_HTMLPart->begin(u);
m_HTMLPart->write(m_exporter->text());
#if 0
- QFile f(QString::fromLatin1("/tmp/test.html"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.html"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
+ TQTextStream t(&f);
t << m_exporter->text();
}
f.close();
#endif
m_HTMLPart->end();
// is this needed?
-// view()->layout();
+// view()->tqlayout();
}
// actually the print button
@@ -192,8 +192,8 @@ void ReportDialog::slotPrint() {
}
void ReportDialog::slotSaveAs() {
- QString filter = i18n("*.html|HTML Files (*.html)") + QChar('\n') + i18n("*|All Files");
- KURL u = KFileDialog::getSaveURL(QString::null, filter, this);
+ TQString filter = i18n("*.html|HTML Files (*.html)") + TQChar('\n') + i18n("*|All Files");
+ KURL u = KFileDialog::getSaveURL(TQString(), filter, this);
if(!u.isEmpty() && u.isValid()) {
KConfigGroup config(KGlobal::config(), "ExportOptions");
bool encode = config.readBoolEntry("EncodeUTF8", true);
diff --git a/src/reportdialog.h b/src/reportdialog.h
index 758c2d6..ea0579e 100644
--- a/src/reportdialog.h
+++ b/src/reportdialog.h
@@ -31,15 +31,16 @@ namespace Tellico {
*/
class ReportDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
public:
/**
* The constructor sets up the dialog.
*
- * @param parent A pointer to the parent widget
+ * @param tqparent A pointer to the tqparent widget
* @param name The widget name
*/
- ReportDialog(QWidget* parent, const char* name=0);
+ ReportDialog(TQWidget* tqparent, const char* name=0);
virtual ~ReportDialog();
public slots:
@@ -57,7 +58,7 @@ private:
KHTMLPart* m_HTMLPart;
GUI::ComboBox* m_templateCombo;
Export::HTMLExporter* m_exporter;
- QString m_xsltFile;
+ TQString m_xsltFile;
};
} // end namespace
diff --git a/src/rtf2html/rtf2html.cpp b/src/rtf2html/rtf2html.cpp
index 4f29fe7..e6e8b34 100644
--- a/src/rtf2html/rtf2html.cpp
+++ b/src/rtf2html/rtf2html.cpp
@@ -29,11 +29,11 @@
using Tellico::RTF2HTML;
using namespace rtf;
-RTF2HTML::RTF2HTML(const QString& text) : m_text(text) {
+RTF2HTML::RTF2HTML(const TQString& text) : m_text(text) {
}
-QString RTF2HTML::toHTML() const {
- std::string str_in = m_text;
+TQString RTF2HTML::toHTML() const {
+ std::string str_in = m_text.ascii();
std::string::iterator buf_in=str_in.begin(), buf_in_end=str_in.end();
colorvect colortbl;
diff --git a/src/rtf2html/rtf2html.h b/src/rtf2html/rtf2html.h
index a4e1d2f..05e8eb1 100644
--- a/src/rtf2html/rtf2html.h
+++ b/src/rtf2html/rtf2html.h
@@ -11,18 +11,18 @@
* *
***************************************************************************/
-#include <qstring.h>
+#include <tqstring.h>
namespace Tellico {
class RTF2HTML {
public:
- RTF2HTML(const QString& text);
+ RTF2HTML(const TQString& text);
- QString toHTML() const;
+ TQString toHTML() const;
private:
- QString m_text;
+ TQString m_text;
};
}
diff --git a/src/statusbar.cpp b/src/statusbar.cpp
index a21baca..2e8ef67 100644
--- a/src/statusbar.cpp
+++ b/src/statusbar.cpp
@@ -22,49 +22,49 @@
#include <kpushbutton.h>
#include <kiconloader.h>
-#include <qobjectlist.h>
-#include <qpainter.h>
-#include <qstyle.h>
-#include <qtimer.h>
-#include <qtooltip.h>
+#include <tqobjectlist.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
+#include <tqtimer.h>
+#include <tqtooltip.h>
using Tellico::StatusBar;
StatusBar* StatusBar::s_self = 0;
-StatusBar::StatusBar(QWidget* parent_) : KStatusBar(parent_) {
+StatusBar::StatusBar(TQWidget* tqparent_) : KStatusBar(tqparent_) {
s_self = this;
// don't care about text and id
- m_mainLabel = new KStatusBarLabel(QString(), 0, this);
+ m_mainLabel = new KStatusBarLabel(TQString(), 0, this);
m_mainLabel->setIndent(4);
- m_mainLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
+ m_mainLabel->tqsetAlignment(TQt::AlignLeft | TQt::AlignVCenter);
addWidget(m_mainLabel, 3 /*stretch*/, true /*permanent*/);
- m_countLabel = new KStatusBarLabel(QString(), 1, this);
- m_countLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
+ m_countLabel = new KStatusBarLabel(TQString(), 1, this);
+ m_countLabel->tqsetAlignment(TQt::AlignLeft | TQt::AlignVCenter);
m_countLabel->setIndent(4);
addWidget(m_countLabel, 0, true);
m_progress = new GUI::Progress(100, this);
addWidget(m_progress, 1, true);
- m_cancelButton = new KPushButton(SmallIcon(QString::fromLatin1("cancel")), QString::null, this);
- QToolTip::add(m_cancelButton, i18n("Cancel"));
+ m_cancelButton = new KPushButton(SmallIcon(TQString::tqfromLatin1("cancel")), TQString(), this);
+ TQToolTip::add(m_cancelButton, i18n("Cancel"));
addWidget(m_cancelButton, 0, true);
m_progress->hide();
m_cancelButton->hide();
ProgressManager* pm = ProgressManager::self();
- connect(pm, SIGNAL(signalTotalProgress(uint)), SLOT(slotProgress(uint)));
- connect(m_cancelButton, SIGNAL(clicked()), pm, SLOT(slotCancelAll()));
+ connect(pm, TQT_SIGNAL(signalTotalProgress(uint)), TQT_SLOT(slotProgress(uint)));
+ connect(m_cancelButton, TQT_SIGNAL(clicked()), pm, TQT_SLOT(slotCancelAll()));
}
void StatusBar::polish() {
KStatusBar::polish();
int h = 0;
- QObjectList* list = queryList("QWidget", 0, false, false);
- for(QObject* o = list->first(); o; o = list->next()) {
- int _h = static_cast<QWidget*>(o)->minimumSizeHint().height();
+ TQObjectList* list = queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, false);
+ for(TQObject* o = list->first(); o; o = list->next()) {
+ int _h = TQT_TQWIDGET(o)->tqminimumSizeHint().height();
if(_h > h) {
h = _h;
}
@@ -72,23 +72,23 @@ void StatusBar::polish() {
h -= 4; // hint from amarok, it's too big usually
- for(QObject* o = list->first(); o; o = list->next()) {
- static_cast<QWidget*>(o)->setFixedHeight(h);
+ for(TQObject* o = list->first(); o; o = list->next()) {
+ TQT_TQWIDGET(o)->setFixedHeight(h);
}
delete list;
}
-void StatusBar::clearStatus() {
- setStatus(i18n("Ready."));
+void StatusBar::cleartqStatus() {
+ settqStatus(i18n("Ready."));
}
-void StatusBar::setStatus(const QString& status_) {
+void StatusBar::settqStatus(const TQString& status_) {
// always add a space for asthetics
m_mainLabel->setText(status_ + ' ');
}
-void StatusBar::setCount(const QString& count_) {
+void StatusBar::setCount(const TQString& count_) {
m_countLabel->setText(count_ + ' ');
}
@@ -110,10 +110,10 @@ void StatusBar::slotUpdate() {
/*
myDebug() << "StatusBar::slotUpdate() - " << m_progress->isShown() << endl;
if(m_progressBox->isEmpty()) {
- QTimer::singleShot(0, m_progress, SLOT(hide()));
+ TQTimer::singleShot(0, m_progress, TQT_SLOT(hide()));
// m_progressBox->hide();
} else {
- QTimer::singleShot(0, m_progress, SLOT(show()));
+ TQTimer::singleShot(0, m_progress, TQT_SLOT(show()));
// m_progressBox->show();
}
*/
diff --git a/src/statusbar.h b/src/statusbar.h
index 1ce3c39..b0d510e 100644
--- a/src/statusbar.h
+++ b/src/statusbar.h
@@ -30,11 +30,12 @@ namespace Tellico {
*/
class StatusBar : public KStatusBar {
Q_OBJECT
+ TQ_OBJECT
public:
- void clearStatus();
- void setStatus(const QString& status);
- void setCount(const QString& count);
+ void cleartqStatus();
+ void settqStatus(const TQString& status);
+ void setCount(const TQString& count);
static StatusBar* self() { return s_self; }
@@ -50,12 +51,12 @@ private:
friend class MainWindow;
- StatusBar(QWidget* parent);
+ StatusBar(TQWidget* tqparent);
KStatusBarLabel* m_mainLabel;
KStatusBarLabel* m_countLabel;
GUI::Progress* m_progress;
- QWidget* m_cancelButton;
+ TQWidget* m_cancelButton;
};
}
diff --git a/src/stringset.h b/src/stringset.h
index 47667a0..68b27d5 100644
--- a/src/stringset.h
+++ b/src/stringset.h
@@ -14,8 +14,8 @@
#ifndef TELLICO_STRINGSET_H
#define TELLICO_STRINGSET_H
-#include <qdict.h>
-#include <qstringlist.h>
+#include <tqdict.h>
+#include <tqstringlist.h>
namespace Tellico {
@@ -28,21 +28,21 @@ public:
StringSet(int size = 17) : m_dict(size) {}
// replace instead of insert, to ensure unique keys
- void add(const QString& val) { if(!val.isEmpty()) m_dict.replace(val, reinterpret_cast<const int *>(1)); }
- void add(const QStringList& vals) {
- for(QStringList::ConstIterator it = vals.begin(), end = vals.end(); it != end; ++it) {
+ void add(const TQString& val) { if(!val.isEmpty()) m_dict.tqreplace(val, reinterpret_cast<const int *>(1)); }
+ void add(const TQStringList& vals) {
+ for(TQStringList::ConstIterator it = vals.begin(), end = vals.end(); it != end; ++it) {
add(*it);
}
}
- bool remove(const QString& val) { return !val.isEmpty() && m_dict.remove(val); }
+ bool remove(const TQString& val) { return !val.isEmpty() && m_dict.remove(val); }
void clear() { m_dict.clear(); }
- bool has(const QString& val) const { return !val.isEmpty() && (m_dict.find(val) != 0); }
+ bool has(const TQString& val) const { return !val.isEmpty() && (m_dict.tqfind(val) != 0); }
bool isEmpty() const { return m_dict.isEmpty(); }
uint count() const { return m_dict.count(); }
- QStringList toList() const {
- QStringList list;
- for(QDictIterator<int> it(m_dict); it.current(); ++it) {
+ TQStringList toList() const {
+ TQStringList list;
+ for(TQDictIterator<int> it(m_dict); it.current(); ++it) {
list << it.currentKey();
}
return list;
@@ -50,7 +50,7 @@ public:
private:
// use a dict for fast random access to keep track of the values
- QDict<int> m_dict;
+ TQDict<int> m_dict;
};
}
diff --git a/src/tellico_debug.h b/src/tellico_debug.h
index ea65518..9dee1ff 100644
--- a/src/tellico_debug.h
+++ b/src/tellico_debug.h
@@ -22,22 +22,22 @@
// std::clock_t
#include <ctime>
-// linux has __GNUC_PREREQ, NetBSD has __GNUC_PREQ__
-#if defined(__GNUC_PREREQ) && !defined(__GNUC_PREREQ__)
-#define __GNUC_PREREQ__ __GNUC_PREREQ
+// linux has __GNUC_PREREQ, NetBSD has __GNUC_PRETQ__
+#if defined(__GNUC_PREREQ) && !defined(__GNUC_PRERETQ__)
+#define __GNUC_PRERETQ__ __GNUC_PREREQ
#endif
-#if !defined(__GNUC_PREREQ__)
+#if !defined(__GNUC_PRERETQ__)
#if defined __GNUC__
-#define __GNUC_PREREQ__(x, y) \
+#define __GNUC_PRERETQ__(x, y) \
((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \
(__GNUC__ > (x)))
#else
-#define __GNUC_PREREQ__(x, y) 0
+#define __GNUC_PRERETQ__(x, y) 0
#endif
#endif
-# if defined __cplusplus ? __GNUC_PREREQ__ (2, 6) : __GNUC_PREREQ__ (2, 4)
+# if defined __cplusplus ? __GNUC_PRERETQ__ (2, 6) : __GNUC_PRERETQ__ (2, 4)
# define MY_FUNCTION __PRETTY_FUNCTION__
# else
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
diff --git a/src/tellico_kernel.cpp b/src/tellico_kernel.cpp
index e0e42b5..a1f8200 100644
--- a/src/tellico_kernel.cpp
+++ b/src/tellico_kernel.cpp
@@ -46,8 +46,8 @@
using Tellico::Kernel;
Kernel* Kernel::s_self = 0;
-Kernel::Kernel(MainWindow* parent) : m_widget(parent)
- , m_commandHistory(parent->actionCollection())
+Kernel::Kernel(MainWindow* tqparent) : m_widget(tqparent)
+ , m_commandHistory(tqparent->actionCollection())
, m_commandGroup(0) {
}
@@ -55,19 +55,19 @@ const KURL& Kernel::URL() const {
return Data::Document::self()->URL();
}
-const QStringList& Kernel::fieldTitles() const {
+const TQStringList& Kernel::fieldTitles() const {
return Data::Document::self()->collection()->fieldTitles();
}
-QString Kernel::fieldNameByTitle(const QString& title_) const {
+TQString Kernel::fieldNameByTitle(const TQString& title_) const {
return Data::Document::self()->collection()->fieldNameByTitle(title_);
}
-QString Kernel::fieldTitleByName(const QString& name_) const {
+TQString Kernel::fieldTitleByName(const TQString& name_) const {
return Data::Document::self()->collection()->fieldTitleByName(name_);
}
-QStringList Kernel::valuesByFieldName(const QString& name_) const {
+TQStringList Kernel::valuesByFieldName(const TQString& name_) const {
return Data::Document::self()->collection()->valuesByFieldName(name_);
}
@@ -75,19 +75,19 @@ int Kernel::collectionType() const {
return Data::Document::self()->collection()->type();
}
-QString Kernel::collectionTypeName() const {
+TQString Kernel::collectionTypeName() const {
return Data::Document::self()->collection()->typeName();
}
-void Kernel::sorry(const QString& text_, QWidget* widget_/* =0 */) {
+void Kernel::sorry(const TQString& text_, TQWidget* widget_/* =0 */) {
if(text_.isEmpty()) {
return;
}
- GUI::CursorSaver cs(Qt::arrowCursor);
+ GUI::CursorSaver cs(TQt::arrowCursor);
KMessageBox::sorry(widget_ ? widget_ : m_widget, text_);
}
-void Kernel::beginCommandGroup(const QString& name_) {
+void Kernel::beginCommandGroup(const TQString& name_) {
if(m_commandGroup) {
myDebug() << "Kernel::beginCommandGroup() - there's an uncommitted group!" << endl;
delete m_commandGroup;
@@ -162,7 +162,7 @@ void Kernel::addEntries(Data::EntryVec entries_, bool checkFields_) {
Data::CollPtr c = Data::Document::self()->collection();
Data::FieldVec fields = entries_[0]->collection()->fields();
- QPair<Data::FieldVec, Data::FieldVec> p = mergeFields(c, fields, entries_);
+ TQPair<Data::FieldVec, Data::FieldVec> p = mergeFields(c, fields, entries_);
Data::FieldVec modifiedFields = p.first;
Data::FieldVec addedFields = p.second;
@@ -213,7 +213,7 @@ bool Kernel::addLoans(Data::EntryVec entries_) {
}
LoanDialog dlg(entries_, m_widget);
- if(dlg.exec() != QDialog::Accepted) {
+ if(dlg.exec() != TQDialog::Accepted) {
return false;
}
@@ -231,7 +231,7 @@ bool Kernel::modifyLoan(Data::LoanPtr loan_) {
}
LoanDialog dlg(loan_, m_widget);
- if(dlg.exec() != QDialog::Accepted) {
+ if(dlg.exec() != TQDialog::Accepted) {
return false;
}
@@ -269,7 +269,7 @@ bool Kernel::modifyFilter(FilterPtr filter_) {
// need to create a new filter object
FilterPtr newFilter = new Filter(*filter_);
filterDlg.setFilter(newFilter);
- if(filterDlg.exec() != QDialog::Accepted) {
+ if(filterDlg.exec() != TQDialog::Accepted) {
return false;
}
@@ -282,8 +282,8 @@ bool Kernel::removeFilter(FilterPtr filter_) {
return false;
}
- QString str = i18n("Do you really want to delete this filter?");
- QString dontAsk = QString::fromLatin1("DeleteFilter");
+ TQString str = i18n("Do you really want to delete this filter?");
+ TQString dontAsk = TQString::tqfromLatin1("DeleteFilter");
int ret = KMessageBox::questionYesNo(m_widget, str, i18n("Delete Filter?"),
KStdGuiItem::yes(), KStdGuiItem::no(), dontAsk);
if(ret != KMessageBox::Yes) {
@@ -320,7 +320,7 @@ void Kernel::replaceCollection(Data::CollPtr coll_) {
void Kernel::renameCollection() {
bool ok;
- QString newTitle = KInputDialog::getText(i18n("Rename Collection"), i18n("New collection name:"),
+ TQString newTitle = KInputDialog::getText(i18n("Rename Collection"), i18n("New collection name:"),
Data::Document::self()->collection()->title(), &ok, m_widget);
if(ok) {
doCommand(new Command::RenameCollection(Data::Document::self()->collection(), newTitle));
@@ -336,7 +336,7 @@ void Kernel::doCommand(KCommand* command_) {
}
}
-QPair<Tellico::Data::FieldVec, Tellico::Data::FieldVec> Kernel::mergeFields(Data::CollPtr coll_,
+TQPair<Tellico::Data::FieldVec, Tellico::Data::FieldVec> Kernel::mergeFields(Data::CollPtr coll_,
Data::FieldVec fields_,
Data::EntryVec entries_) {
Data::FieldVec modified, created;
@@ -345,8 +345,8 @@ QPair<Tellico::Data::FieldVec, Tellico::Data::FieldVec> Kernel::mergeFields(Data
if(coll_->hasField(field->name()) || CollectionFactory::isDefaultField(coll_->type(), field->name())) {
// special case for choice fields, since we might want to add a value
if(field->type() == Data::Field::Choice && coll_->hasField(field->name())) {
- QStringList a1 = field->allowed();
- QStringList a2 = coll_->fieldByName(field->name())->allowed();
+ TQStringList a1 = field->allowed();
+ TQStringList a2 = coll_->fieldByName(field->name())->allowed();
if(a1 != a2) {
StringSet a;
a.add(a1);
@@ -366,13 +366,13 @@ QPair<Tellico::Data::FieldVec, Tellico::Data::FieldVec> Kernel::mergeFields(Data
}
}
}
- return qMakePair(modified, created);
+ return tqMakePair(modified, created);
}
int Kernel::askAndMerge(Data::EntryPtr entry1_, Data::EntryPtr entry2_, Data::FieldPtr field_,
- QString value1_, QString value2_) {
- QString title1 = entry1_->field(QString::fromLatin1("title"));
- QString title2 = entry2_->field(QString::fromLatin1("title"));
+ TQString value1_, TQString value2_) {
+ TQString title1 = entry1_->field(TQString::tqfromLatin1("title"));
+ TQString title2 = entry2_->field(TQString::tqfromLatin1("title"));
if(title1 == title2) {
title1 = i18n("Entry 1");
title2 = i18n("Entry 2");
@@ -383,21 +383,21 @@ int Kernel::askAndMerge(Data::EntryPtr entry1_, Data::EntryPtr entry2_, Data::Fi
if(value2_.isEmpty()) {
value2_ = entry2_->field(field_);
}
- QString text = QString::fromLatin1("<qt>")
- + i18n("Conflicting values for %1 were found while merging entries.").arg(field_->title())
- + QString::fromLatin1("<br/><center><table><tr>"
+ TQString text = TQString::tqfromLatin1("<qt>")
+ + i18n("Conflicting values for %1 were found while merging entries.").tqarg(field_->title())
+ + TQString::tqfromLatin1("<br/><center><table><tr>"
"<th>%1</th>"
- "<th>%2</th></tr>").arg(title1, title2)
- + QString::fromLatin1("<tr><td><em>%1</em></td>").arg(value1_)
- + QString::fromLatin1("<td><em>%1</em></td></tr></table></center>").arg(value2_)
+ "<th>%2</th></tr>").tqarg(title1, title2)
+ + TQString::tqfromLatin1("<tr><td><em>%1</em></td>").tqarg(value1_)
+ + TQString::tqfromLatin1("<td><em>%1</em></td></tr></table></center>").tqarg(value2_)
+ i18n("Please choose which value to keep.")
- + QString::fromLatin1("</qt>");
+ + TQString::tqfromLatin1("</qt>");
int ret = KMessageBox::warningYesNoCancel(Kernel::self()->widget(),
text,
i18n("Merge Entries"),
- i18n("Select value from %1").arg(title1),
- i18n("Select value from %1").arg(title2));
+ i18n("Select value from %1").tqarg(title1),
+ i18n("Select value from %1").tqarg(title2));
switch(ret) {
case KMessageBox::Cancel: return 0;
case KMessageBox::Yes: return -1; // keep original value
diff --git a/src/tellico_kernel.h b/src/tellico_kernel.h
index ed801d6..bafa022 100644
--- a/src/tellico_kernel.h
+++ b/src/tellico_kernel.h
@@ -21,9 +21,9 @@
class KURL;
-class QWidget;
-class QString;
-class QStringList;
+class TQWidget;
+class TQString;
+class TQStringList;
namespace Tellico {
class MainWindow;
@@ -45,14 +45,14 @@ public:
/**
* Initializes the singleton. Should just be called once, from Tellico::MainWindow
*/
- static void init(MainWindow* parent) { if(!s_self) s_self = new Kernel(parent); }
+ static void init(MainWindow* tqparent) { if(!s_self) s_self = new Kernel(tqparent); }
/**
- * Returns a pointer to the parent widget. This is mainly used for error dialogs and the like.
+ * Returns a pointer to the tqparent widget. This is mainly used for error dialogs and the like.
*
* @return The widget pointer
*/
- QWidget* widget() { return m_widget; }
+ TQWidget* widget() { return m_widget; }
/**
* Returns the url of the current document.
@@ -65,29 +65,29 @@ public:
*
* @return the field titles
*/
- const QStringList& fieldTitles() const;
+ const TQStringList& fieldTitles() const;
/**
* Returns the name of an field, given its title. Wraps the call to the collection itself.
*
* @param title The field title
* @return The field name
*/
- QString fieldNameByTitle(const QString& title) const;
+ TQString fieldNameByTitle(const TQString& title) const;
/**
* Returns the title of an field, given its name. Wraps the call to the collection itself.
*
* @param name The field name
* @return The field title
*/
- QString fieldTitleByName(const QString& name) const;
- QStringList valuesByFieldName(const QString& name) const;
+ TQString fieldTitleByName(const TQString& name) const;
+ TQStringList valuesByFieldName(const TQString& name) const;
int collectionType() const;
- QString collectionTypeName() const;
+ TQString collectionTypeName() const;
- void sorry(const QString& text, QWidget* widget=0);
+ void sorry(const TQString& text, TQWidget* widget=0);
- void beginCommandGroup(const QString& name);
+ void beginCommandGroup(const TQString& name);
void endCommandGroup();
void resetHistory();
@@ -116,7 +116,7 @@ public:
// adds new fields into collection if any values in entries are not empty
// first object is modified fields, second is new fields
- QPair<Data::FieldVec, Data::FieldVec> mergeFields(Data::CollPtr coll,
+ TQPair<Data::FieldVec, Data::FieldVec> mergeFields(Data::CollPtr coll,
Data::FieldVec fields,
Data::EntryVec entries);
@@ -124,19 +124,19 @@ public:
const KCommandHistory* commandHistory() { return &m_commandHistory; }
int askAndMerge(Data::EntryPtr entry1, Data::EntryPtr entry2, Data::FieldPtr field,
- QString value1 = QString(), QString value2 = QString());
+ TQString value1 = TQString(), TQString value2 = TQString());
private:
static Kernel* s_self;
// all constructors are private
- Kernel(MainWindow* parent);
+ Kernel(MainWindow* tqparent);
Kernel(const Kernel&);
Kernel& operator=(const Kernel&);
void doCommand(KCommand* command);
- QWidget* m_widget;
+ TQWidget* m_widget;
KCommandHistory m_commandHistory;
Command::Group* m_commandGroup;
};
diff --git a/src/tellico_map.h b/src/tellico_map.h
index 75ceb32..8f41b9d 100644
--- a/src/tellico_map.h
+++ b/src/tellico_map.h
@@ -14,7 +14,7 @@
#ifndef TELLICO_MAP_H
#define TELLICO_MAP_H
-#include <qmap.h>
+#include <tqmap.h>
/**
* This file contains some template functions for maps
@@ -27,8 +27,8 @@ namespace Tellico {
* Reverse a map's keys and values
*/
template<class M>
-QMap<typename M::T, typename M::Key> flipMap(const M& map_) {
- QMap<typename M::T, typename M::Key> map;
+TQMap<typename M::T, typename M::Key> flipMap(const M& map_) {
+ TQMap<typename M::T, typename M::Key> map;
typename M::ConstIterator it = map_.begin(), end = map_.end();
for( ; it != end; ++it) {
map.insert(it.data(), it.key());
diff --git a/src/tellico_utils.cpp b/src/tellico_utils.cpp
index 6af6706..d660839 100644
--- a/src/tellico_utils.cpp
+++ b/src/tellico_utils.cpp
@@ -23,41 +23,41 @@
#include <kstandarddirs.h>
#include <kcharsets.h>
-#include <qregexp.h>
-#include <qdir.h>
-#include <qcursor.h>
-#include <qscrollview.h>
+#include <tqregexp.h>
+#include <tqdir.h>
+#include <tqcursor.h>
+#include <tqscrollview.h>
namespace {
static const int STRING_STORE_SIZE = 997; // too big, too small?
}
-QColor Tellico::contrastColor;
+TQColor Tellico::contrastColor;
-QString Tellico::decodeHTML(QString text) {
- QRegExp rx(QString::fromLatin1("&(.+);"));
+TQString Tellico::decodeHTML(TQString text) {
+ TQRegExp rx(TQString::tqfromLatin1("&(.+);"));
rx.setMinimal(true);
int pos = rx.search(text);
while(pos > -1) {
- QChar c = KCharsets::fromEntity(rx.cap(1));
+ TQChar c = KCharsets::fromEntity(rx.cap(1));
if(!c.isNull()) {
- text.replace(pos, rx.matchedLength(), c);
+ text.tqreplace(pos, rx.matchedLength(), c);
}
pos = rx.search(text, pos+1);
}
return text;
}
-QString Tellico::uid(int l, bool prefix) {
- QString uid;
+TQString Tellico::uid(int l, bool prefix) {
+ TQString uid;
if(prefix) {
- uid = QString::fromLatin1("Tellico");
+ uid = TQString::tqfromLatin1("Tellico");
}
- uid.append(kapp->randomString(QMAX(l - uid.length(), 0)));
+ uid.append(kapp->randomString(TQMAX(l - uid.length(), 0)));
return uid;
}
-uint Tellico::toUInt(const QString& s, bool* ok) {
+uint Tellico::toUInt(const TQString& s, bool* ok) {
if(s.isEmpty()) {
if(ok) {
*ok = false;
@@ -78,47 +78,47 @@ uint Tellico::toUInt(const QString& s, bool* ok) {
return s.left(idx).toUInt(ok);
}
-QString Tellico::i18nReplace(QString text) {
- // Because QDomDocument sticks in random newlines, go ahead and grab them too
- static QRegExp rx(QString::fromLatin1("(?:\\n+ *)*<i18n>([^<]*)</i18n>(?: *\\n+)*"));
+TQString Tellico::i18nReplace(TQString text) {
+ // Because TQDomDocument sticks in random newlines, go ahead and grab them too
+ static TQRegExp rx(TQString::tqfromLatin1("(?:\\n+ *)*<i18n>([^<]*)</i18n>(?: *\\n+)*"));
int pos = rx.search(text);
while(pos > -1) {
- text.replace(pos, rx.matchedLength(), i18n(rx.cap(1).utf8()));
+ text.tqreplace(pos, rx.matchedLength(), i18n(rx.cap(1).utf8()));
pos = rx.search(text, pos+rx.matchedLength());
}
return text;
}
-QStringList Tellico::findAllSubDirs(const QString& dir_) {
+TQStringList Tellico::findAllSubDirs(const TQString& dir_) {
if(dir_.isEmpty()) {
- return QStringList();
+ return TQStringList();
}
// TODO: build in symlink checking, for now, prohibit
- QDir dir(dir_, QString::null, QDir::Name | QDir::IgnoreCase, QDir::Dirs | QDir::Readable | QDir::NoSymLinks);
+ TQDir dir(dir_, TQString(), TQDir::Name | TQDir::IgnoreCase, TQDir::Dirs | TQDir::Readable | TQDir::NoSymLinks);
- QStringList allSubdirs; // the whole list
+ TQStringList allSubdirs; // the whole list
// find immediate sub directories
- const QStringList subdirs = dir.entryList();
- for(QStringList::ConstIterator subdir = subdirs.begin(); subdir != subdirs.end(); ++subdir) {
+ const TQStringList subdirs = dir.entryList();
+ for(TQStringList::ConstIterator subdir = subdirs.begin(); subdir != subdirs.end(); ++subdir) {
if((*subdir).isEmpty() || *subdir == Latin1Literal(".") || *subdir == Latin1Literal("..")) {
continue;
}
- QString absSubdir = dir.absFilePath(*subdir);
+ TQString absSubdir = dir.absFilePath(*subdir);
allSubdirs += findAllSubDirs(absSubdir);
allSubdirs += absSubdir;
}
return allSubdirs;
}
-// Based on QGDict's hash functions, Copyright (C) 1992-2000 Trolltech AS
+// Based on TQGDict's hash functions, Copyright (C) 1992-2000 Trolltech AS
// and used from Juk, Copyright (C) 2003 - 2004 by Scott Wheeler
-int Tellico::stringHash(const QString& str) {
+int Tellico::stringHash(const TQString& str) {
uint h = 0;
uint g = 0;
for(uint i = 0; i < str.length(); ++i) {
- h = (h << 4) + str.unicode()[i].cell();
+ h = (h << 4) + str.tqunicode()[i].cell();
if((g = h & 0xf0000000)) {
h ^= g >> 24;
}
@@ -129,8 +129,8 @@ int Tellico::stringHash(const QString& str) {
return index < 0 ? -index : index;
}
-QString Tellico::shareString(const QString& str) {
- static QString stringStore[STRING_STORE_SIZE];
+TQString Tellico::shareString(const TQString& str) {
+ static TQString stringStore[STRING_STORE_SIZE];
const int hash = stringHash(str) % STRING_STORE_SIZE;
if(stringStore[hash] != str) {
@@ -139,13 +139,13 @@ QString Tellico::shareString(const QString& str) {
return stringStore[hash];
}
-void Tellico::updateContrastColor(const QColorGroup& cg_) {
+void Tellico::updateContrastColor(const TQColorGroup& cg_) {
// if the value difference between background and highlight is more than ???
// use highlight, else go lighter or darker
int h1, s1, v1, h2, s2, v2;
cg_.background().getHsv(&h1, &s1, &v1);
- QColor hl = cg_.highlight();
+ TQColor hl = cg_.highlight();
hl.getHsv(&h2, &s2, &v2);
h2 += 120;
s2 = 255;
@@ -162,15 +162,15 @@ void Tellico::updateContrastColor(const QColorGroup& cg_) {
}
}
-KLibrary* Tellico::openLibrary(const QString& libName_) {
- QString path = KLibLoader::findLibrary(QFile::encodeName(libName_));
+KLibrary* Tellico::openLibrary(const TQString& libName_) {
+ TQString path = KLibLoader::findLibrary(TQFile::encodeName(libName_));
if(path.isEmpty()) {
kdWarning() << "Tellico::openLibrary() - Could not find library '" << libName_ << "'" << endl;
kdWarning() << "ERROR: " << KLibLoader::self()->lastErrorMessage() << endl;
return 0;
}
- KLibrary* library = KLibLoader::self()->library(QFile::encodeName(path));
+ KLibrary* library = KLibLoader::self()->library(TQFile::encodeName(path));
if(!library) {
kdWarning() << "Tellico::openLibrary() - Could not load library '" << libName_ << "'" << endl;
kdWarning() << " PATH: " << path << endl;
@@ -181,7 +181,7 @@ KLibrary* Tellico::openLibrary(const QString& libName_) {
return library;
}
-QColor Tellico::blendColors(const QColor& color1, const QColor& color2, int percent) {
+TQColor Tellico::blendColors(const TQColor& color1, const TQColor& color2, int percent) {
const double factor2 = percent/100.0;
const double factor1 = 1.0 - factor2;
@@ -189,20 +189,20 @@ QColor Tellico::blendColors(const QColor& color1, const QColor& color2, int perc
const int g = static_cast<int>(color1.green() * factor1 + color2.green() * factor2);
const int b = static_cast<int>(color1.blue() * factor1 + color2.blue() * factor2);
- return QColor(r, g, b);
+ return TQColor(r, g, b);
}
-QString Tellico::minutes(int seconds) {
+TQString Tellico::minutes(int seconds) {
int min = seconds / 60;
seconds = seconds % 60;
- return QString::number(min) + ':' + QString::number(seconds).rightJustify(2, '0');
+ return TQString::number(min) + ':' + TQString::number(seconds).rightJustify(2, '0');
}
-QString Tellico::saveLocation(const QString& dir_) {
+TQString Tellico::saveLocation(const TQString& dir_) {
return KGlobal::dirs()->saveLocation("appdata", dir_, true);
}
-Tellico::GUI::CursorSaver::CursorSaver(const QCursor& cursor_) : m_restored(false) {
+Tellico::GUI::CursorSaver::CursorSaver(const TQCursor& cursor_) : m_restored(false) {
kapp->setOverrideCursor(cursor_);
}
diff --git a/src/tellico_utils.h b/src/tellico_utils.h
index 13250e6..2b61fc1 100644
--- a/src/tellico_utils.h
+++ b/src/tellico_utils.h
@@ -14,16 +14,16 @@
#ifndef TELLICO_UTILS_H
#define TELLICO_UTILS_H
-#include <qnamespace.h>
+#include <tqnamespace.h>
class KLibrary;
-class QColor;
-class QColorGroup;
-class QCursor;
-class QString;
-class QStringList;
-class QScrollView;
+class TQColor;
+class TQColorGroup;
+class TQCursor;
+class TQString;
+class TQStringList;
+class TQScrollView;
/**
* This file contains utility functions.
@@ -34,40 +34,40 @@ namespace Tellico {
/**
* Decode HTML entities. Only numeric entities are handled currently.
*/
- QString decodeHTML(QString text);
+ TQString decodeHTML(TQString text);
/**
* Return a random, and almost certainly unique UID.
*
* @param length The UID starts with "Tellico" and adds enough letters to be @p length long.
*/
- QString uid(int length=20, bool prefix=true);
- uint toUInt(const QString& string, bool* ok);
+ TQString uid(int length=20, bool prefix=true);
+ uint toUInt(const TQString& string, bool* ok);
/**
* Replace all occurrences of <i18n>text</i18n> with i18n("text")
*/
- QString i18nReplace(QString text);
+ TQString i18nReplace(TQString text);
/**
* Returns a list of the subdirectories in @param dir
* Symbolic links are ignored
*/
- QStringList findAllSubDirs(const QString& dir);
- int stringHash(const QString& str);
+ TQStringList findAllSubDirs(const TQString& dir);
+ int stringHash(const TQString& str);
/** take advantage string collisions to reduce memory
*/
- QString shareString(const QString& str);
+ TQString shareString(const TQString& str);
- extern QColor contrastColor;
- void updateContrastColor(const QColorGroup& cg);
- QColor blendColors(const QColor& color1, const QColor& color2, int percent);
- QString minutes(int seconds);
- QString saveLocation(const QString& dir);
+ extern TQColor contrastColor;
+ void updateContrastColor(const TQColorGroup& cg);
+ TQColor blendColors(const TQColor& color1, const TQColor& color2, int percent);
+ TQString minutes(int seconds);
+ TQString saveLocation(const TQString& dir);
- KLibrary* openLibrary(const QString& libName);
+ KLibrary* openLibrary(const TQString& libName);
namespace GUI {
class CursorSaver {
public:
- CursorSaver(const QCursor& cursor = Qt::waitCursor);
+ CursorSaver(const TQCursor& cursor = TQt::waitCursor);
~CursorSaver();
void restore();
private:
diff --git a/src/tests/entitytest.cpp b/src/tests/entitytest.cpp
index 215c377..8163946 100644
--- a/src/tests/entitytest.cpp
+++ b/src/tests/entitytest.cpp
@@ -1,5 +1,5 @@
-#ifdef QT_NO_CAST_ASCII
-#undef QT_NO_CAST_ASCII
+#ifdef TQT_NO_CAST_ASCII
+#undef TQT_NO_CAST_ASCII
#endif
#include "tellico_utils.h"
diff --git a/src/tests/isbntest.cpp b/src/tests/isbntest.cpp
index b4c5fee..675df8e 100644
--- a/src/tests/isbntest.cpp
+++ b/src/tests/isbntest.cpp
@@ -1,5 +1,5 @@
-#ifdef QT_NO_CAST_ASCII
-#undef QT_NO_CAST_ASCII
+#ifdef TQT_NO_CAST_ASCII
+#undef TQT_NO_CAST_ASCII
#endif
#include "isbnvalidator.h"
@@ -8,7 +8,7 @@
#include <stdlib.h>
-bool check(QString a, QString b) {
+bool check(TQString a, TQString b) {
static const Tellico::ISBNValidator val(0);
val.fixup(a);
if(a == b) {
diff --git a/src/tests/latin1test.cpp b/src/tests/latin1test.cpp
index 636c33f..3550914 100644
--- a/src/tests/latin1test.cpp
+++ b/src/tests/latin1test.cpp
@@ -1,24 +1,24 @@
-#ifdef QT_NO_CAST_ASCII
-#undef QT_NO_CAST_ASCII
+#ifdef TQT_NO_CAST_ASCII
+#undef TQT_NO_CAST_ASCII
#endif
#include "latin1literal.h"
-#include <qstring.h>
+#include <tqstring.h>
#include <kdebug.h>
#include <assert.h>
int main(int, char**) {
kdDebug() << "\n*****************************************************" << endl;
- assert(QString::null == Latin1Literal(0));
- assert(QString::null != Latin1Literal(""));
- assert(QString::fromLatin1("") == Latin1Literal(""));
- assert(QString::fromLatin1("") != Latin1Literal(0));
- assert(QString::fromLatin1("x") != Latin1Literal(""));
- assert(QString::fromLatin1("a") == Latin1Literal("a"));
- assert(QString::fromLatin1("a") != Latin1Literal("b"));
- assert(QString::fromLatin1("\xe4") == Latin1Literal("\xe4"));
- assert(QString::fromUtf8("\xe2\x82\xac") != Latin1Literal("?"));
+ assert(TQString() == Latin1Literal(0));
+ assert(TQString() != Latin1Literal(""));
+ assert(TQString::tqfromLatin1("") == Latin1Literal(""));
+ assert(TQString::tqfromLatin1("") != Latin1Literal(0));
+ assert(TQString::tqfromLatin1("x") != Latin1Literal(""));
+ assert(TQString::tqfromLatin1("a") == Latin1Literal("a"));
+ assert(TQString::tqfromLatin1("a") != Latin1Literal("b"));
+ assert(TQString::tqfromLatin1("\xe4") == Latin1Literal("\xe4"));
+ assert(TQString::fromUtf8("\xe2\x82\xac") != Latin1Literal("?"));
kdDebug() << "\nLatin1Literal Test OK !" << endl;
kdDebug() << "\n*****************************************************" << endl;
diff --git a/src/translators/alexandriaexporter.cpp b/src/translators/alexandriaexporter.cpp
index 186b866..c00b54b 100644
--- a/src/translators/alexandriaexporter.cpp
+++ b/src/translators/alexandriaexporter.cpp
@@ -25,7 +25,7 @@
#include <kmessagebox.h>
#include <kapplication.h>
-#include <qdir.h>
+#include <tqdir.h>
namespace {
static const int ALEXANDRIA_MAX_SIZE_SMALL = 60;
@@ -34,12 +34,12 @@ namespace {
using Tellico::Export::AlexandriaExporter;
-QString& AlexandriaExporter::escapeText(QString& str_) {
- str_.replace('"', QString::fromLatin1("\\\""));
+TQString& AlexandriaExporter::escapeText(TQString& str_) {
+ str_.tqreplace('"', TQString::tqfromLatin1("\\\""));
return str_;
}
-QString AlexandriaExporter::formatString() const {
+TQString AlexandriaExporter::formatString() const {
return i18n("Alexandria");
}
@@ -50,10 +50,10 @@ bool AlexandriaExporter::exec() {
return false;
}
- const QString alexDirName = QString::fromLatin1(".alexandria");
+ const TQString alexDirName = TQString::tqfromLatin1(".alexandria");
// create if necessary
- QDir libraryDir = QDir::home();
+ TQDir libraryDir = TQDir::home();
if(!libraryDir.cd(alexDirName)) {
if(!libraryDir.mkdir(alexDirName) || !libraryDir.cd(alexDirName)) {
myLog() << "AlexandriaExporter::exec() - can't locate directory" << endl;
@@ -66,7 +66,7 @@ bool AlexandriaExporter::exec() {
int ret = KMessageBox::warningContinueCancel(Kernel::self()->widget(),
i18n("<qt>An Alexandria library called <i>%1</i> already exists. "
"Any existing books in that library could be overwritten.</qt>")
- .arg(coll->title()));
+ .tqarg(coll->title()));
if(ret == KMessageBox::Cancel) {
return false;
}
@@ -74,10 +74,10 @@ bool AlexandriaExporter::exec() {
return false; // could not create and cd to the dir
}
- ProgressItem& item = ProgressManager::self()->newProgressItem(this, QString::null, false);
+ ProgressItem& item = ProgressManager::self()->newProgressItem(this, TQString(), false);
item.setTotalSteps(entries().count());
ProgressItem::Done done(this);
- const uint stepSize = QMIN(1, entries().count()/100);
+ const uint stepSize = TQMIN(1, entries().count()/100);
const bool showProgress = options() & ExportProgress;
GUI::CursorSaver cs;
@@ -95,15 +95,15 @@ bool AlexandriaExporter::exec() {
// this isn't true YAML export, of course
// everything is put between quotes except for the rating, just to be sure it's interpreted as a string
-bool AlexandriaExporter::writeFile(const QDir& dir_, Data::ConstEntryPtr entry_) {
+bool AlexandriaExporter::writeFile(const TQDir& dir_, Data::ConstEntryPtr entry_) {
// the filename is the isbn without dashes, followed by .yaml
- QString isbn = entry_->field(QString::fromLatin1("isbn"));
+ TQString isbn = entry_->field(TQString::tqfromLatin1("isbn"));
if(isbn.isEmpty()) {
return false; // can't write it since Alexandria uses isbn as name of file
}
isbn.remove('-'); // remove dashes
- QFile file(dir_.absPath() + QDir::separator() + isbn + QString::fromLatin1(".yaml"));
+ TQFile file(dir_.absPath() + TQDir::separator() + isbn + TQString::tqfromLatin1(".yaml"));
if(!file.open(IO_WriteOnly)) {
return false;
}
@@ -111,13 +111,13 @@ bool AlexandriaExporter::writeFile(const QDir& dir_, Data::ConstEntryPtr entry_)
// do we format?
bool format = options() & Export::ExportFormatted;
- QTextStream ts(&file);
+ TQTextStream ts(&file);
// alexandria uses utf-8 all the time
- ts.setEncoding(QTextStream::UnicodeUTF8);
+ ts.setEncoding(TQTextStream::UnicodeUTF8);
ts << "--- !ruby/object:Alexandria::Book\n";
ts << "authors:\n";
- QStringList authors = entry_->fields(QString::fromLatin1("author"), format);
- for(QStringList::Iterator it = authors.begin(); it != authors.end(); ++it) {
+ TQStringList authors = entry_->fields(TQString::tqfromLatin1("author"), format);
+ for(TQStringList::Iterator it = authors.begin(); it != authors.end(); ++it) {
ts << " - " << escapeText(*it) << "\n";
}
// Alexandria crashes when no authors, and uses n/a when none
@@ -125,30 +125,30 @@ bool AlexandriaExporter::writeFile(const QDir& dir_, Data::ConstEntryPtr entry_)
ts << " - n/a\n";
}
- QString tmp = entry_->field(QString::fromLatin1("title"), format);
+ TQString tmp = entry_->field(TQString::tqfromLatin1("title"), format);
ts << "title: \"" << escapeText(tmp) << "\"\n";
// Alexandria refers to the binding as the edition
- tmp = entry_->field(QString::fromLatin1("binding"), format);
+ tmp = entry_->field(TQString::tqfromLatin1("binding"), format);
ts << "edition: \"" << escapeText(tmp) << "\"\n";
// sometimes Alexandria interprets the isbn as a number instead of a string
// I have no idea how to debug ruby, so err on safe side and add quotes
ts << "isbn: \"" << isbn << "\"\n";
- tmp = entry_->field(QString::fromLatin1("comments"), format);
+ tmp = entry_->field(TQString::tqfromLatin1("comments"), format);
ts << "notes: \"" << escapeText(tmp) << "\"\n";
- tmp = entry_->field(QString::fromLatin1("publisher"), format);
+ tmp = entry_->field(TQString::tqfromLatin1("publisher"), format);
// publisher uses n/a when empty
- ts << "publisher: \"" << (tmp.isEmpty() ? QString::fromLatin1("n/a") : escapeText(tmp)) << "\"\n";
+ ts << "publisher: \"" << (tmp.isEmpty() ? TQString::tqfromLatin1("n/a") : escapeText(tmp)) << "\"\n";
- tmp = entry_->field(QString::fromLatin1("pub_year"), format);
+ tmp = entry_->field(TQString::tqfromLatin1("pub_year"), format);
if(!tmp.isEmpty()) {
ts << "publishing_year: \"" << escapeText(tmp) << "\"\n";
}
- tmp = entry_->field(QString::fromLatin1("rating"));
+ tmp = entry_->field(TQString::tqfromLatin1("rating"));
bool ok;
int rating = Tellico::toUInt(tmp, &ok);
if(ok) {
@@ -157,24 +157,24 @@ bool AlexandriaExporter::writeFile(const QDir& dir_, Data::ConstEntryPtr entry_)
file.close();
- QString cover = entry_->field(QString::fromLatin1("cover"));
+ TQString cover = entry_->field(TQString::tqfromLatin1("cover"));
if(cover.isEmpty() || !(options() & Export::ExportImages)) {
return true; // all done
}
- QImage img1(ImageFactory::imageById(cover));
- QImage img2;
- QString filename = dir_.absPath() + QDir::separator() + isbn;
+ TQImage img1(ImageFactory::imageById(cover));
+ TQImage img2;
+ TQString filename = dir_.absPath() + TQDir::separator() + isbn;
if(img1.height() > ALEXANDRIA_MAX_SIZE_SMALL) {
if(img1.height() > ALEXANDRIA_MAX_SIZE_MEDIUM) { // limit maximum size
- img1 = img1.scale(ALEXANDRIA_MAX_SIZE_MEDIUM, ALEXANDRIA_MAX_SIZE_MEDIUM, QImage::ScaleMin);
+ img1 = img1.scale(ALEXANDRIA_MAX_SIZE_MEDIUM, ALEXANDRIA_MAX_SIZE_MEDIUM, TQ_ScaleMin);
}
- img2 = img1.scale(ALEXANDRIA_MAX_SIZE_SMALL, ALEXANDRIA_MAX_SIZE_SMALL, QImage::ScaleMin);
+ img2 = img1.scale(ALEXANDRIA_MAX_SIZE_SMALL, ALEXANDRIA_MAX_SIZE_SMALL, TQ_ScaleMin);
} else {
- img2 = img1.smoothScale(ALEXANDRIA_MAX_SIZE_MEDIUM, ALEXANDRIA_MAX_SIZE_MEDIUM, QImage::ScaleMin); // scale up
+ img2 = img1.smoothScale(ALEXANDRIA_MAX_SIZE_MEDIUM, ALEXANDRIA_MAX_SIZE_MEDIUM, TQ_ScaleMin); // scale up
}
- if(!img1.save(filename + QString::fromLatin1("_medium.jpg"), "JPEG")
- || !img2.save(filename + QString::fromLatin1("_small.jpg"), "JPEG")) {
+ if(!img1.save(filename + TQString::tqfromLatin1("_medium.jpg"), "JPEG")
+ || !img2.save(filename + TQString::tqfromLatin1("_small.jpg"), "JPEG")) {
return false;
}
return true;
diff --git a/src/translators/alexandriaexporter.h b/src/translators/alexandriaexporter.h
index 033bb14..cc2a368 100644
--- a/src/translators/alexandriaexporter.h
+++ b/src/translators/alexandriaexporter.h
@@ -14,7 +14,7 @@
#ifndef ALEXANDRIAEXPORTER_H
#define ALEXANDRIAEXPORTER_H
-class QDir;
+class TQDir;
#include "exporter.h"
@@ -29,21 +29,22 @@ namespace Tellico {
*/
class AlexandriaExporter : public Exporter {
Q_OBJECT
+ TQ_OBJECT
public:
AlexandriaExporter() : Exporter() {}
virtual bool exec();
- virtual QString formatString() const;
- virtual QString fileFilter() const { return QString::null; } // no need for this
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const { return TQString(); } // no need for this
// no config options
- virtual QWidget* widget(QWidget*, const char*) { return 0; }
+ virtual TQWidget* widget(TQWidget*, const char*) { return 0; }
private:
- static QString& escapeText(QString& str);
+ static TQString& escapeText(TQString& str);
- bool writeFile(const QDir& dir, Data::ConstEntryPtr entry);
+ bool writeFile(const TQDir& dir, Data::ConstEntryPtr entry);
};
} // end namespace
diff --git a/src/translators/alexandriaimporter.cpp b/src/translators/alexandriaimporter.cpp
index 5e49e86..2c67408 100644
--- a/src/translators/alexandriaimporter.cpp
+++ b/src/translators/alexandriaimporter.cpp
@@ -25,9 +25,9 @@
#include <kapplication.h>
#include <kstringhandler.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qgroupbox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqgroupbox.h>
using Tellico::Import::AlexandriaImporter;
@@ -42,42 +42,42 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() {
m_coll = new Data::BookCollection(true);
- QDir dataDir = m_libraryDir;
+ TQDir dataDir = m_libraryDir;
dataDir.cd(m_library->currentText());
- dataDir.setFilter(QDir::Files | QDir::Readable | QDir::NoSymLinks);
-
- const QString title = QString::fromLatin1("title");
- const QString author = QString::fromLatin1("author");
- const QString year = QString::fromLatin1("pub_year");
- const QString binding = QString::fromLatin1("binding");
- const QString isbn = QString::fromLatin1("isbn");
- const QString pub = QString::fromLatin1("publisher");
- const QString rating = QString::fromLatin1("rating");
- const QString cover = QString::fromLatin1("cover");
- const QString comments = QString::fromLatin1("comments");
+ dataDir.setFilter(TQDir::Files | TQDir::Readable | TQDir::NoSymLinks);
+
+ const TQString title = TQString::tqfromLatin1("title");
+ const TQString author = TQString::tqfromLatin1("author");
+ const TQString year = TQString::tqfromLatin1("pub_year");
+ const TQString binding = TQString::tqfromLatin1("binding");
+ const TQString isbn = TQString::tqfromLatin1("isbn");
+ const TQString pub = TQString::tqfromLatin1("publisher");
+ const TQString rating = TQString::tqfromLatin1("rating");
+ const TQString cover = TQString::tqfromLatin1("cover");
+ const TQString comments = TQString::tqfromLatin1("comments");
// start with yaml files
- dataDir.setNameFilter(QString::fromLatin1("*.yaml"));
- const QStringList files = dataDir.entryList();
+ dataDir.setNameFilter(TQString::tqfromLatin1("*.yaml"));
+ const TQStringList files = dataDir.entryList();
const uint numFiles = files.count();
- const uint stepSize = QMAX(s_stepSize, numFiles/100);
+ const uint stepSize = TQMAX(s_stepSize, numFiles/100);
const bool showProgress = options() & ImportProgress;
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(numFiles);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
- QStringList covers;
- covers << QString::fromLatin1(".cover")
- << QString::fromLatin1("_medium.jpg")
- << QString::fromLatin1("_small.jpg");
+ TQStringList covers;
+ covers << TQString::tqfromLatin1(".cover")
+ << TQString::tqfromLatin1("_medium.jpg")
+ << TQString::tqfromLatin1("_small.jpg");
- QTextStream ts;
- ts.setEncoding(QTextStream::UnicodeUTF8); // YAML is always utf8?
+ TQTextStream ts;
+ ts.setEncoding(TQTextStream::UnicodeUTF8); // YAML is always utf8?
uint j = 0;
- for(QStringList::ConstIterator it = files.begin(); !m_cancelled && it != files.end(); ++it, ++j) {
- QFile file(dataDir.absFilePath(*it));
+ for(TQStringList::ConstIterator it = files.begin(); !m_cancelled && it != files.end(); ++it, ++j) {
+ TQFile file(dataDir.absFilePath(*it));
if(!file.open(IO_ReadOnly)) {
continue;
}
@@ -86,8 +86,8 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() {
bool readNextLine = true;
ts.unsetDevice();
- ts.setDevice(&file);
- QString line;
+ ts.setDevice(TQT_TQIODEVICE(&file));
+ TQString line;
while(!ts.atEnd()) {
if(readNextLine) {
line = ts.readLine();
@@ -95,17 +95,17 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() {
readNextLine = true;
}
// skip the line that starts with ---
- if(line.isEmpty() || line.startsWith(QString::fromLatin1("---"))) {
+ if(line.isEmpty() || line.startsWith(TQString::tqfromLatin1("---"))) {
continue;
}
- if(line.endsWith(QChar('\\'))) {
+ if(line.endsWith(TQChar('\\'))) {
line.truncate(line.length()-1); // remove last character
line += ts.readLine();
}
cleanLine(line);
- QString alexField = line.section(':', 0, 0);
- QString alexValue = line.section(':', 1).stripWhiteSpace();
+ TQString alexField = line.section(':', 0, 0);
+ TQString alexValue = line.section(':', 1).stripWhiteSpace();
clean(alexValue);
// Alexandria uses "n/a for empty values, and it is translated
@@ -115,15 +115,15 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() {
}
if(alexField == Latin1Literal("authors")) {
- QStringList authors;
+ TQStringList authors;
line = ts.readLine();
- QRegExp begin(QString::fromLatin1("^\\s*-\\s+"));
- while(!line.isNull() && line.find(begin) > -1) {
+ TQRegExp begin(TQString::tqfromLatin1("^\\s*-\\s+"));
+ while(!line.isNull() && line.tqfind(begin) > -1) {
line.remove(begin);
authors += clean(line);
line = ts.readLine();
}
- entry->setField(author, authors.join(QString::fromLatin1("; ")));
+ entry->setField(author, authors.join(TQString::tqfromLatin1("; ")));
// the next line has already been read
readNextLine = false;
@@ -146,12 +146,12 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() {
// now find cover image
KURL u;
alexValue.remove('-');
- for(QStringList::Iterator ext = covers.begin(); ext != covers.end(); ++ext) {
+ for(TQStringList::Iterator ext = covers.begin(); ext != covers.end(); ++ext) {
u.setPath(dataDir.absFilePath(alexValue + *ext));
- if(!QFile::exists(u.path())) {
+ if(!TQFile::exists(u.path())) {
continue;
}
- QString id = ImageFactory::addImage(u, true);
+ TQString id = ImageFactory::addImage(u, true);
if(!id.isEmpty()) {
entry->setField(cover, id);
break;
@@ -179,27 +179,27 @@ Tellico::Data::CollPtr AlexandriaImporter::collection() {
return m_coll;
}
-QWidget* AlexandriaImporter::widget(QWidget* parent_, const char* name_/*=0*/) {
+TQWidget* AlexandriaImporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) {
if(m_widget) {
return m_widget;
}
- m_libraryDir = QDir::home();
- m_libraryDir.setFilter(QDir::Dirs | QDir::Readable | QDir::NoSymLinks);
+ m_libraryDir = TQDir::home();
+ m_libraryDir.setFilter(TQDir::Dirs | TQDir::Readable | TQDir::NoSymLinks);
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* box = new QGroupBox(2, Qt::Horizontal, i18n("Alexandria Options"), m_widget);
- QLabel* label = new QLabel(i18n("&Library:"), box);
+ TQGroupBox* box = new TQGroupBox(2, Qt::Horizontal, i18n("Alexandria Options"), m_widget);
+ TQLabel* label = new TQLabel(i18n("&Library:"), box);
m_library = new KComboBox(box);
label->setBuddy(m_library);
// .alexandria might not exist
- if(m_libraryDir.cd(QString::fromLatin1(".alexandria"))) {
- QStringList dirs = m_libraryDir.entryList();
- dirs.remove(QString::fromLatin1(".")); // why can't I tell QDir not to include these? QDir::Hidden doesn't work
- dirs.remove(QString::fromLatin1(".."));
+ if(m_libraryDir.cd(TQString::tqfromLatin1(".alexandria"))) {
+ TQStringList dirs = m_libraryDir.entryList();
+ dirs.remove(TQString::tqfromLatin1(".")); // why can't I tell TQDir not to include these? TQDir::Hidden doesn't work
+ dirs.remove(TQString::tqfromLatin1(".."));
m_library->insertStringList(dirs);
}
@@ -208,44 +208,44 @@ QWidget* AlexandriaImporter::widget(QWidget* parent_, const char* name_/*=0*/) {
return m_widget;
}
-QString& AlexandriaImporter::cleanLine(QString& str_) {
- static QRegExp escRx(QString::fromLatin1("\\\\x(\\w\\w)"), false);
- str_.remove(QString::fromLatin1("\\r"));
- str_.replace(QString::fromLatin1("\\n"), QString::fromLatin1("\n"));
- str_.replace(QString::fromLatin1("\\t"), QString::fromLatin1("\t"));
+TQString& AlexandriaImporter::cleanLine(TQString& str_) {
+ static TQRegExp escRx(TQString::tqfromLatin1("\\\\x(\\w\\w)"), false);
+ str_.remove(TQString::tqfromLatin1("\\r"));
+ str_.tqreplace(TQString::tqfromLatin1("\\n"), TQString::tqfromLatin1("\n"));
+ str_.tqreplace(TQString::tqfromLatin1("\\t"), TQString::tqfromLatin1("\t"));
// YAML uses escape sequences like \xC3
int pos = escRx.search(str_);
int origPos = pos;
- QCString bytes;
+ TQCString bytes;
while(pos > -1) {
bool ok;
char c = escRx.cap(1).toInt(&ok, 16);
if(ok) {
bytes += c;
} else {
- bytes = QCString();
+ bytes = TQCString();
break;
}
pos = escRx.search(str_, pos+1);
}
if(!bytes.isEmpty()) {
- str_.replace(origPos, bytes.length()*4, QString::fromUtf8(bytes.data()));
+ str_.tqreplace(origPos, bytes.length()*4, TQString::fromUtf8(bytes.data()));
}
return str_;
}
-QString& AlexandriaImporter::clean(QString& str_) {
- const QRegExp quote(QString::fromLatin1("\\\\\"")); // equals \"
- if(str_.startsWith(QChar('\'')) || str_.startsWith(QChar('"'))) {
+TQString AlexandriaImporter::clean(TQString& str_) {
+ const TQRegExp quote(TQString::tqfromLatin1("\\\\\"")); // equals \"
+ if(str_.startsWith(TQChar('\'')) || str_.startsWith(TQChar('"'))) {
str_.remove(0, 1);
}
- if(str_.endsWith(QChar('\'')) || str_.endsWith(QChar('"'))) {
+ if(str_.endsWith(TQChar('\'')) || str_.endsWith(TQChar('"'))) {
str_.truncate(str_.length()-1);
}
// we ignore YAML tags, this is not actually a good parser, but will do for now
- str_.remove(QRegExp(QString::fromLatin1("^![^\\s]*\\s+")));
- return str_.replace(quote, QChar('"'));
+ str_.remove(TQRegExp(TQString::tqfromLatin1("^![^\\s]*\\s+")));
+ return str_.tqreplace(quote, TQChar('"'));
}
void AlexandriaImporter::slotCancel() {
diff --git a/src/translators/alexandriaimporter.h b/src/translators/alexandriaimporter.h
index 2c12923..9bec25d 100644
--- a/src/translators/alexandriaimporter.h
+++ b/src/translators/alexandriaimporter.h
@@ -19,7 +19,7 @@ class KComboBox;
#include "importer.h"
#include "../datavectors.h"
-#include <qdir.h>
+#include <tqdir.h>
namespace Tellico {
namespace Import {
@@ -35,6 +35,7 @@ namespace Tellico {
*/
class AlexandriaImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -49,21 +50,21 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
virtual bool canImport(int type) const;
public slots:
void slotCancel();
private:
- static QString& cleanLine(QString& str);
- static QString& clean(QString& str);
+ static TQString& cleanLine(TQString& str);
+ static TQString clean(TQString& str);
Data::CollPtr m_coll;
- QWidget* m_widget;
+ TQWidget* m_widget;
KComboBox* m_library;
- QDir m_libraryDir;
+ TQDir m_libraryDir;
bool m_cancelled : 1;
};
diff --git a/src/translators/amcimporter.cpp b/src/translators/amcimporter.cpp
index 8e45cb7..399d7a7 100644
--- a/src/translators/amcimporter.cpp
+++ b/src/translators/amcimporter.cpp
@@ -25,13 +25,13 @@
#include <kapplication.h>
-#include <qfile.h>
-#include <qimage.h>
+#include <tqfile.h>
+#include <tqimage.h>
#include <limits.h>
namespace {
- static const QCString AMC_FILE_ID = " AMC_X.Y Ant Movie Catalog 3.5.x www.buypin.com www.antp.be ";
+ static const TQCString AMC_FILE_ID = " AMC_X.Y Ant Movie Catalog 3.5.x www.buypin.com www.antp.be ";
}
using Tellico::Import::AMCImporter;
@@ -55,24 +55,24 @@ Tellico::Data::CollPtr AMCImporter::collection() {
return 0;
}
- QIODevice* f = fileRef().file();
+ TQIODevice* f = fileRef().file();
m_ds.setDevice(f);
// AMC is always little-endian? can't confirm
- m_ds.setByteOrder(QDataStream::LittleEndian);
+ m_ds.setByteOrder(TQDataStream::LittleEndian);
const uint l = AMC_FILE_ID.length();
- QMemArray<char> buffer(l+1);
+ TQMemArray<char> buffer(l+1);
m_ds.readRawBytes(buffer.data(), l);
- QString version = QString::fromLocal8Bit(buffer, l);
- QRegExp versionRx(QString::fromLatin1(".+AMC_(\\d+)\\.(\\d+).+"));
- if(version.find(versionRx) == -1) {
+ TQString version = TQString::fromLocal8Bit(buffer, l);
+ TQRegExp versionRx(TQString::tqfromLatin1(".+AMC_(\\d+)\\.(\\d+).+"));
+ if(version.tqfind(versionRx) == -1) {
myDebug() << "AMCImporter::collection() - no file id match" << endl;
return 0;
}
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(f->size());
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
m_coll = new Data::VideoCollection(true);
@@ -103,13 +103,13 @@ Tellico::Data::CollPtr AMCImporter::collection() {
}
bool AMCImporter::readBool() {
- Q_UINT8 b;
+ TQ_UINT8 b;
m_ds >> b;
return b;
}
-Q_UINT32 AMCImporter::readInt() {
- Q_UINT32 i;
+TQ_UINT32 AMCImporter::readInt() {
+ TQ_UINT32 i;
m_ds >> i;
if(i >= UINT_MAX) {
i = 0;
@@ -117,39 +117,39 @@ Q_UINT32 AMCImporter::readInt() {
return i;
}
-QString AMCImporter::readString() {
+TQString AMCImporter::readString() {
// The serialization format is a length specifier first, then l bytes of data
uint l = readInt();
if(l == 0) {
- return QString();
+ return TQString();
}
- QMemArray<char> buffer(l+1);
+ TQMemArray<char> buffer(l+1);
m_ds.readRawBytes(buffer.data(), l);
- QString s = QString::fromLocal8Bit(buffer, l);
+ TQString s = TQString::fromLocal8Bit(buffer, l);
// myDebug() << "string: " << s << endl;
return s;
}
-QString AMCImporter::readImage(const QString& format_) {
+TQString AMCImporter::readImage(const TQString& format_) {
uint l = readInt();
if(l == 0) {
- return QString();
+ return TQString();
}
- QMemArray<char> buffer(l+1);
+ TQMemArray<char> buffer(l+1);
m_ds.readRawBytes(buffer.data(), l);
- QByteArray bytes;
+ TQByteArray bytes;
bytes.setRawData(buffer.data(), l);
- QImage img(bytes);
+ TQImage img(bytes);
bytes.resetRawData(buffer.data(), l);
if(img.isNull()) {
myDebug() << "AMCImporter::readImage() - null image" << endl;
- return QString();
+ return TQString();
}
- QString format = QString::fromLatin1("PNG");
+ TQString format = TQString::tqfromLatin1("PNG");
if(format_ == Latin1Literal(".jpg")) {
- format = QString::fromLatin1("JPEG");
+ format = TQString::tqfromLatin1("JPEG");
} else if(format_ == Latin1Literal(".gif")) {
- format = QString::fromLatin1("GIF");
+ format = TQString::tqfromLatin1("GIF");
}
return ImageFactory::addImage(img, format);
}
@@ -167,14 +167,14 @@ void AMCImporter::readEntry() {
if(m_majVersion >= 3 && m_minVersion >= 5) {
rating /= 10;
}
- e->setField(QString::fromLatin1("rating"), QString::number(rating));
+ e->setField(TQString::tqfromLatin1("rating"), TQString::number(rating));
int year = readInt();
if(year > 0) {
- e->setField(QString::fromLatin1("year"), QString::number(year));
+ e->setField(TQString::tqfromLatin1("year"), TQString::number(year));
}
int time = readInt();
if(time > 0) {
- e->setField(QString::fromLatin1("running-time"), QString::number(time));
+ e->setField(TQString::tqfromLatin1("running-time"), TQString::number(time));
}
readInt(); // video bitrate
@@ -182,73 +182,73 @@ void AMCImporter::readEntry() {
readInt(); // number of files
readBool(); // checked
readString(); // media label
- e->setField(QString::fromLatin1("medium"), readString());
+ e->setField(TQString::tqfromLatin1("medium"), readString());
readString(); // source
readString(); // borrower
- QString s = readString(); // title
+ TQString s = readString(); // title
if(!s.isEmpty()) {
- e->setField(QString::fromLatin1("title"), s);
+ e->setField(TQString::tqfromLatin1("title"), s);
}
- QString s2 = readString(); // translated title
+ TQString s2 = readString(); // translated title
if(s.isEmpty()) {
- e->setField(QString::fromLatin1("title"), s2);
+ e->setField(TQString::tqfromLatin1("title"), s2);
}
- e->setField(QString::fromLatin1("director"), readString());
+ e->setField(TQString::tqfromLatin1("director"), readString());
s = readString();
- QRegExp roleRx(QString::fromLatin1("(.+) \\(([^(]+)\\)"));
+ TQRegExp roleRx(TQString::tqfromLatin1("(.+) \\(([^(]+)\\)"));
roleRx.setMinimal(true);
- if(s.find(roleRx) > -1) {
- QString role = roleRx.cap(2).lower();
+ if(s.tqfind(roleRx) > -1) {
+ TQString role = roleRx.cap(2).lower();
if(role == Latin1Literal("story") || role == Latin1Literal("written by")) {
- e->setField(QString::fromLatin1("writer"), roleRx.cap(1));
+ e->setField(TQString::tqfromLatin1("writer"), roleRx.cap(1));
} else {
- e->setField(QString::fromLatin1("producer"), s);
+ e->setField(TQString::tqfromLatin1("producer"), s);
}
} else {
- e->setField(QString::fromLatin1("producer"), s);
+ e->setField(TQString::tqfromLatin1("producer"), s);
}
- e->setField(QString::fromLatin1("nationality"), readString());
- e->setField(QString::fromLatin1("genre"), readString().replace(QString::fromLatin1(", "), QString::fromLatin1("; ")));
+ e->setField(TQString::tqfromLatin1("nationality"), readString());
+ e->setField(TQString::tqfromLatin1("genre"), readString().tqreplace(TQString::tqfromLatin1(", "), TQString::tqfromLatin1("; ")));
- e->setField(QString::fromLatin1("cast"), parseCast(readString()).join(QString::fromLatin1("; ")));
+ e->setField(TQString::tqfromLatin1("cast"), parseCast(readString()).join(TQString::tqfromLatin1("; ")));
readString(); // url
- e->setField(QString::fromLatin1("plot"), readString());
- e->setField(QString::fromLatin1("comments"), readString());
+ e->setField(TQString::tqfromLatin1("plot"), readString());
+ e->setField(TQString::tqfromLatin1("comments"), readString());
s = readString(); // video format
- QRegExp regionRx(QString::fromLatin1("Region \\d"));
- if(s.find(regionRx) > -1) {
- e->setField(QString::fromLatin1("region"), regionRx.cap(0));
+ TQRegExp regionRx(TQString::tqfromLatin1("Region \\d"));
+ if(s.tqfind(regionRx) > -1) {
+ e->setField(TQString::tqfromLatin1("region"), regionRx.cap(0));
}
- e->setField(QString::fromLatin1("audio-track"), readString()); // audio format
+ e->setField(TQString::tqfromLatin1("audio-track"), readString()); // audio format
readString(); // resolution
readString(); // frame rate
- e->setField(QString::fromLatin1("language"), readString()); // audio language
- e->setField(QString::fromLatin1("subtitle"), readString()); // subtitle
+ e->setField(TQString::tqfromLatin1("language"), readString()); // audio language
+ e->setField(TQString::tqfromLatin1("subtitle"), readString()); // subtitle
readString(); // file size
s = readString(); // picture extension
s = readImage(s); // picture
if(!s.isEmpty()) {
- e->setField(QString::fromLatin1("cover"), s);
+ e->setField(TQString::tqfromLatin1("cover"), s);
}
m_coll->addEntries(e);
}
-QStringList AMCImporter::parseCast(const QString& text_) {
- QStringList cast;
+TQStringList AMCImporter::parseCast(const TQString& text_) {
+ TQStringList cast;
int nPar = 0;
- QRegExp castRx(QString::fromLatin1("[,()]"));
- QString person, role;
+ TQRegExp castRx(TQString::tqfromLatin1("[,()]"));
+ TQString person, role;
int oldPos = 0;
- for(int pos = text_.find(castRx); pos > -1; pos = text_.find(castRx, pos+1)) {
+ for(int pos = text_.tqfind(castRx); pos > -1; pos = text_.tqfind(castRx, pos+1)) {
if(text_.at(pos) == ',' && nPar%2 == 0) {
// we're done with this one
person += text_.mid(oldPos, pos-oldPos).stripWhiteSpace();
- QString all = person;
+ TQString all = person;
if(!role.isEmpty()) {
- if(role.startsWith(QString::fromLatin1("as "))) {
+ if(role.startsWith(TQString::tqfromLatin1("as "))) {
role = role.mid(3);
}
all += "::" + role;
@@ -260,14 +260,14 @@ QStringList AMCImporter::parseCast(const QString& text_) {
} else if(text_.at(pos) == '(') {
if(nPar == 0) {
person = text_.mid(oldPos, pos-oldPos).stripWhiteSpace();
- oldPos = pos+1; // add one to go past parenthesis
+ oldPos = pos+1; // add one to go past tqparenthesis
}
++nPar;
} else if(text_.at(pos) == ')') {
--nPar;
if(nPar == 0) {
role = text_.mid(oldPos, pos-oldPos).stripWhiteSpace();
- oldPos = pos+1; // add one to go past parenthesis
+ oldPos = pos+1; // add one to go past tqparenthesis
}
}
}
@@ -275,9 +275,9 @@ QStringList AMCImporter::parseCast(const QString& text_) {
if(nPar%2 == 0) {
int pos = text_.length();
person += text_.mid(oldPos, pos-oldPos).stripWhiteSpace();
- QString all = person;
+ TQString all = person;
if(!role.isEmpty()) {
- if(role.startsWith(QString::fromLatin1("as "))) {
+ if(role.startsWith(TQString::tqfromLatin1("as "))) {
role = role.mid(3);
}
all += "::" + role;
diff --git a/src/translators/amcimporter.h b/src/translators/amcimporter.h
index d1b9d1a..7151140 100644
--- a/src/translators/amcimporter.h
+++ b/src/translators/amcimporter.h
@@ -24,6 +24,7 @@ namespace Tellico {
*/
class AMCImporter : public DataImporter {
Q_OBJECT
+ TQ_OBJECT
public:
AMCImporter(const KURL& url);
virtual ~AMCImporter();
@@ -36,15 +37,15 @@ public slots:
private:
bool readBool();
- Q_UINT32 readInt();
- QString readString();
- QString readImage(const QString& format);
+ TQ_UINT32 readInt();
+ TQString readString();
+ TQString readImage(const TQString& format);
void readEntry();
- QStringList parseCast(const QString& text);
+ TQStringList parseCast(const TQString& text);
Data::CollPtr m_coll;
bool m_cancelled : 1;
- QDataStream m_ds;
+ TQDataStream m_ds;
int m_majVersion;
int m_minVersion;
};
diff --git a/src/translators/audiofileimporter.cpp b/src/translators/audiofileimporter.cpp
index f825964..0d23fa5 100644
--- a/src/translators/audiofileimporter.cpp
+++ b/src/translators/audiofileimporter.cpp
@@ -37,12 +37,12 @@
#include <klocale.h>
#include <kapplication.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qvgroupbox.h>
-#include <qcheckbox.h>
-#include <qdir.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqvgroupbox.h>
+#include <tqcheckbox.h>
+#include <tqdir.h>
+#include <tqwhatsthis.h>
using Tellico::Import::AudioFileImporter;
@@ -67,11 +67,11 @@ Tellico::Data::CollPtr AudioFileImporter::collection() {
ProgressItem& item = ProgressManager::self()->newProgressItem(this, i18n("Scanning audio files..."), true);
item.setTotalSteps(100);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
// TODO: allow remote audio file importing
- QStringList dirs = url().path();
+ TQStringList dirs = url().path();
if(m_recursive->isChecked()) {
dirs += Tellico::findAllSubDirs(dirs[0]);
}
@@ -82,16 +82,16 @@ Tellico::Data::CollPtr AudioFileImporter::collection() {
const bool showProgress = options() & ImportProgress;
- QStringList files;
- for(QStringList::ConstIterator it = dirs.begin(); !m_cancelled && it != dirs.end(); ++it) {
+ TQStringList files;
+ for(TQStringList::ConstIterator it = dirs.begin(); !m_cancelled && it != dirs.end(); ++it) {
if((*it).isEmpty()) {
continue;
}
- QDir dir(*it);
- dir.setFilter(QDir::Files | QDir::Readable | QDir::Hidden); // hidden since I want directory files
- const QStringList list = dir.entryList();
- for(QStringList::ConstIterator it2 = list.begin(); it2 != list.end(); ++it2) {
+ TQDir dir(*it);
+ dir.setFilter(TQDir::Files | TQDir::Readable | TQDir::Hidden); // hidden since I want directory files
+ const TQStringList list = dir.entryList();
+ for(TQStringList::ConstIterator it2 = list.begin(); it2 != list.end(); ++it2) {
files += dir.absFilePath(*it2);
}
// kapp->processEvents(); not needed ?
@@ -102,13 +102,13 @@ Tellico::Data::CollPtr AudioFileImporter::collection() {
}
item.setTotalSteps(files.count());
- const QString title = QString::fromLatin1("title");
- const QString artist = QString::fromLatin1("artist");
- const QString year = QString::fromLatin1("year");
- const QString genre = QString::fromLatin1("genre");
- const QString track = QString::fromLatin1("track");
- const QString comments = QString::fromLatin1("comments");
- const QString file = QString::fromLatin1("file");
+ const TQString title = TQString::tqfromLatin1("title");
+ const TQString artist = TQString::tqfromLatin1("artist");
+ const TQString year = TQString::tqfromLatin1("year");
+ const TQString genre = TQString::tqfromLatin1("genre");
+ const TQString track = TQString::tqfromLatin1("track");
+ const TQString comments = TQString::tqfromLatin1("comments");
+ const TQString file = TQString::tqfromLatin1("file");
m_coll = new Data::MusicCollection(true);
@@ -122,52 +122,52 @@ Tellico::Data::CollPtr AudioFileImporter::collection() {
f = new Data::Field(file, i18n("Files"), Data::Field::Table);
m_coll->addField(f);
}
- f->setProperty(QString::fromLatin1("column1"), i18n("Files"));
+ f->setProperty(TQString::tqfromLatin1("column1"), i18n("Files"));
if(addBitrate) {
- f->setProperty(QString::fromLatin1("columns"), QChar('2'));
- f->setProperty(QString::fromLatin1("column2"), i18n("Bitrate"));
+ f->setProperty(TQString::tqfromLatin1("columns"), TQChar('2'));
+ f->setProperty(TQString::tqfromLatin1("column2"), i18n("Bitrate"));
} else {
- f->setProperty(QString::fromLatin1("columns"), QChar('1'));
+ f->setProperty(TQString::tqfromLatin1("columns"), TQChar('1'));
}
}
- QMap<QString, Data::EntryPtr> albumMap;
+ TQMap<TQString, Data::EntryPtr> albumMap;
- QStringList directoryFiles;
- const uint stepSize = QMAX(static_cast<size_t>(1), files.count() / 100);
+ TQStringList directoryFiles;
+ const uint stepSize = TQMAX(static_cast<size_t>(1), files.count() / 100);
bool changeTrackTitle = true;
uint j = 0;
- for(QStringList::ConstIterator it = files.begin(); !m_cancelled && it != files.end(); ++it, ++j) {
- TagLib::FileRef f(QFile::encodeName(*it));
+ for(TQStringList::ConstIterator it = files.begin(); !m_cancelled && it != files.end(); ++it, ++j) {
+ TagLib::FileRef f(TQFile::encodeName(*it));
if(f.isNull() || !f.tag()) {
- if((*it).endsWith(QString::fromLatin1("/.directory"))) {
+ if((*it).endsWith(TQString::tqfromLatin1("/.directory"))) {
directoryFiles += *it;
}
continue;
}
TagLib::Tag* tag = f.tag();
- QString album = TStringToQString(tag->album()).stripWhiteSpace();
+ TQString album = TQString(TStringToQString(tag->album())).stripWhiteSpace();
if(album.isEmpty()) {
// can't do anything since tellico entries are by album
kdWarning() << "Skipping: no album listed for " << *it << endl;
continue;
}
int disc = discNumber(f);
- if(disc > 1 && !m_coll->hasField(QString::fromLatin1("track%1").arg(disc))) {
- Data::FieldPtr f2 = new Data::Field(QString::fromLatin1("track%1").arg(disc),
- i18n("Tracks (Disc %1)").arg(disc),
+ if(disc > 1 && !m_coll->hasField(TQString::tqfromLatin1("track%1").tqarg(disc))) {
+ Data::FieldPtr f2 = new Data::Field(TQString::tqfromLatin1("track%1").tqarg(disc),
+ i18n("Tracks (Disc %1)").tqarg(disc),
Data::Field::Table);
f2->setFormatFlag(Data::Field::FormatTitle);
- f2->setProperty(QString::fromLatin1("columns"), QChar('3'));
- f2->setProperty(QString::fromLatin1("column1"), i18n("Title"));
- f2->setProperty(QString::fromLatin1("column2"), i18n("Artist"));
- f2->setProperty(QString::fromLatin1("column3"), i18n("Length"));
+ f2->setProperty(TQString::tqfromLatin1("columns"), TQChar('3'));
+ f2->setProperty(TQString::tqfromLatin1("column1"), i18n("Title"));
+ f2->setProperty(TQString::tqfromLatin1("column2"), i18n("Artist"));
+ f2->setProperty(TQString::tqfromLatin1("column3"), i18n("Length"));
m_coll->addField(f2);
if(changeTrackTitle) {
Data::FieldPtr newTrack = new Data::Field(*m_coll->fieldByName(track));
- newTrack->setTitle(i18n("Tracks (Disc %1)").arg(1));
+ newTrack->setTitle(i18n("Tracks (Disc %1)").tqarg(1));
m_coll->modifyField(newTrack);
changeTrackTitle = false;
}
@@ -182,7 +182,7 @@ Tellico::Data::CollPtr AudioFileImporter::collection() {
}
// album entries use the album name as the title
entry->setField(title, album);
- QString a = TStringToQString(tag->artist()).stripWhiteSpace();
+ TQString a = TQString(TStringToQString(tag->artist())).stripWhiteSpace();
if(!a.isEmpty()) {
if(exists && entry->field(artist).lower() != a.lower()) {
various = true;
@@ -192,18 +192,18 @@ Tellico::Data::CollPtr AudioFileImporter::collection() {
}
}
if(tag->year() > 0) {
- entry->setField(year, QString::number(tag->year()));
+ entry->setField(year, TQString::number(tag->year()));
}
if(!tag->genre().isEmpty()) {
- entry->setField(genre, TStringToQString(tag->genre()).stripWhiteSpace());
+ entry->setField(genre, TQString(TStringToQString(tag->genre())).stripWhiteSpace());
}
if(!tag->title().isEmpty()) {
int trackNum = tag->track();
if(trackNum <= 0) { // try to figure out track number from file name
- QFileInfo f(*it);
- QString fileName = f.baseName();
- QString numString;
+ TQFileInfo f(*it);
+ TQString fileName = f.baseName();
+ TQString numString;
int i = 0;
const int len = fileName.length();
while(fileName[i].isNumber() && i < len) {
@@ -228,18 +228,18 @@ Tellico::Data::CollPtr AudioFileImporter::collection() {
}
}
if(trackNum > 0) {
- QString t = TStringToQString(tag->title()).stripWhiteSpace();
+ TQString t = TQString(TStringToQString(tag->title())).stripWhiteSpace();
t += "::" + a;
const int len = f.audioProperties()->length();
if(len > 0) {
t += "::" + Tellico::minutes(len);
}
- QString realTrack = disc > 1 ? track + QString::number(disc) : track;
+ TQString realTrack = disc > 1 ? track + TQString::number(disc) : track;
entry->setField(realTrack, insertValue(entry->field(realTrack), t, trackNum));
if(addFile) {
- QString fileValue = *it;
+ TQString fileValue = *it;
if(addBitrate) {
- fileValue += "::" + QString::number(f.audioProperties()->bitrate());
+ fileValue += "::" + TQString::number(f.audioProperties()->bitrate());
}
entry->setField(file, insertValue(entry->field(file), fileValue, trackNum));
}
@@ -250,14 +250,14 @@ Tellico::Data::CollPtr AudioFileImporter::collection() {
myDebug() << *it << " has an empty title, so the track is not imported." << endl;
}
if(!tag->comment().stripWhiteSpace().isEmpty()) {
- QString c = entry->field(comments);
+ TQString c = entry->field(comments);
if(!c.isEmpty()) {
- c += QString::fromLatin1("<br/>");
+ c += TQString::tqfromLatin1("<br/>");
}
if(!tag->title().isEmpty()) {
- c += QString::fromLatin1("<em>") + TStringToQString(tag->title()).stripWhiteSpace() + QString::fromLatin1("</em> - ");
+ c += TQString::tqfromLatin1("<em>") + TQString(TStringToQString(tag->title())).stripWhiteSpace() + TQString::tqfromLatin1("</em> - ");
}
- c += TStringToQString(tag->comment().stripWhiteSpace()).stripWhiteSpace();
+ c += TQString(TStringToQString(tag->comment().stripWhiteSpace())).stripWhiteSpace();
entry->setField(comments, c);
}
@@ -285,31 +285,31 @@ Tellico::Data::CollPtr AudioFileImporter::collection() {
return 0;
}
- QTextStream ts;
- QRegExp iconRx(QString::fromLatin1("Icon\\s*=\\s*(.*)"));
- for(QStringList::ConstIterator it = directoryFiles.begin(); !m_cancelled && it != directoryFiles.end(); ++it, ++j) {
- QFile file(*it);
+ TQTextStream ts;
+ TQRegExp iconRx(TQString::tqfromLatin1("Icon\\s*=\\s*(.*)"));
+ for(TQStringList::ConstIterator it = directoryFiles.begin(); !m_cancelled && it != directoryFiles.end(); ++it, ++j) {
+ TQFile file(*it);
if(!file.open(IO_ReadOnly)) {
continue;
}
ts.unsetDevice();
- ts.setDevice(&file);
- for(QString line = ts.readLine(); !line.isNull(); line = ts.readLine()) {
+ ts.setDevice(TQT_TQIODEVICE(&file));
+ for(TQString line = ts.readLine(); !line.isNull(); line = ts.readLine()) {
if(!iconRx.exactMatch(line)) {
continue;
}
- QDir thisDir(*it);
+ TQDir thisDir(*it);
thisDir.cdUp();
- QFileInfo fi(thisDir, iconRx.cap(1));
+ TQFileInfo fi(thisDir, iconRx.cap(1));
Data::EntryPtr entry = albumMap[thisDir.dirName()];
if(!entry) {
continue;
}
KURL u;
u.setPath(fi.absFilePath());
- QString id = ImageFactory::addImage(u, true);
+ TQString id = ImageFactory::addImage(u, true);
if(!id.isEmpty()) {
- entry->setField(QString::fromLatin1("cover"), id);
+ entry->setField(TQString::tqfromLatin1("cover"), id);
}
break;
}
@@ -329,28 +329,28 @@ Tellico::Data::CollPtr AudioFileImporter::collection() {
#endif
}
-QWidget* AudioFileImporter::widget(QWidget* parent_, const char* name_) {
+TQWidget* AudioFileImporter::widget(TQWidget* tqparent_, const char* name_) {
if(m_widget) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QVGroupBox* box = new QVGroupBox(i18n("Audio File Options"), m_widget);
+ TQVGroupBox* box = new TQVGroupBox(i18n("Audio File Options"), m_widget);
- m_recursive = new QCheckBox(i18n("Recursive &folder search"), box);
- QWhatsThis::add(m_recursive, i18n("If checked, folders are recursively searched for audio files."));
+ m_recursive = new TQCheckBox(i18n("Recursive &folder search"), box);
+ TQWhatsThis::add(m_recursive, i18n("If checked, folders are recursively searched for audio files."));
// by default, make it checked
m_recursive->setChecked(true);
- m_addFilePath = new QCheckBox(i18n("Include file &location"), box);
- QWhatsThis::add(m_addFilePath, i18n("If checked, the file names for each track are added to the entries."));
+ m_addFilePath = new TQCheckBox(i18n("Include file &location"), box);
+ TQWhatsThis::add(m_addFilePath, i18n("If checked, the file names for each track are added to the entries."));
m_addFilePath->setChecked(false);
- connect(m_addFilePath, SIGNAL(toggled(bool)), SLOT(slotAddFileToggled(bool)));
+ connect(m_addFilePath, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotAddFileToggled(bool)));
- m_addBitrate = new QCheckBox(i18n("Include &bitrate"), box);
- QWhatsThis::add(m_addBitrate, i18n("If checked, the bitrate for each track is added to the entries."));
+ m_addBitrate = new TQCheckBox(i18n("Include &bitrate"), box);
+ TQWhatsThis::add(m_addBitrate, i18n("If checked, the bitrate for each track is added to the entries."));
m_addBitrate->setChecked(false);
m_addBitrate->setEnabled(false);
@@ -360,10 +360,10 @@ QWidget* AudioFileImporter::widget(QWidget* parent_, const char* name_) {
}
// pos_ is NOT zero-indexed!
-QString AudioFileImporter::insertValue(const QString& str_, const QString& value_, uint pos_) {
- QStringList list = Data::Field::split(str_, true);
+TQString AudioFileImporter::insertValue(const TQString& str_, const TQString& value_, uint pos_) {
+ TQStringList list = Data::Field::split(str_, true);
for(uint i = list.count(); i < pos_; ++i) {
- list += QString::null;
+ list += TQString();
}
if(!list[pos_-1].isNull()) {
myDebug() << "AudioFileImporter::insertValue() - overwriting track " << pos_ << endl;
@@ -371,7 +371,7 @@ QString AudioFileImporter::insertValue(const QString& str_, const QString& value
myDebug() << "*** New value: " << value_ << endl;
}
list[pos_-1] = value_;
- return list.join(QString::fromLatin1("; "));
+ return list.join(TQString::tqfromLatin1("; "));
}
void AudioFileImporter::slotCancel() {
@@ -389,23 +389,23 @@ int AudioFileImporter::discNumber(const TagLib::FileRef& ref_) const {
// default to 1 unless otherwise
int num = 1;
#ifdef HAVE_TAGLIB
- QString disc;
+ TQString disc;
if(TagLib::MPEG::File* file = dynamic_cast<TagLib::MPEG::File*>(ref_.file())) {
if(file->ID3v2Tag() && !file->ID3v2Tag()->frameListMap()["TPOS"].isEmpty()) {
- disc = TStringToQString(file->ID3v2Tag()->frameListMap()["TPOS"].front()->toString()).stripWhiteSpace();
+ disc = TQString(TStringToQString(file->ID3v2Tag()->frameListMap()["TPOS"].front()->toString())).stripWhiteSpace();
}
} else if(TagLib::Ogg::Vorbis::File* file = dynamic_cast<TagLib::Ogg::Vorbis::File*>(ref_.file())) {
if(file->tag() && !file->tag()->fieldListMap()["DISCNUMBER"].isEmpty()) {
- disc = TStringToQString(file->tag()->fieldListMap()["DISCNUMBER"].front()).stripWhiteSpace();
+ disc = TQString(TStringToQString(file->tag()->fieldListMap()["DISCNUMBER"].front())).stripWhiteSpace();
}
} else if(TagLib::FLAC::File* file = dynamic_cast<TagLib::FLAC::File*>(ref_.file())) {
if(file->xiphComment() && !file->xiphComment()->fieldListMap()["DISCNUMBER"].isEmpty()) {
- disc = TStringToQString(file->xiphComment()->fieldListMap()["DISCNUMBER"].front()).stripWhiteSpace();
+ disc = TQString(TStringToQString(file->xiphComment()->fieldListMap()["DISCNUMBER"].front())).stripWhiteSpace();
}
}
if(!disc.isEmpty()) {
- int pos = disc.find('/');
+ int pos = disc.tqfind('/');
int n;
bool ok;
if(pos == -1) {
diff --git a/src/translators/audiofileimporter.h b/src/translators/audiofileimporter.h
index d9c0c9a..5733860 100644
--- a/src/translators/audiofileimporter.h
+++ b/src/translators/audiofileimporter.h
@@ -14,7 +14,7 @@
#ifndef AUDIOFILEIMPORTER_H
#define AUDIOFILEIMPORTER_H
-class QCheckBox;
+class TQCheckBox;
#include "importer.h"
#include "../datavectors.h"
@@ -33,6 +33,7 @@ namespace Tellico {
*/
class AudioFileImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -44,7 +45,7 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
virtual bool canImport(int type) const;
public slots:
@@ -52,15 +53,15 @@ public slots:
void slotAddFileToggled(bool on);
private:
- static QString insertValue(const QString& str, const QString& value, uint pos);
+ static TQString insertValue(const TQString& str, const TQString& value, uint pos);
int discNumber(const TagLib::FileRef& file) const;
Data::CollPtr m_coll;
- QWidget* m_widget;
- QCheckBox* m_recursive;
- QCheckBox* m_addFilePath;
- QCheckBox* m_addBitrate;
+ TQWidget* m_widget;
+ TQCheckBox* m_recursive;
+ TQCheckBox* m_addFilePath;
+ TQCheckBox* m_addBitrate;
bool m_cancelled : 1;
};
diff --git a/src/translators/bibtexexporter.cpp b/src/translators/bibtexexporter.cpp
index 2706ac8..d1aa57b 100644
--- a/src/translators/bibtexexporter.cpp
+++ b/src/translators/bibtexexporter.cpp
@@ -28,13 +28,13 @@
#include <kconfig.h>
#include <kcombobox.h>
-#include <qregexp.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qwhatsthis.h>
-#include <qlabel.h>
-#include <qhbox.h>
+#include <tqregexp.h>
+#include <tqcheckbox.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqwhatsthis.h>
+#include <tqlabel.h>
+#include <tqhbox.h>
using Tellico::Export::BibtexExporter;
@@ -45,12 +45,12 @@ BibtexExporter::BibtexExporter() : Tellico::Export::Exporter(),
m_widget(0) {
}
-QString BibtexExporter::formatString() const {
+TQString BibtexExporter::formatString() const {
return i18n("Bibtex");
}
-QString BibtexExporter::fileFilter() const {
- return i18n("*.bib|Bibtex Files (*.bib)") + QChar('\n') + i18n("*|All Files");
+TQString BibtexExporter::fileFilter() const {
+ return i18n("*.bib|Bibtex Files (*.bib)") + TQChar('\n') + i18n("*|All Files");
}
bool BibtexExporter::exec() {
@@ -62,19 +62,19 @@ bool BibtexExporter::exec() {
// there are some special attributes
// the entry-type specifies the entry type - book, inproceedings, whatever
- QString typeField;
+ TQString typeField;
// the key specifies the cite-key
- QString keyField;
+ TQString keyField;
// the crossref bibtex field can reference another entry
- QString crossRefField;
+ TQString crossRefField;
bool hasCrossRefs = false;
- const QString bibtex = QString::fromLatin1("bibtex");
+ const TQString bibtex = TQString::tqfromLatin1("bibtex");
// keep a list of all the 'ordinary' fields to iterate through later
Data::FieldVec fields;
Data::FieldVec vec = coll->fields();
for(Data::FieldVec::Iterator it = vec.begin(); it != vec.end(); ++it) {
- QString bibtexField = it->property(bibtex);
+ TQString bibtexField = it->property(bibtex);
if(bibtexField == Latin1Literal("entry-type")) {
typeField = it->name();
} else if(bibtexField == Latin1Literal("key")) {
@@ -98,24 +98,24 @@ bool BibtexExporter::exec() {
return false;
}
- QString text = QString::fromLatin1("@comment{Generated by Tellico ")
- + QString::fromLatin1(VERSION)
- + QString::fromLatin1("}\n\n");
+ TQString text = TQString::tqfromLatin1("@comment{Generated by Tellico ")
+ + TQString::tqfromLatin1(VERSION)
+ + TQString::tqfromLatin1("}\n\n");
if(!coll->preamble().isEmpty()) {
- text += QString::fromLatin1("@preamble{") + coll->preamble() + QString::fromLatin1("}\n\n");
+ text += TQString::tqfromLatin1("@preamble{") + coll->preamble() + TQString::tqfromLatin1("}\n\n");
}
- const QStringList macros = coll->macroList().keys();
+ const TQStringList macros = coll->macroList().keys();
if(!m_expandMacros) {
- QMap<QString, QString>::ConstIterator macroIt;
+ TQMap<TQString, TQString>::ConstIterator macroIt;
for(macroIt = coll->macroList().constBegin(); macroIt != coll->macroList().constEnd(); ++macroIt) {
if(!macroIt.data().isEmpty()) {
- text += QString::fromLatin1("@string{")
+ text += TQString::tqfromLatin1("@string{")
+ macroIt.key()
- + QString::fromLatin1("=")
+ + TQString::tqfromLatin1("=")
+ BibtexHandler::exportText(macroIt.data(), macros)
- + QString::fromLatin1("}\n\n");
+ + TQString::tqfromLatin1("}\n\n");
}
}
}
@@ -132,7 +132,7 @@ bool BibtexExporter::exec() {
StringSet usedKeys;
Data::ConstEntryVec crossRefs;
- QString type, key, newKey, value;
+ TQString type, key, newKey, value;
for(Data::EntryVec::ConstIterator entryIt = entries().begin(); entryIt != entries().end(); ++entryIt) {
type = entryIt->field(typeField);
if(type.isEmpty()) {
@@ -190,41 +190,41 @@ bool BibtexExporter::exec() {
return FileHandler::writeTextURL(url(), text, options() & ExportUTF8, options() & Export::ExportForce);
}
-QWidget* BibtexExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
- if(m_widget && m_widget->parent() == parent_) {
+TQWidget* BibtexExporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) {
+ if(m_widget && TQT_BASE_OBJECT(m_widget->tqparent()) == TQT_BASE_OBJECT(tqparent_)) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* box = new QGroupBox(1, Qt::Horizontal, i18n("Bibtex Options"), m_widget);
+ TQGroupBox* box = new TQGroupBox(1, Qt::Horizontal, i18n("Bibtex Options"), m_widget);
l->addWidget(box);
- m_checkExpandMacros = new QCheckBox(i18n("Expand string macros"), box);
+ m_checkExpandMacros = new TQCheckBox(i18n("Expand string macros"), box);
m_checkExpandMacros->setChecked(m_expandMacros);
- QWhatsThis::add(m_checkExpandMacros, i18n("If checked, the string macros will be expanded and no "
+ TQWhatsThis::add(m_checkExpandMacros, i18n("If checked, the string macros will be expanded and no "
"@string{} entries will be written."));
- m_checkPackageURL = new QCheckBox(i18n("Use URL package"), box);
+ m_checkPackageURL = new TQCheckBox(i18n("Use URL package"), box);
m_checkPackageURL->setChecked(m_packageURL);
- QWhatsThis::add(m_checkPackageURL, i18n("If checked, any URL fields will be wrapped in a "
+ TQWhatsThis::add(m_checkPackageURL, i18n("If checked, any URL fields will be wrapped in a "
"\\url declaration."));
- m_checkSkipEmpty = new QCheckBox(i18n("Skip entries with empty citation keys"), box);
+ m_checkSkipEmpty = new TQCheckBox(i18n("Skip entries with empty citation keys"), box);
m_checkSkipEmpty->setChecked(m_skipEmptyKeys);
- QWhatsThis::add(m_checkSkipEmpty, i18n("If checked, any entries without a bibtex citation key "
+ TQWhatsThis::add(m_checkSkipEmpty, i18n("If checked, any entries without a bibtex citation key "
"will be skipped."));
- QHBox* hbox = new QHBox(box);
- QLabel* l1 = new QLabel(i18n("Bibtex quotation style:") + ' ', hbox); // add a space for astheticss
+ TQHBox* hbox = new TQHBox(box);
+ TQLabel* l1 = new TQLabel(i18n("Bibtex quotation style:") + ' ', hbox); // add a space for astheticss
m_cbBibtexStyle = new KComboBox(hbox);
m_cbBibtexStyle->insertItem(i18n("Braces"));
m_cbBibtexStyle->insertItem(i18n("Quotes"));
- QString whats = i18n("<qt>The quotation style used when exporting bibtex. All field values will "
+ TQString whats = i18n("<qt>The quotation style used when exporting bibtex. All field values will "
" be escaped with either braces or quotation marks.</qt>");
- QWhatsThis::add(l1, whats);
- QWhatsThis::add(m_cbBibtexStyle, whats);
+ TQWhatsThis::add(l1, whats);
+ TQWhatsThis::add(m_cbBibtexStyle, whats);
if(BibtexHandler::s_quoteStyle == BibtexHandler::BRACES) {
m_cbBibtexStyle->setCurrentItem(i18n("Braces"));
} else {
@@ -236,7 +236,7 @@ QWidget* BibtexExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
}
void BibtexExporter::readOptions(KConfig* config_) {
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_expandMacros = group.readBoolEntry("Expand Macros", m_expandMacros);
m_packageURL = group.readBoolEntry("URL Package", m_packageURL);
m_skipEmptyKeys = group.readBoolEntry("Skip Empty Keys", m_skipEmptyKeys);
@@ -244,12 +244,12 @@ void BibtexExporter::readOptions(KConfig* config_) {
if(group.readBoolEntry("Use Braces", true)) {
BibtexHandler::s_quoteStyle = BibtexHandler::BRACES;
} else {
- BibtexHandler::s_quoteStyle = BibtexHandler::QUOTES;
+ BibtexHandler::s_quoteStyle = BibtexHandler::TQUOTES;
}
}
void BibtexExporter::saveOptions(KConfig* config_) {
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_expandMacros = m_checkExpandMacros->isChecked();
group.writeEntry("Expand Macros", m_expandMacros);
m_packageURL = m_checkPackageURL->isChecked();
@@ -262,19 +262,19 @@ void BibtexExporter::saveOptions(KConfig* config_) {
if(useBraces) {
BibtexHandler::s_quoteStyle = BibtexHandler::BRACES;
} else {
- BibtexHandler::s_quoteStyle = BibtexHandler::QUOTES;
+ BibtexHandler::s_quoteStyle = BibtexHandler::TQUOTES;
}
}
-void BibtexExporter::writeEntryText(QString& text_, const Data::FieldVec& fields_, const Data::Entry& entry_,
- const QString& type_, const QString& key_) {
- const QStringList macros = static_cast<const Data::BibtexCollection*>(Data::Document::self()->collection().data())->macroList().keys();
- const QString bibtex = QString::fromLatin1("bibtex");
- const QString bibtexSep = QString::fromLatin1("bibtex-separator");
+void BibtexExporter::writeEntryText(TQString& text_, const Data::FieldVec& fields_, const Data::Entry& entry_,
+ const TQString& type_, const TQString& key_) {
+ const TQStringList macros = static_cast<const Data::BibtexCollection*>(Data::Document::self()->collection().data())->macroList().keys();
+ const TQString bibtex = TQString::tqfromLatin1("bibtex");
+ const TQString bibtexSep = TQString::tqfromLatin1("bibtex-separator");
text_ += '@' + type_ + '{' + key_;
- QString value;
+ TQString value;
Data::FieldVec::ConstIterator fIt, end = fields_.constEnd();
bool format = options() & Export::ExportFormatted;
for(fIt = fields_.constBegin(); fIt != end; ++fIt) {
@@ -287,40 +287,40 @@ void BibtexExporter::writeEntryText(QString& text_, const Data::FieldVec& fields
// insert "and" in between them (e.g. author and editor)
if(fIt->formatFlag() == Data::Field::FormatName
&& fIt->flags() & Data::Field::AllowMultiple) {
- value.replace(Data::Field::delimiter(), QString::fromLatin1(" and "));
+ value.tqreplace(Data::Field::delimiter(), TQString::tqfromLatin1(" and "));
} else if(fIt->flags() & Data::Field::AllowMultiple) {
- QString bibsep = fIt->property(bibtexSep);
+ TQString bibsep = fIt->property(bibtexSep);
if(!bibsep.isEmpty()) {
- value.replace(Data::Field::delimiter(), bibsep);
+ value.tqreplace(Data::Field::delimiter(), bibsep);
}
} else if(fIt->type() == Data::Field::Para) {
// strip HTML from bibtex export
- QRegExp stripHTML(QString::fromLatin1("<.*>"), true);
+ TQRegExp stripHTML(TQString::tqfromLatin1("<.*>"), true);
stripHTML.setMinimal(true);
value.remove(stripHTML);
} else if(fIt->property(bibtex) == Latin1Literal("pages")) {
- QRegExp rx(QString::fromLatin1("(\\d)-(\\d)"));
+ TQRegExp rx(TQString::tqfromLatin1("(\\d)-(\\d)"));
for(int pos = rx.search(value); pos > -1; pos = rx.search(value, pos+2)) {
- value.replace(pos, 3, rx.cap(1)+"--"+rx.cap(2));
+ value.tqreplace(pos, 3, rx.cap(1)+"--"+rx.cap(2));
}
}
if(m_packageURL && fIt->type() == Data::Field::URL) {
bool b = BibtexHandler::s_quoteStyle == BibtexHandler::BRACES;
- value = (b ? QChar('{') : QChar('"'))
- + QString::fromLatin1("\\url{") + BibtexHandler::exportText(value, macros) + QChar('}')
- + (b ? QChar('}') : QChar('"'));
+ value = (b ? TQChar('{') : TQChar('"'))
+ + TQString::tqfromLatin1("\\url{") + BibtexHandler::exportText(value, macros) + TQChar('}')
+ + (b ? TQChar('}') : TQChar('"'));
} else if(fIt->type() != Data::Field::Number) {
// numbers aren't escaped, nor will they have macros
// if m_expandMacros is true, then macros is empty, so this is ok even then
value = BibtexHandler::exportText(value, macros);
}
- text_ += QString::fromLatin1(",\n ")
+ text_ += TQString::tqfromLatin1(",\n ")
+ fIt->property(bibtex)
- + QString::fromLatin1(" = ")
+ + TQString::tqfromLatin1(" = ")
+ value;
}
- text_ += QString::fromLatin1("\n}\n\n");
+ text_ += TQString::tqfromLatin1("\n}\n\n");
}
#include "bibtexexporter.moc"
diff --git a/src/translators/bibtexexporter.h b/src/translators/bibtexexporter.h
index dccfde8..b626e88 100644
--- a/src/translators/bibtexexporter.h
+++ b/src/translators/bibtexexporter.h
@@ -14,7 +14,7 @@
#ifndef BIBTEXEXPORTER_H
#define BIBTEXEXPORTER_H
-class QCheckBox;
+class TQCheckBox;
class KComboBox;
#include "exporter.h"
@@ -31,30 +31,31 @@ namespace Tellico {
*/
class BibtexExporter : public Exporter {
Q_OBJECT
+ TQ_OBJECT
public:
BibtexExporter();
virtual bool exec();
- virtual QString formatString() const;
- virtual QString fileFilter() const;
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const;
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
virtual void readOptions(KConfig*);
virtual void saveOptions(KConfig*);
private:
- void writeEntryText(QString& text, const Data::FieldVec& field, const Data::Entry& entry,
- const QString& type, const QString& key);
+ void writeEntryText(TQString& text, const Data::FieldVec& field, const Data::Entry& entry,
+ const TQString& type, const TQString& key);
bool m_expandMacros;
bool m_packageURL;
bool m_skipEmptyKeys;
- QWidget* m_widget;
- QCheckBox* m_checkExpandMacros;
- QCheckBox* m_checkPackageURL;
- QCheckBox* m_checkSkipEmpty;
+ TQWidget* m_widget;
+ TQCheckBox* m_checkExpandMacros;
+ TQCheckBox* m_checkPackageURL;
+ TQCheckBox* m_checkSkipEmpty;
KComboBox* m_cbBibtexStyle;
};
diff --git a/src/translators/bibtexhandler.cpp b/src/translators/bibtexhandler.cpp
index 8c88e43..e6c07fa 100644
--- a/src/translators/bibtexhandler.cpp
+++ b/src/translators/bibtexhandler.cpp
@@ -26,10 +26,10 @@
#include <kstringhandler.h>
#include <klocale.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qregexp.h>
-#include <qdom.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
+#include <tqdom.h>
// don't add braces around capital letters by default
#define TELLICO_BIBTEX_BRACES 0
@@ -38,12 +38,12 @@ using Tellico::BibtexHandler;
BibtexHandler::StringListMap* BibtexHandler::s_utf8LatexMap = 0;
BibtexHandler::QuoteStyle BibtexHandler::s_quoteStyle = BibtexHandler::BRACES;
-const QRegExp BibtexHandler::s_badKeyChars(QString::fromLatin1("[^0-9a-zA-Z-]"));
+const TQRegExp BibtexHandler::s_badKeyChars(TQString::tqfromLatin1("[^0-9a-zA-Z-]"));
-QStringList BibtexHandler::bibtexKeys(const Data::EntryVec& entries_) {
- QStringList keys;
+TQStringList BibtexHandler::bibtexKeys(const Data::EntryVec& entries_) {
+ TQStringList keys;
for(Data::EntryVec::ConstIterator it = entries_.begin(); it != entries_.end(); ++it) {
- QString s = bibtexKey(it.data());
+ TQString s = bibtexKey(it.data());
if(!s.isEmpty()) {
keys << s;
}
@@ -51,47 +51,47 @@ QStringList BibtexHandler::bibtexKeys(const Data::EntryVec& entries_) {
return keys;
}
-QString BibtexHandler::bibtexKey(Data::ConstEntryPtr entry_) {
+TQString BibtexHandler::bibtexKey(Data::ConstEntryPtr entry_) {
if(!entry_ || !entry_->collection() || entry_->collection()->type() != Data::Collection::Bibtex) {
- return QString::null;
+ return TQString();
}
const Data::BibtexCollection* c = static_cast<const Data::BibtexCollection*>(entry_->collection().data());
- Data::FieldPtr f = c->fieldByBibtexName(QString::fromLatin1("key"));
+ Data::FieldPtr f = c->fieldByBibtexName(TQString::tqfromLatin1("key"));
if(f) {
- QString key = entry_->field(f->name());
+ TQString key = entry_->field(f->name());
if(!key.isEmpty()) {
return key;
}
}
- QString author;
- Data::FieldPtr authorField = c->fieldByBibtexName(QString::fromLatin1("author"));
+ TQString author;
+ Data::FieldPtr authorField = c->fieldByBibtexName(TQString::tqfromLatin1("author"));
if(authorField) {
if(authorField->flags() & Data::Field::AllowMultiple) {
// grab first author only;
- QString tmp = entry_->field(authorField->name());
+ TQString tmp = entry_->field(authorField->name());
author = tmp.section(';', 0, 0);
} else {
author = entry_->field(authorField->name());
}
}
- Data::FieldPtr titleField = c->fieldByBibtexName(QString::fromLatin1("title"));
- QString title;
+ Data::FieldPtr titleField = c->fieldByBibtexName(TQString::tqfromLatin1("title"));
+ TQString title;
if(titleField) {
title = entry_->field(titleField->name());
}
- Data::FieldPtr yearField = c->fieldByBibtexName(QString::fromLatin1("year"));
- QString year;
+ Data::FieldPtr yearField = c->fieldByBibtexName(TQString::tqfromLatin1("year"));
+ TQString year;
if(yearField) {
year = entry_->field(yearField->name());
}
if(year.isEmpty()) {
- year = entry_->field(QString::fromLatin1("pub_year"));
+ year = entry_->field(TQString::tqfromLatin1("pub_year"));
if(year.isEmpty()) {
- year = entry_->field(QString::fromLatin1("cr_year"));
+ year = entry_->field(TQString::tqfromLatin1("cr_year"));
}
}
year = year.section(';', 0, 0);
@@ -99,28 +99,28 @@ QString BibtexHandler::bibtexKey(Data::ConstEntryPtr entry_) {
return bibtexKey(author, title, year);
}
-QString BibtexHandler::bibtexKey(const QString& author_, const QString& title_, const QString& year_) {
- QString key;
+TQString BibtexHandler::bibtexKey(const TQString& author_, const TQString& title_, const TQString& year_) {
+ TQString key;
// if no comma, take the last word
if(!author_.isEmpty()) {
- if(author_.find(',') == -1) {
+ if(author_.tqfind(',') == -1) {
key += author_.section(' ', -1).lower() + '-';
} else {
// if there is a comma, take the string up to the first comma
key += author_.section(',', 0, 0).lower() + '-';
}
}
- QStringList words = QStringList::split(' ', title_);
- for(QStringList::ConstIterator it = words.begin(); it != words.end(); ++it) {
+ TQStringList words = TQStringList::split(' ', title_);
+ for(TQStringList::ConstIterator it = words.begin(); it != words.end(); ++it) {
key += (*it).left(1).lower();
}
key += year_;
// bibtex key may only contain [0-9a-zA-Z-]
- return key.replace(s_badKeyChars, QString::null);
+ return key.tqreplace(s_badKeyChars, TQString());
}
void BibtexHandler::loadTranslationMaps() {
- QString mapfile = locate("appdata", QString::fromLatin1("bibtex-translation.xml"));
+ TQString mapfile = locate("appdata", TQString::tqfromLatin1("bibtex-translation.xml"));
if(mapfile.isEmpty()) {
return;
}
@@ -130,15 +130,15 @@ void BibtexHandler::loadTranslationMaps() {
KURL u;
u.setPath(mapfile);
// no namespace processing
- QDomDocument dom = FileHandler::readXMLFile(u, false);
+ TQDomDocument dom = FileHandler::readXMLFile(u, false);
- QDomNodeList keyList = dom.elementsByTagName(QString::fromLatin1("key"));
+ TQDomNodeList keyList = dom.elementsByTagName(TQString::tqfromLatin1("key"));
for(unsigned i = 0; i < keyList.count(); ++i) {
- QDomNodeList strList = keyList.item(i).toElement().elementsByTagName(QString::fromLatin1("string"));
+ TQDomNodeList strList = keyList.item(i).toElement().elementsByTagName(TQString::tqfromLatin1("string"));
// the strList might have more than one node since there are multiple ways
// to represent a character in LaTex.
- QString s = keyList.item(i).toElement().attribute(QString::fromLatin1("char"));
+ TQString s = keyList.item(i).toElement().attribute(TQString::tqfromLatin1("char"));
for(unsigned j = 0; j < strList.count(); ++j) {
(*s_utf8LatexMap)[s].append(strList.item(j).toElement().text());
// kdDebug() << "BibtexHandler::loadTranslationMaps - "
@@ -147,15 +147,15 @@ void BibtexHandler::loadTranslationMaps() {
}
}
-QString BibtexHandler::importText(char* text_) {
+TQString BibtexHandler::importText(char* text_) {
if(!s_utf8LatexMap) {
loadTranslationMaps();
}
- QString str = QString::fromUtf8(text_);
+ TQString str = TQString::fromUtf8(text_);
for(StringListMap::Iterator it = s_utf8LatexMap->begin(); it != s_utf8LatexMap->end(); ++it) {
- for(QStringList::Iterator sit = it.data().begin(); sit != it.data().end(); ++sit) {
- str.replace(*sit, it.key());
+ for(TQStringList::Iterator sit = it.data().begin(); sit != it.data().end(); ++sit) {
+ str.tqreplace(*sit, it.key());
}
}
@@ -164,34 +164,34 @@ QString BibtexHandler::importText(char* text_) {
// we need to lower-case any capitalized text after the first letter that is
// NOT contained in braces
- QRegExp rx(QString::fromLatin1("\\{([A-Z]+)\\}"));
+ TQRegExp rx(TQString::tqfromLatin1("\\{([A-Z]+)\\}"));
rx.setMinimal(true);
- str.replace(rx, QString::fromLatin1("\\1"));
+ str.tqreplace(rx, TQString::tqfromLatin1("\\1"));
return str;
}
-QString BibtexHandler::exportText(const QString& text_, const QStringList& macros_) {
+TQString BibtexHandler::exportText(const TQString& text_, const TQStringList& macros_) {
if(!s_utf8LatexMap) {
loadTranslationMaps();
}
- QChar lquote, rquote;
+ TQChar lquote, rquote;
switch(s_quoteStyle) {
case BRACES:
lquote = '{';
rquote = '}';
break;
- case QUOTES:
+ case TQUOTES:
lquote = '"';
rquote = '"';
break;
}
- QString text = text_;
+ TQString text = text_;
for(StringListMap::Iterator it = s_utf8LatexMap->begin(); it != s_utf8LatexMap->end(); ++it) {
- text.replace(it.key(), it.data()[0]);
+ text.tqreplace(it.key(), it.data()[0]);
}
if(macros_.isEmpty()) {
@@ -203,13 +203,13 @@ QString BibtexHandler::exportText(const QString& text_, const QStringList& macro
// change it. Then, in case '#' occurs in a non-macro string, replace any occurrences of '}#{' with '#'
// list of new tokens
- QStringList list;
+ TQStringList list;
// first, split the text
- QStringList tokens = QStringList::split('#', text, true);
- for(QStringList::Iterator it = tokens.begin(); it != tokens.end(); ++it) {
+ TQStringList tokens = TQStringList::split('#', text, true);
+ for(TQStringList::Iterator it = tokens.begin(); it != tokens.end(); ++it) {
// check to see if token is a macro
- if(macros_.findIndex((*it).stripWhiteSpace()) == -1) {
+ if(macros_.tqfindIndex((*it).stripWhiteSpace()) == -1) {
// the token is NOT a macro, add braces around whole words and also around capitals
list << lquote + addBraces(*it) + rquote;
} else {
@@ -217,14 +217,14 @@ QString BibtexHandler::exportText(const QString& text_, const QStringList& macro
}
}
- const QChar octo = '#';
+ const TQChar octo = '#';
text = list.join(octo);
- text.replace(QString(rquote)+octo+lquote, octo);
+ text.tqreplace(TQString(rquote)+octo+lquote, octo);
return text;
}
-bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const QString& bibtexField_, const QString& value_) {
+bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const TQString& bibtexField_, const TQString& value_) {
Data::BibtexCollection* c = static_cast<Data::BibtexCollection*>(entry_->collection().data());
Data::FieldPtr field = c->fieldByBibtexName(bibtexField_);
if(!field) {
@@ -241,14 +241,14 @@ bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const QString& bibtexFi
field = new Data::Field(*existingField);
} else if(value_.length() < 100) {
// arbitrarily say if the value has more than 100 chars, then it's a paragraph
- QString vlower = value_.lower();
+ TQString vlower = value_.lower();
// special case, try to detect URLs
- // In qt 3.1, QString::startsWith() is always case-sensitive
+ // In qt 3.1, TQString::startsWith() is always case-sensitive
if(bibtexField_ == Latin1Literal("url")
- || vlower.startsWith(QString::fromLatin1("http")) // may also be https
- || vlower.startsWith(QString::fromLatin1("ftp:/"))
- || vlower.startsWith(QString::fromLatin1("file:/"))
- || vlower.startsWith(QString::fromLatin1("/"))) { // assume this indicates a local path
+ || vlower.startsWith(TQString::tqfromLatin1("http")) // may also be https
+ || vlower.startsWith(TQString::tqfromLatin1("ftp:/"))
+ || vlower.startsWith(TQString::tqfromLatin1("file:/"))
+ || vlower.startsWith(TQString::tqfromLatin1("/"))) { // assume this indicates a local path
myDebug() << "BibtexHandler::setFieldValue() - creating a URL field for " << bibtexField_ << endl;
field = new Data::Field(bibtexField_, KStringHandler::capwords(bibtexField_), Data::Field::URL);
} else {
@@ -258,15 +258,15 @@ bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const QString& bibtexFi
} else {
field = new Data::Field(bibtexField_, KStringHandler::capwords(bibtexField_), Data::Field::Para);
}
- field->setProperty(QString::fromLatin1("bibtex"), bibtexField_);
+ field->setProperty(TQString::tqfromLatin1("bibtex"), bibtexField_);
c->addField(field);
}
// special case keywords, replace commas with semi-colons so they get separated
- QString value = value_;
- if(field->property(QString::fromLatin1("bibtex")).startsWith(QString::fromLatin1("keyword"))) {
- value.replace(',', ';');
+ TQString value = value_;
+ if(field->property(TQString::tqfromLatin1("bibtex")).startsWith(TQString::tqfromLatin1("keyword"))) {
+ value.tqreplace(',', ';');
// special case refbase bibtex export, with multiple keywords fields
- QString oValue = entry_->field(field);
+ TQString oValue = entry_->field(field);
if(!oValue.isEmpty()) {
value = oValue + "; " + value;
}
@@ -274,19 +274,19 @@ bool BibtexHandler::setFieldValue(Data::EntryPtr entry_, const QString& bibtexFi
return entry_->setField(field, value);
}
-QString& BibtexHandler::cleanText(QString& text_) {
+TQString& BibtexHandler::cleanText(TQString& text_) {
// FIXME: need to improve this for removing all Latex entities
-// QRegExp rx(QString::fromLatin1("(?=[^\\\\])\\\\.+\\{"));
- QRegExp rx(QString::fromLatin1("\\\\.+\\{"));
+// TQRegExp rx(TQString::tqfromLatin1("(?=[^\\\\])\\\\.+\\{"));
+ TQRegExp rx(TQString::tqfromLatin1("\\\\.+\\{"));
rx.setMinimal(true);
- text_.replace(rx, QString::null);
- text_.replace(QRegExp(QString::fromLatin1("[{}]")), QString::null);
- text_.replace('~', ' ');
+ text_.tqreplace(rx, TQString());
+ text_.tqreplace(TQRegExp(TQString::tqfromLatin1("[{}]")), TQString());
+ text_.tqreplace('~', ' ');
return text_;
}
// add braces around capital letters
-QString& BibtexHandler::addBraces(QString& text) {
+TQString& BibtexHandler::addBraces(TQString& text) {
#if !TELLICO_BIBTEX_BRACES
return text;
#else
@@ -294,7 +294,7 @@ QString& BibtexHandler::addBraces(QString& text) {
uint l = text.length();
// start at first letter, but skip if only the first is capitalized
for(uint i = 0; i < l; ++i) {
- const QChar c = text.at(i);
+ const TQChar c = text.at(i);
if(inside == 0 && c >= 'A' && c <= 'Z') {
uint j = i+1;
while(text.at(j) >= 'A' && text.at(j) <= 'Z' && j < l) {
diff --git a/src/translators/bibtexhandler.h b/src/translators/bibtexhandler.h
index 87d8bf0..afaf599 100644
--- a/src/translators/bibtexhandler.h
+++ b/src/translators/bibtexhandler.h
@@ -14,13 +14,13 @@
#ifndef BIBTEXHANDLER_H
#define BIBTEXHANDLER_H
-class QString;
-class QStringList;
-class QRegExp;
+class TQString;
+class TQStringList;
+class TQRegExp;
#include "../datavectors.h"
-#include <qmap.h>
+#include <tqmap.h>
namespace Tellico {
@@ -29,31 +29,31 @@ namespace Tellico {
*/
class BibtexHandler {
public:
- enum QuoteStyle { BRACES=0, QUOTES=1 };
- static QStringList bibtexKeys(const Data::EntryVec& entries);
- static QString bibtexKey(Data::ConstEntryPtr entry);
- static QString importText(char* text);
- static QString exportText(const QString& text, const QStringList& macros);
- static bool setFieldValue(Data::EntryPtr entry, const QString& bibtexField, const QString& value);
+ enum QuoteStyle { BRACES=0, TQUOTES=1 };
+ static TQStringList bibtexKeys(const Data::EntryVec& entries);
+ static TQString bibtexKey(Data::ConstEntryPtr entry);
+ static TQString importText(char* text);
+ static TQString exportText(const TQString& text, const TQStringList& macros);
+ static bool setFieldValue(Data::EntryPtr entry, const TQString& bibtexField, const TQString& value);
/**
* Strips the text of all vestiges of LaTeX.
*
* @param text A reference to the text
* @return A reference to the text
*/
- static QString& cleanText(QString& text);
+ static TQString& cleanText(TQString& text);
static QuoteStyle s_quoteStyle;
private:
- typedef QMap<QString, QStringList> StringListMap;
+ typedef TQMap<TQString, TQStringList> StringListMap;
- static QString bibtexKey(const QString& author, const QString& title, const QString& year);
+ static TQString bibtexKey(const TQString& author, const TQString& title, const TQString& year);
static void loadTranslationMaps();
- static QString& addBraces(QString& string);
+ static TQString& addBraces(TQString& string);
static StringListMap* s_utf8LatexMap;
- static const QRegExp s_badKeyChars;
+ static const TQRegExp s_badKeyChars;
};
} // end namespace
diff --git a/src/translators/bibteximporter.cpp b/src/translators/bibteximporter.cpp
index 2e514d3..8394f6a 100644
--- a/src/translators/bibteximporter.cpp
+++ b/src/translators/bibteximporter.cpp
@@ -23,13 +23,13 @@
#include <kapplication.h>
#include <kconfig.h>
-#include <qptrlist.h>
-#include <qregexp.h>
-#include <qlayout.h>
-#include <qvbuttongroup.h>
-#include <qradiobutton.h>
-#include <qwhatsthis.h>
-#include <qtextcodec.h>
+#include <tqptrlist.h>
+#include <tqregexp.h>
+#include <tqlayout.h>
+#include <tqvbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqwhatsthis.h>
+#include <tqtextcodec.h>
using Tellico::Import::BibtexImporter;
@@ -38,7 +38,7 @@ BibtexImporter::BibtexImporter(const KURL::List& urls_) : Importer(urls_)
bt_initialize();
}
-BibtexImporter::BibtexImporter(const QString& text_) : Importer(text_)
+BibtexImporter::BibtexImporter(const TQString& text_) : Importer(text_)
, m_coll(0), m_widget(0), m_readUTF8(0), m_readLocale(0), m_cancelled(false) {
bt_initialize();
}
@@ -62,7 +62,7 @@ Tellico::Data::CollPtr BibtexImporter::collection() {
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(urls().count() * 100);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
bool useUTF8 = m_widget && m_readUTF8->isChecked();
@@ -72,7 +72,7 @@ Tellico::Data::CollPtr BibtexImporter::collection() {
int count = 0;
// might be importing text only
if(!text().isEmpty()) {
- QString text = this->text();
+ TQString text = this->text();
Data::CollPtr coll = readCollection(text, count);
if(!coll || coll->entryCount() == 0) {
setStatusMessage(i18n("No valid bibtex entries were found"));
@@ -89,13 +89,13 @@ Tellico::Data::CollPtr BibtexImporter::collection() {
if(!(*it).isValid()) {
continue;
}
- QString text = FileHandler::readTextFile(*it, false, useUTF8);
+ TQString text = FileHandler::readTextFile(*it, false, useUTF8);
if(text.isEmpty()) {
continue;
}
Data::CollPtr coll = readCollection(text, count);
if(!coll || coll->entryCount() == 0) {
- setStatusMessage(i18n("No valid bibtex entries were found in file - %1").arg(url().fileName()));
+ setStatusMessage(i18n("No valid bibtex entries were found in file - %1").tqarg(url().fileName()));
continue;
}
m_coll->addEntries(coll->entries());
@@ -108,7 +108,7 @@ Tellico::Data::CollPtr BibtexImporter::collection() {
return m_coll;
}
-Tellico::Data::CollPtr BibtexImporter::readCollection(const QString& text, int n) {
+Tellico::Data::CollPtr BibtexImporter::readCollection(const TQString& text, int n) {
if(text.isEmpty()) {
myDebug() << "BibtexImporter::readCollection() - no text" << endl;
return 0;
@@ -125,9 +125,9 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const QString& text, int n
return 0;
}
- QString str;
+ TQString str;
const uint count = m_nodes.count();
- const uint stepSize = QMAX(s_stepSize, count/100);
+ const uint stepSize = TQMAX(s_stepSize, count/100);
const bool showProgress = options() & ImportProgress;
uint j = 0;
@@ -136,7 +136,7 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const QString& text, int n
if(bt_entry_metatype(it.current()) == BTE_PREAMBLE) {
char* preamble = bt_get_text(it.current());
if(preamble) {
- c->setPreamble(QString::fromUtf8(preamble));
+ c->setPreamble(TQString::fromUtf8(preamble));
}
continue;
}
@@ -146,7 +146,7 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const QString& text, int n
(void) bt_next_field(it.current(), 0, &macro);
// FIXME: replace macros within macro definitions!
// lookup lowercase macro in map
- c->addMacro(m_macros[QString::fromUtf8(macro)], QString::fromUtf8(bt_macro_text(macro, 0, 0)));
+ c->addMacro(m_macros[TQString::fromUtf8(macro)], TQString::fromUtf8(bt_macro_text(macro, 0, 0)));
continue;
}
@@ -157,20 +157,20 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const QString& text, int n
// now we're parsing a regular entry
Data::EntryPtr entry = new Data::Entry(ptr);
- str = QString::fromUtf8(bt_entry_type(it.current()));
+ str = TQString::fromUtf8(bt_entry_type(it.current()));
// kdDebug() << "entry type: " << str << endl;
// text is automatically put into lower-case by btparse
- BibtexHandler::setFieldValue(entry, QString::fromLatin1("entry-type"), str);
+ BibtexHandler::setFieldValue(entry, TQString::tqfromLatin1("entry-type"), str);
- str = QString::fromUtf8(bt_entry_key(it.current()));
+ str = TQString::fromUtf8(bt_entry_key(it.current()));
// kdDebug() << "entry key: " << str << endl;
- BibtexHandler::setFieldValue(entry, QString::fromLatin1("key"), str);
+ BibtexHandler::setFieldValue(entry, TQString::tqfromLatin1("key"), str);
char* name;
AST* field = 0;
while((field = bt_next_field(it.current(), field, &name))) {
// kdDebug() << "\tfound: " << name << endl;
-// str = QString::fromLatin1(bt_get_text(field));
+// str = TQString::tqfromLatin1(bt_get_text(field));
str.truncate(0);
AST* value = 0;
bt_nodetype type;
@@ -184,7 +184,7 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const QString& text, int n
end_macro = false;
break;
case BTAST_MACRO:
- str += QString::fromUtf8(svalue) + '#';
+ str += TQString::fromUtf8(svalue) + '#';
end_macro = true;
break;
default:
@@ -195,9 +195,9 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const QString& text, int n
// remove last character '#'
str.truncate(str.length() - 1);
}
- QString fieldName = QString::fromUtf8(name);
+ TQString fieldName = TQString::fromUtf8(name);
if(fieldName == Latin1Literal("author") || fieldName == Latin1Literal("editor")) {
- str.replace(QRegExp(QString::fromLatin1("\\sand\\s")), QString::fromLatin1("; "));
+ str.tqreplace(TQRegExp(TQString::tqfromLatin1("\\sand\\s")), TQString::tqfromLatin1("; "));
}
BibtexHandler::setFieldValue(entry, fieldName, str);
}
@@ -222,7 +222,7 @@ Tellico::Data::CollPtr BibtexImporter::readCollection(const QString& text, int n
return ptr;
}
-void BibtexImporter::parseText(const QString& text) {
+void BibtexImporter::parseText(const TQString& text) {
m_nodes.clear();
m_macros.clear();
@@ -234,15 +234,15 @@ void BibtexImporter::parseText(const QString& text) {
bt_set_stringopts(BTE_MACRODEF, 0);
// bt_set_stringopts(BTE_PREAMBLE, BTO_CONVERT | BTO_EXPAND);
- QString entry;
- QRegExp rx(QString::fromLatin1("[{}]"));
- QRegExp macroName(QString::fromLatin1("@string\\s*\\{\\s*(.*)="), false /*case sensitive*/);
+ TQString entry;
+ TQRegExp rx(TQString::tqfromLatin1("[{}]"));
+ TQRegExp macroName(TQString::tqfromLatin1("@string\\s*\\{\\s*(.*)="), false /*case sensitive*/);
macroName.setMinimal(true);
bool needsCleanup = false;
int brace = 0;
int startpos = 0;
- int pos = text.find(rx, 0);
+ int pos = text.tqfind(rx, 0);
while(pos > 0 && !m_cancelled) {
if(text[pos] == '{') {
++brace;
@@ -259,14 +259,14 @@ void BibtexImporter::parseText(const QString& text) {
if(bt_entry_metatype(node) == BTE_MACRODEF && macroName.search(entry) > -1) {
char* macro;
(void) bt_next_field(node, 0, &macro);
- m_macros.insert(QString::fromUtf8(macro), macroName.cap(1).stripWhiteSpace());
+ m_macros.insert(TQString::fromUtf8(macro), macroName.cap(1).stripWhiteSpace());
}
m_nodes.append(node);
needsCleanup = true;
}
startpos = pos+1;
}
- pos = text.find(rx, pos+1);
+ pos = text.tqfind(rx, pos+1);
}
if(needsCleanup) {
// clean up some structures
@@ -278,22 +278,22 @@ void BibtexImporter::slotCancel() {
m_cancelled = true;
}
-QWidget* BibtexImporter::widget(QWidget* parent_, const char* name_/*=0*/) {
+TQWidget* BibtexImporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) {
if(m_widget) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QButtonGroup* box = new QVButtonGroup(i18n("Bibtex Options"), m_widget);
- m_readUTF8 = new QRadioButton(i18n("Use Unicode (UTF-8) encoding"), box);
- QWhatsThis::add(m_readUTF8, i18n("Read the imported file in Unicode (UTF-8)."));
- QString localStr = i18n("Use user locale (%1) encoding").arg(
- QString::fromLatin1(QTextCodec::codecForLocale()->name()));
- m_readLocale = new QRadioButton(localStr, box);
+ TQButtonGroup* box = new TQVButtonGroup(i18n("Bibtex Options"), m_widget);
+ m_readUTF8 = new TQRadioButton(i18n("Use Unicode (UTF-8) encoding"), box);
+ TQWhatsThis::add(m_readUTF8, i18n("Read the imported file in Unicode (UTF-8)."));
+ TQString localStr = i18n("Use user locale (%1) encoding").tqarg(
+ TQString::tqfromLatin1(TQTextCodec::codecForLocale()->name()));
+ m_readLocale = new TQRadioButton(localStr, box);
m_readLocale->setChecked(true);
- QWhatsThis::add(m_readLocale, i18n("Read the imported file in the local encoding."));
+ TQWhatsThis::add(m_readLocale, i18n("Read the imported file in the local encoding."));
KConfigGroup config(kapp->config(), "Import Options");
bool useUTF8 = config.readBoolEntry("Bibtex UTF8", false);
diff --git a/src/translators/bibteximporter.h b/src/translators/bibteximporter.h
index c17195b..e0d248c 100644
--- a/src/translators/bibteximporter.h
+++ b/src/translators/bibteximporter.h
@@ -26,10 +26,10 @@ extern "C" {
}
#endif
-#include <qptrlist.h>
-#include <qmap.h>
+#include <tqptrlist.h>
+#include <tqmap.h>
-class QRadioButton;
+class TQRadioButton;
namespace Tellico {
namespace Import {
@@ -42,6 +42,7 @@ namespace Tellico {
*/
class BibtexImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -50,7 +51,7 @@ public:
* @param url The url of the bibtex file
*/
BibtexImporter(const KURL::List& urls);
- BibtexImporter(const QString& text);
+ BibtexImporter(const TQString& text);
/*
* Some cleanup is done for the btparse library
*/
@@ -63,25 +64,25 @@ public:
* @return A pointer to a @ref BibtexCollection, or 0 if none can be created.
*/
virtual Data::CollPtr collection();
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
virtual bool canImport(int type) const;
public slots:
void slotCancel();
private:
- Data::CollPtr readCollection(const QString& text, int n);
- void parseText(const QString& text);
+ Data::CollPtr readCollection(const TQString& text, int n);
+ void parseText(const TQString& text);
- typedef QPtrList<AST> ASTList;
- typedef QPtrListIterator<AST> ASTListIterator;
+ typedef TQPtrList<AST> ASTList;
+ typedef TQPtrListIterator<AST> ASTListIterator;
ASTList m_nodes;
- QMap<QString, QString> m_macros;
+ TQMap<TQString, TQString> m_macros;
Data::CollPtr m_coll;
- QWidget* m_widget;
- QRadioButton* m_readUTF8;
- QRadioButton* m_readLocale;
+ TQWidget* m_widget;
+ TQRadioButton* m_readUTF8;
+ TQRadioButton* m_readLocale;
bool m_cancelled : 1;
};
diff --git a/src/translators/bibtexmlexporter.cpp b/src/translators/bibtexmlexporter.cpp
index 4a0a4d3..153fd3f 100644
--- a/src/translators/bibtexmlexporter.cpp
+++ b/src/translators/bibtexmlexporter.cpp
@@ -25,19 +25,19 @@
#include <klocale.h>
#include <kdebug.h>
-#include <qvbox.h>
-#include <qdom.h>
-#include <qregexp.h>
-#include <qtextcodec.h>
+#include <tqvbox.h>
+#include <tqdom.h>
+#include <tqregexp.h>
+#include <tqtextcodec.h>
using Tellico::Export::BibtexmlExporter;
-QString BibtexmlExporter::formatString() const {
+TQString BibtexmlExporter::formatString() const {
return i18n("Bibtexml");
}
-QString BibtexmlExporter::fileFilter() const {
- return i18n("*.xml|Bibtexml Files (*.xml)") + QChar('\n') + i18n("*|All Files");
+TQString BibtexmlExporter::fileFilter() const {
+ return i18n("*.xml|Bibtexml Files (*.xml)") + TQChar('\n') + i18n("*|All Files");
}
bool BibtexmlExporter::exec() {
@@ -49,16 +49,16 @@ bool BibtexmlExporter::exec() {
// there are some special fields
// the entry-type specifies the entry type - book, inproceedings, whatever
- QString typeField;
+ TQString typeField;
// the key specifies the cite-key
- QString keyField;
+ TQString keyField;
- const QString bibtex = QString::fromLatin1("bibtex");
+ const TQString bibtex = TQString::tqfromLatin1("bibtex");
// keep a list of all the 'ordinary' fields to iterate through later
Data::FieldVec fields;
Data::FieldVec vec = coll->fields();
for(Data::FieldVec::Iterator it = vec.begin(); it != vec.end(); ++it) {
- QString bibtexField = it->property(bibtex);
+ TQString bibtexField = it->property(bibtex);
if(bibtexField == Latin1Literal("entry-type")) {
typeField = it->name();
} else if(bibtexField == Latin1Literal("key")) {
@@ -68,29 +68,29 @@ bool BibtexmlExporter::exec() {
}
}
- QDomImplementation impl;
- QDomDocumentType doctype = impl.createDocumentType(QString::fromLatin1("file"),
- QString::null,
+ TQDomImplementation impl;
+ TQDomDocumentType doctype = impl.createDocumentType(TQString::tqfromLatin1("file"),
+ TQString(),
XML::dtdBibtexml);
//default namespace
- const QString& ns = XML::nsBibtexml;
+ const TQString& ns = XML::nsBibtexml;
- QDomDocument dom = impl.createDocument(ns, QString::fromLatin1("file"), doctype);
+ TQDomDocument dom = impl.createDocument(ns, TQString::tqfromLatin1("file"), doctype);
// root element
- QDomElement root = dom.documentElement();
+ TQDomElement root = dom.documentElement();
- QString encodeStr = QString::fromLatin1("version=\"1.0\" encoding=\"");
+ TQString encodeStr = TQString::tqfromLatin1("version=\"1.0\" encoding=\"");
if(options() & Export::ExportUTF8) {
- encodeStr += QString::fromLatin1("UTF-8");
+ encodeStr += TQString::tqfromLatin1("UTF-8");
} else {
- encodeStr += QString::fromLatin1(QTextCodec::codecForLocale()->mimeName());
+ encodeStr += TQString::tqfromLatin1(TQTextCodec::codecForLocale()->mimeName());
}
encodeStr += '"';
// createDocument creates a root node, insert the processing instruction before it
- dom.insertBefore(dom.createProcessingInstruction(QString::fromLatin1("xml"), encodeStr), root);
- QString comment = QString::fromLatin1("Generated by Tellico ") + QString::fromLatin1(VERSION);
+ dom.insertBefore(dom.createProcessingInstruction(TQString::tqfromLatin1("xml"), encodeStr), root);
+ TQString comment = TQString::tqfromLatin1("Generated by Tellico ") + TQString::tqfromLatin1(VERSION);
dom.insertBefore(dom.createComment(comment), root);
Data::ConstFieldPtr field;
@@ -98,14 +98,14 @@ bool BibtexmlExporter::exec() {
bool format = options() & Export::ExportFormatted;
StringSet usedKeys;
- QString type, key, newKey, value, elemName, parElemName;
- QDomElement btElem, entryElem, parentElem, fieldElem;
+ TQString type, key, newKey, value, elemName, parElemName;
+ TQDomElement btElem, entryElem, tqparentElem, fieldElem;
for(Data::EntryVec::ConstIterator entryIt = entries().begin(); entryIt != entries().end(); ++entryIt) {
key = entryIt->field(keyField);
if(key.isEmpty()) {
key = BibtexHandler::bibtexKey(entryIt.data());
}
- QString newKey = key;
+ TQString newKey = key;
char c = 'a';
while(usedKeys.has(newKey)) {
// duplicate found!
@@ -115,8 +115,8 @@ bool BibtexmlExporter::exec() {
key = newKey;
usedKeys.add(key);
- btElem = dom.createElement(QString::fromLatin1("entry"));
- btElem.setAttribute(QString::fromLatin1("id"), key);
+ btElem = dom.createElement(TQString::tqfromLatin1("entry"));
+ btElem.setAttribute(TQString::tqfromLatin1("id"), key);
root.appendChild(btElem);
type = entryIt->field(typeField);
@@ -149,23 +149,23 @@ bool BibtexmlExporter::exec() {
elemName == Latin1Literal("editor") ||
elemName == Latin1Literal("keywords")) {
if(elemName == Latin1Literal("author")) {
- parElemName = QString::fromLatin1("authorlist");
+ parElemName = TQString::tqfromLatin1("authorlist");
} else if(elemName == Latin1Literal("editor")) {
- parElemName = QString::fromLatin1("editorlist");
+ parElemName = TQString::tqfromLatin1("editorlist");
} else { // keywords
- parElemName = QString::fromLatin1("keywords");
- elemName = QString::fromLatin1("keyword");
+ parElemName = TQString::tqfromLatin1("keywords");
+ elemName = TQString::tqfromLatin1("keyword");
}
- parentElem = dom.createElement(parElemName);
- const QStringList values = entryIt->fields(field->name(), false);
- for(QStringList::ConstIterator it = values.begin(); it != values.end(); ++it) {
+ tqparentElem = dom.createElement(parElemName);
+ const TQStringList values = entryIt->fields(field->name(), false);
+ for(TQStringList::ConstIterator it = values.begin(); it != values.end(); ++it) {
fieldElem = dom.createElement(elemName);
fieldElem.appendChild(dom.createTextNode(*it));
- parentElem.appendChild(fieldElem);
+ tqparentElem.appendChild(fieldElem);
}
- if(parentElem.hasChildNodes()) {
- entryElem.appendChild(parentElem);
+ if(tqparentElem.hasChildNodes()) {
+ entryElem.appendChild(tqparentElem);
}
} else {
fieldElem = dom.createElement(elemName);
diff --git a/src/translators/bibtexmlexporter.h b/src/translators/bibtexmlexporter.h
index 8f63a55..7813f18 100644
--- a/src/translators/bibtexmlexporter.h
+++ b/src/translators/bibtexmlexporter.h
@@ -24,16 +24,17 @@ namespace Tellico {
*/
class BibtexmlExporter : public Exporter {
Q_OBJECT
+ TQ_OBJECT
public:
BibtexmlExporter() : Exporter() {}
virtual bool exec();
- virtual QString formatString() const;
- virtual QString fileFilter() const;
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const;
// no options
- virtual QWidget* widget(QWidget*, const char*) { return 0; }
+ virtual TQWidget* widget(TQWidget*, const char*) { return 0; }
};
} // end namespace
diff --git a/src/translators/bibtexmlimporter.cpp b/src/translators/bibtexmlimporter.cpp
index 2feb2f2..9131320 100644
--- a/src/translators/bibtexmlimporter.cpp
+++ b/src/translators/bibtexmlimporter.cpp
@@ -38,25 +38,25 @@ Tellico::Data::CollPtr BibtexmlImporter::collection() {
}
void BibtexmlImporter::loadDomDocument() {
- QDomElement root = domDocument().documentElement();
+ TQDomElement root = domDocument().documentElement();
if(root.isNull() || root.localName() != Latin1Literal("file")) {
- setStatusMessage(i18n(errorLoad).arg(url().fileName()));
+ setStatusMessage(i18n(errorLoad).tqarg(url().fileName()));
return;
}
- const QString& ns = XML::nsBibtexml;
+ const TQString& ns = XML::nsBibtexml;
m_coll = new Data::BibtexCollection(true);
- QDomNodeList entryelems = root.elementsByTagNameNS(ns, QString::fromLatin1("entry"));
+ TQDomNodeList entryelems = root.elementsByTagNameNS(ns, TQString::tqfromLatin1("entry"));
// kdDebug() << "BibtexmlImporter::loadDomDocument - found " << entryelems.count() << " entries" << endl;
const uint count = entryelems.count();
- const uint stepSize = QMAX(s_stepSize, count/100);
+ const uint stepSize = TQMAX(s_stepSize, count/100);
const bool showProgress = options() & ImportProgress;
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(count);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
for(uint j = 0; !m_cancelled && j < entryelems.count(); ++j) {
@@ -69,8 +69,8 @@ void BibtexmlImporter::loadDomDocument() {
} // end entry loop
}
-void BibtexmlImporter::readEntry(const QDomNode& entryNode_) {
- QDomNode node = const_cast<QDomNode&>(entryNode_);
+void BibtexmlImporter::readEntry(const TQDomNode& entryNode_) {
+ TQDomNode node = const_cast<TQDomNode&>(entryNode_);
Data::EntryPtr entry = new Data::Entry(m_coll);
@@ -82,14 +82,14 @@ void BibtexmlImporter::readEntry(const QDomNode& entryNode_) {
</authorlist>
<publisher>...</publisher> */
- QString type = node.firstChild().toElement().tagName();
- entry->setField(QString::fromLatin1("entry-type"), type);
- QString id = node.toElement().attribute(QString::fromLatin1("id"));
- entry->setField(QString::fromLatin1("bibtex-key"), id);
+ TQString type = node.firstChild().toElement().tagName();
+ entry->setField(TQString::tqfromLatin1("entry-type"), type);
+ TQString id = node.toElement().attribute(TQString::tqfromLatin1("id"));
+ entry->setField(TQString::tqfromLatin1("bibtex-key"), id);
- QString name, value;
+ TQString name, value;
// field values are first child of first child of entry node
- for(QDomNode n = node.firstChild().firstChild(); !n.isNull(); n = n.nextSibling()) {
+ for(TQDomNode n = node.firstChild().firstChild(); !n.isNull(); n = n.nextSibling()) {
// n could be something like authorlist, with multiple authors, or just
// a plain element with a single text child...
// second case first
@@ -98,9 +98,9 @@ void BibtexmlImporter::readEntry(const QDomNode& entryNode_) {
value = n.toElement().text();
} else {
// is either titlelist, authorlist, editorlist, or keywords
- QString parName = n.toElement().tagName();
+ TQString parName = n.toElement().tagName();
if(parName == Latin1Literal("titlelist")) {
- for(QDomNode n2 = node.firstChild(); !n2.isNull(); n2 = n2.nextSibling()) {
+ for(TQDomNode n2 = node.firstChild(); !n2.isNull(); n2 = n2.nextSibling()) {
name = n2.toElement().tagName();
value = n2.toElement().text();
if(!name.isEmpty() && !value.isEmpty()) {
@@ -112,38 +112,38 @@ void BibtexmlImporter::readEntry(const QDomNode& entryNode_) {
} else {
name = n.firstChild().toElement().tagName();
if(name == Latin1Literal("keyword")) {
- name = QString::fromLatin1("keywords");
+ name = TQString::tqfromLatin1("keywords");
}
value.truncate(0);
- for(QDomNode n2 = n.firstChild(); !n2.isNull(); n2 = n2.nextSibling()) {
+ for(TQDomNode n2 = n.firstChild(); !n2.isNull(); n2 = n2.nextSibling()) {
// n2 could have first, middle, lastname elements...
if(name == Latin1Literal("person")) {
- QStringList names;
- names << QString::fromLatin1("initials") << QString::fromLatin1("first")
- << QString::fromLatin1("middle") << QString::fromLatin1("prelast")
- << QString::fromLatin1("last") << QString::fromLatin1("lineage");
- for(QStringList::ConstIterator it = names.begin(); it != names.end(); ++it) {
- QDomNodeList list = n2.toElement().elementsByTagName(*it);
+ TQStringList names;
+ names << TQString::tqfromLatin1("initials") << TQString::tqfromLatin1("first")
+ << TQString::tqfromLatin1("middle") << TQString::tqfromLatin1("prelast")
+ << TQString::tqfromLatin1("last") << TQString::tqfromLatin1("lineage");
+ for(TQStringList::ConstIterator it = names.begin(); it != names.end(); ++it) {
+ TQDomNodeList list = n2.toElement().elementsByTagName(*it);
if(list.count() > 1) {
value += list.item(0).toElement().text();
}
if(*it != names.last()) {
- value += QString::fromLatin1(" ");
+ value += TQString::tqfromLatin1(" ");
}
}
}
- for(QDomNode n3 = n2.firstChild(); !n3.isNull(); n3 = n3.nextSibling()) {
+ for(TQDomNode n3 = n2.firstChild(); !n3.isNull(); n3 = n3.nextSibling()) {
if(n3.isElement()) {
value += n3.toElement().text();
} else if(n3.isText()) {
value += n3.toText().data();
}
if(n3 != n2.lastChild()) {
- value += QString::fromLatin1(" ");
+ value += TQString::tqfromLatin1(" ");
}
}
if(n2 != n.lastChild()) {
- value += QString::fromLatin1("; ");
+ value += TQString::tqfromLatin1("; ");
}
}
}
diff --git a/src/translators/bibtexmlimporter.h b/src/translators/bibtexmlimporter.h
index 826ea30..d86dd3e 100644
--- a/src/translators/bibtexmlimporter.h
+++ b/src/translators/bibtexmlimporter.h
@@ -17,7 +17,7 @@
#include "xmlimporter.h"
#include "../datavectors.h"
-class QDomNode;
+class TQDomNode;
namespace Tellico {
namespace Import {
@@ -27,6 +27,7 @@ namespace Tellico {
*/
class BibtexmlImporter : public XMLImporter {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -43,7 +44,7 @@ public slots:
private:
void loadDomDocument();
- void readEntry(const QDomNode& entryNode);
+ void readEntry(const TQDomNode& entryNode);
Data::CollPtr m_coll;
bool m_cancelled : 1;
diff --git a/src/translators/btparse/ast.c b/src/translators/btparse/ast.c
index d433f79..e3479b7 100644
--- a/src/translators/btparse/ast.c
+++ b/src/translators/btparse/ast.c
@@ -144,7 +144,7 @@ zzfree_ast(AST *tree)
}
/* build a tree (root child1 child2 ... NULL)
- * If root is NULL, simply make the children siblings and return ptr
+ * If root is NULL, simply make the tqchildren siblings and return ptr
* to 1st sibling (child1). If root is not single node, return NULL.
*
* Siblings that are actually siblins lists themselves are handled
diff --git a/src/translators/btparse/ast.h b/src/translators/btparse/ast.h
index 59622ec..56dcb90 100644
--- a/src/translators/btparse/ast.h
+++ b/src/translators/btparse/ast.h
@@ -55,9 +55,9 @@ typedef struct _ast {
#else
#ifdef zzAST_DOUBLE
-#define AST_REQUIRED_FIELDS struct _ast *right, *down, *left, *up;
+#define AST_RETQUIRED_FIELDS struct _ast *right, *down, *left, *up;
#else
-#define AST_REQUIRED_FIELDS struct _ast *right, *down;
+#define AST_RETQUIRED_FIELDS struct _ast *right, *down;
#endif
#endif
diff --git a/src/translators/btparse/bibtex.c b/src/translators/btparse/bibtex.c
index c922803..fb4518a 100644
--- a/src/translators/btparse/bibtex.c
+++ b/src/translators/btparse/bibtex.c
@@ -226,7 +226,7 @@ field(AST**_root)
zzastArg(1)->nodetype = BTAST_FIELD; check_field_name (zzastArg(1));
zzCONSUME;
- zzmatch(EQUALS); zzCONSUME;
+ zzmatch(ETQUALS); zzCONSUME;
value(zzSTR); zzlink(_root, &_sibling, &_tail);
#if DEBUG > 1
diff --git a/src/translators/btparse/btparse.h b/src/translators/btparse/btparse.h
index 841d3ee..c2d0200 100644
--- a/src/translators/btparse/btparse.h
+++ b/src/translators/btparse/btparse.h
@@ -254,7 +254,7 @@ extern "C" {
* First, we might need a prototype for strdup() (because the zzcr_ast
* macro uses it, and that macro is used in pccts/ast.c -- which I don't
* want to modify if I can help it, because it's someone else's code).
- * This is to accomodate AIX, where including <string.h> apparently doesn't
+ * This is to accomodate AIX, where including <string.h> aptqparently doesn't
* declare strdup() (reported by Reiner Schlotte
* <[email protected]>), and compiling bibtex.c (which
* includes pccts/ast.c) crashes because of this (yes, yes, I know it
@@ -297,8 +297,8 @@ AST * bt_parse_file (char * filename,
/* postprocess.c */
void bt_postprocess_string (char * s, ushort options);
-char * bt_postprocess_value (AST * value, ushort options, boolean replace);
-char * bt_postprocess_field (AST * field, ushort options, boolean replace);
+char * bt_postprocess_value (AST * value, ushort options, boolean tqreplace);
+char * bt_postprocess_field (AST * field, ushort options, boolean tqreplace);
void bt_postprocess_entry (AST * entry, ushort options);
/* error.c */
diff --git a/src/translators/btparse/err.c b/src/translators/btparse/err.c
index f143048..341ab70 100644
--- a/src/translators/btparse/err.c
+++ b/src/translators/btparse/err.c
@@ -47,7 +47,7 @@ const ANTLRChar *zztokens[27]={
/* 12 */ "RBRACE",
/* 13 */ "ENTRY_OPEN",
/* 14 */ "ENTRY_CLOSE",
- /* 15 */ "EQUALS",
+ /* 15 */ "ETQUALS",
/* 16 */ "HASH",
/* 17 */ "COMMA",
/* 18 */ "\"",
diff --git a/src/translators/btparse/err.h b/src/translators/btparse/err.h
index d16615d..a9ba6da 100644
--- a/src/translators/btparse/err.h
+++ b/src/translators/btparse/err.h
@@ -61,13 +61,13 @@
* hidden and does not need to be saved during a "save state" operation
*/
/* maximum of 32 bits/unsigned int and must be 8 bits/byte */
-static SetWordType bitmask[] = {
+static SetWordType bittqmask[] = {
0x00000001, 0x00000002, 0x00000004, 0x00000008,
0x00000010, 0x00000020, 0x00000040, 0x00000080
};
void
-zzresynch(SetWordType *wd,SetWordType mask)
+zzresynch(SetWordType *wd,SetWordType tqmask)
{
static int consumed = 1;
@@ -77,10 +77,10 @@ zzresynch(SetWordType *wd,SetWordType mask)
if ( !consumed ) {zzCONSUME; return;}
/* if current token is in resynch set, we've got what we wanted */
- if ( wd[LA(1)]&mask || LA(1) == zzEOF_TOKEN ) {consumed=0; return;}
+ if ( wd[LA(1)]&tqmask || LA(1) == zzEOF_TOKEN ) {consumed=0; return;}
/* scan until we find something in the resynch set */
- while ( !(wd[LA(1)]&mask) && LA(1) != zzEOF_TOKEN ) {zzCONSUME;}
+ while ( !(wd[LA(1)]&tqmask) && LA(1) != zzEOF_TOKEN ) {zzCONSUME;}
consumed=1;
}
@@ -237,11 +237,11 @@ zzedecode(SetWordType *a)
if ( zzset_deg(a)>1 ) fprintf(stderr, " {");
do {
register SetWordType t = *p;
- register SetWordType *b = &(bitmask[0]);
+ register SetWordType *b = &(bittqmask[0]);
do {
if ( t & *b ) fprintf(stderr, " %s", zztokens[e]);
e++;
- } while (++b < &(bitmask[sizeof(SetWordType)*8]));
+ } while (++b < &(bittqmask[sizeof(SetWordType)*8]));
} while (++p < endp);
if ( zzset_deg(a)>1 ) fprintf(stderr, " }");
}
@@ -271,7 +271,7 @@ zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, cha
int
zzset_el(unsigned b, SetWordType *p)
{
- return( p[BSETDIVWORD(b)] & bitmask[BSETMODWORD(b)] );
+ return( p[BSETDIVWORD(b)] & bittqmask[BSETMODWORD(b)] );
}
int
@@ -289,10 +289,10 @@ zzset_deg(SetWordType *a)
while ( p < endp )
{
register SetWordType t = *p;
- register SetWordType *b = &(bitmask[0]);
+ register SetWordType *b = &(bittqmask[0]);
do {
if (t & *b) ++degree;
- } while (++b < &(bitmask[sizeof(SetWordType)*8]));
+ } while (++b < &(bittqmask[sizeof(SetWordType)*8]));
p++;
}
diff --git a/src/translators/btparse/input.c b/src/translators/btparse/input.c
index dbb7b44..c50468e 100644
--- a/src/translators/btparse/input.c
+++ b/src/translators/btparse/input.c
@@ -164,7 +164,7 @@ finish_parse (int **err_counts)
@RETURNS : false if there were serious errors in the recently-parsed input
true otherwise (no errors or just warnings)
@DESCRIPTION: Gets the "error status" bitmap relative to a saved set of
- error counts and masks of non-serious errors.
+ error counts and tqmasks of non-serious errors.
@GLOBALS :
@CALLS :
@CALLERS :
@@ -174,17 +174,17 @@ finish_parse (int **err_counts)
static boolean
parse_status (int *saved_counts)
{
- ushort ignore_emask;
+ ushort ignore_etqmask;
/*
* This bit-twiddling fetches the error status (which has a bit
- * for each error class), masks off the bits for trivial errors
+ * for each error class), tqmasks off the bits for trivial errors
* to get "true" if there were any serious errors, and then
* returns the opposite of that.
*/
- ignore_emask =
+ ignore_etqmask =
(1<<BTERR_NOTIFY) | (1<<BTERR_CONTENT) | (1<<BTERR_LEXWARN);
- return !(bt_error_status (saved_counts) & ~ignore_emask);
+ return !(bt_error_status (saved_counts) & ~ignore_etqmask);
}
@@ -237,7 +237,7 @@ AST * bt_parse_entry_s (char * entry_text,
return NULL;
}
- zzast_sp = ZZAST_STACKSIZE; /* workaround apparent pccts bug */
+ zzast_sp = ZZAST_STACKSIZE; /* workaround aptqparent pccts bug */
start_parse (NULL, entry_text, line);
entry (&entry_ast); /* enter the parser */
@@ -364,7 +364,7 @@ AST * bt_parse_entry (FILE * infile,
* functions?
*/
- zzast_sp = ZZAST_STACKSIZE; /* workaround apparent pccts bug */
+ zzast_sp = ZZAST_STACKSIZE; /* workaround aptqparent pccts bug */
#if defined(LL_K) || defined(ZZINF_LOOK) || defined(DEMAND_LOOK)
# error One of LL_K, ZZINF_LOOK, or DEMAND_LOOK was defined
diff --git a/src/translators/btparse/lex_auxiliary.c b/src/translators/btparse/lex_auxiliary.c
index 8fac463..9e5b452 100644
--- a/src/translators/btparse/lex_auxiliary.c
+++ b/src/translators/btparse/lex_auxiliary.c
@@ -107,7 +107,7 @@ static int JunkCount; /* non-whitespace chars at toplevel */
* brace depth within a string; we can only end the current string
* when this is zero
* ParenDepth:
- * parenthesis depth within a string; needed for @comment entries
+ * tqparenthesis depth within a string; needed for @comment entries
* that are paren-delimited (because the comment in that case is
* a paren-delimited string)
* StringOpener:
@@ -115,9 +115,9 @@ static int JunkCount; /* non-whitespace chars at toplevel */
* mismatch -- this determines which character ('"' or '}') can
* actually end the string
* StringStart:
- * line on which current string started; if we detect an apparent
+ * line on which current string started; if we detect an aptqparent
* runaway, this is used to report where the runaway started
- * ApparentRunaway:
+ * AptqparentRunaway:
* flags if we have already detected (and warned) that the current
* string appears to be a runaway, so that we don't warn again
* (and again and again and again)
@@ -130,9 +130,9 @@ static int JunkCount; /* non-whitespace chars at toplevel */
*/
static char StringOpener = '\0'; /* '{' or '"' */
static int BraceDepth; /* depth of brace-nesting */
-static int ParenDepth; /* depth of parenthesis-nesting */
+static int ParenDepth; /* depth of tqparenthesis-nesting */
static int StringStart = -1; /* start line of current string */
-static int ApparentRunaway; /* current string looks like runaway */
+static int AptqparentRunaway; /* current string looks like runaway */
static int QuoteWarned; /* already warned about " in string? */
@@ -590,7 +590,7 @@ void start_string (char start_char)
BraceDepth = 0;
ParenDepth = 0;
StringStart = zzline;
- ApparentRunaway = 0;
+ AptqparentRunaway = 0;
QuoteWarned = 0;
if (start_char == '{')
open_brace ();
@@ -598,7 +598,7 @@ void start_string (char start_char)
ParenDepth++;
if (start_char == '"' && EntryState == in_comment)
{
- lexical_error ("comment entries must be delimited by either braces or parentheses");
+ lexical_error ("comment entries must be delimited by either braces or tqparentheses");
EntryState = toplevel;
zzmode (START);
return;
@@ -878,7 +878,7 @@ void check_runaway_string (void)
}
- if (!ApparentRunaway) /* haven't already warned about it */
+ if (!AptqparentRunaway) /* haven't already warned about it */
{
enum { none, entry, field, giveup } guess;
@@ -930,7 +930,7 @@ void check_runaway_string (void)
{
lexical_warning ("possible runaway string started at line %d",
StringStart);
- ApparentRunaway = 1;
+ AptqparentRunaway = 1;
}
}
diff --git a/src/translators/btparse/parse_auxiliary.c b/src/translators/btparse/parse_auxiliary.c
index f509741..105e84e 100644
--- a/src/translators/btparse/parse_auxiliary.c
+++ b/src/translators/btparse/parse_auxiliary.c
@@ -36,7 +36,7 @@ GEN_PRIVATE_ERRFUNC (syntax_error, (char * fmt, ...),
/* this is stolen from PCCTS' err.h */
-static SetWordType bitmask[] =
+static SetWordType bittqmask[] =
{
0x00000001, 0x00000002, 0x00000004, 0x00000008,
0x00000010, 0x00000020, 0x00000040, 0x00000080
@@ -54,7 +54,7 @@ static struct
{ RBRACE, "right brace (\"}\")" },
{ ENTRY_OPEN, "start of entry (\"{\" or \"(\")" },
{ ENTRY_CLOSE,"end of entry (\"}\" or \")\")" },
- { EQUALS, "\"=\"" },
+ { ETQUALS, "\"=\"" },
{ HASH, "\"#\"" },
{ COMMA, "\",\"" },
{ NUMBER, "number" },
@@ -71,7 +71,7 @@ void
fix_token_names (void)
{
int i;
- int num_replace;
+ int num_tqreplace;
#ifdef CLEVER_TOKEN_STUFF /* clever, but it doesn't work... */
/* arg! this doesn't work because I don't know how to find out the
@@ -91,8 +91,8 @@ fix_token_names (void)
}
#endif
- num_replace = (sizeof(new_tokens) / sizeof(*new_tokens));
- for (i = 0; i < num_replace; i++)
+ num_tqreplace = (sizeof(new_tokens) / sizeof(*new_tokens));
+ for (i = 0; i < num_tqreplace; i++)
{
const char *new = new_tokens[i].new_name;
const char **old = zztokens + new_tokens[i].token;
@@ -115,7 +115,7 @@ append_token_set (char *msg, SetWordType *a)
do
{
SetWordType t = *p;
- SetWordType *b = &(bitmask[0]);
+ SetWordType *b = &(bittqmask[0]);
do
{
if (t & *b)
@@ -128,7 +128,7 @@ append_token_set (char *msg, SetWordType *a)
strcat (msg, " or ");
}
e++;
- } while (++b < &(bitmask[sizeof(SetWordType)*8]));
+ } while (++b < &(bittqmask[sizeof(SetWordType)*8]));
} while (++p < endp);
}
diff --git a/src/translators/btparse/postprocess.c b/src/translators/btparse/postprocess.c
index 7f7bfd4..127342c 100644
--- a/src/translators/btparse/postprocess.c
+++ b/src/translators/btparse/postprocess.c
@@ -156,7 +156,7 @@ bt_postprocess_string (char * s, ushort options)
sub-strings, which would be bad if you intend to concatenate
them later in the BibTeX sense.)
- The 'replace' parameter is used to govern whether the
+ The 'tqreplace' parameter is used to govern whether the
existing strings in the AST should be replaced with their
post-processed versions. This can extend as far as
collapsing a series of simple values into a single BTAST_STRING
@@ -168,10 +168,10 @@ bt_postprocess_string (char * s, ushort options)
@CREATED : 1997/01/10, GPW
@MODIFIED : 1997/08/25, GPW: renamed from bt_postprocess_field(), and changed
to take the head of a list of simple values,
- rather than the parent of that list
+ rather than the tqparent of that list
-------------------------------------------------------------------------- */
char *
-bt_postprocess_value (AST * value, ushort options, boolean replace)
+bt_postprocess_value (AST * value, ushort options, boolean tqreplace)
{
AST * simple_value; /* current simple value */
boolean pasting;
@@ -300,7 +300,7 @@ bt_postprocess_value (AST * value, ushort options, boolean replace)
bt_postprocess_string (tmp_string, string_opts);
}
- if (replace)
+ if (tqreplace)
{
simple_value->nodetype = BTAST_STRING;
if (simple_value->text)
@@ -312,12 +312,12 @@ bt_postprocess_value (AST * value, ushort options, boolean replace)
/*
* If the current simple value is a literal string, then just
- * post-process it. This will be done in-place if 'replace' is
+ * post-process it. This will be done in-place if 'tqreplace' is
* true, otherwise a copy of the string will be post-processed.
*/
else if (simple_value->nodetype == BTAST_STRING && simple_value->text)
{
- if (replace)
+ if (tqreplace)
{
tmp_string = simple_value->text;
}
@@ -340,12 +340,12 @@ bt_postprocess_value (AST * value, ushort options, boolean replace)
*/
if (simple_value->nodetype == BTAST_NUMBER)
{
- if (replace && (options & BTO_CONVERT))
+ if (tqreplace && (options & BTO_CONVERT))
simple_value->nodetype = BTAST_STRING;
if (simple_value->text)
{
- if (replace)
+ if (tqreplace)
tmp_string = simple_value->text;
else
{
@@ -395,7 +395,7 @@ bt_postprocess_value (AST * value, ushort options, boolean replace)
* `field', and replace text for first child with new_string.
*/
- if (replace)
+ if (tqreplace)
{
assert (value->right != NULL); /* there has to be > 1 simple value! */
zzfree_ast (value->right); /* free from second simple value on */
@@ -418,7 +418,7 @@ bt_postprocess_value (AST * value, ushort options, boolean replace)
@RETURNS :
@DESCRIPTION: Postprocesses all the strings in a single "field = value"
assignment subtree. Just checks that 'field' does indeed
- point to an BTAST_FIELD node (presumably the parent of a list
+ point to an BTAST_FIELD node (presumably the tqparent of a list
of simple values), downcases the field name, and calls
bt_postprocess_value() on the value.
@GLOBALS :
@@ -428,14 +428,14 @@ bt_postprocess_value (AST * value, ushort options, boolean replace)
@MODIFIED :
-------------------------------------------------------------------------- */
char *
-bt_postprocess_field (AST * field, ushort options, boolean replace)
+bt_postprocess_field (AST * field, ushort options, boolean tqreplace)
{
if (field == NULL) return NULL;
if (field->nodetype != BTAST_FIELD)
usage_error ("bt_postprocess_field: invalid AST node (not a field)");
strlwr (field->text); /* downcase field name */
- return bt_postprocess_value (field->down, options, replace);
+ return bt_postprocess_value (field->down, options, tqreplace);
} /* bt_postprocess_field() */
@@ -464,7 +464,7 @@ bt_postprocess_entry (AST * top, ushort options)
"invalid node type (not entry root)");
strlwr (top->text); /* downcase entry type */
- if (top->down == NULL) return; /* no children at all */
+ if (top->down == NULL) return; /* no tqchildren at all */
cur = top->down;
if (cur->nodetype == BTAST_KEY)
diff --git a/src/translators/btparse/scan.c b/src/translators/btparse/scan.c
index b9899e4..8f01d3c 100644
--- a/src/translators/btparse/scan.c
+++ b/src/translators/btparse/scan.c
@@ -188,7 +188,7 @@ static void act16()
static void act17()
{
- NLA = EQUALS;
+ NLA = ETQUALS;
}
diff --git a/src/translators/btparse/sym.c b/src/translators/btparse/sym.c
index 2426dea..b1eabd9 100644
--- a/src/translators/btparse/sym.c
+++ b/src/translators/btparse/sym.c
@@ -80,7 +80,7 @@
* a = zzs_new("Truck"); zzs_add(a->symbol, a);
*
* p = zzs_get("Plum");
- * if ( p == NULL ) fprintf(stderr, "Hmmm...Can't find 'Plum'\n");
+ * if ( p == NULL ) fprintf(stderr, "Hmmm...Can't tqfind 'Plum'\n");
*
* p = zzs_rmscope(&scope1)
* for (; p!=NULL; p=p->scope) {printf("Scope1: %s\n", p->symbol);}
diff --git a/src/translators/btparse/tokens.h b/src/translators/btparse/tokens.h
index 6f9405a..1f51459 100644
--- a/src/translators/btparse/tokens.h
+++ b/src/translators/btparse/tokens.h
@@ -17,7 +17,7 @@
#define RBRACE 12
#define ENTRY_OPEN 13
#define ENTRY_CLOSE 14
-#define EQUALS 15
+#define ETQUALS 15
#define HASH 16
#define COMMA 17
#define STRING 25
diff --git a/src/translators/csvexporter.cpp b/src/translators/csvexporter.cpp
index bb206e1..4d4d32e 100644
--- a/src/translators/csvexporter.cpp
+++ b/src/translators/csvexporter.cpp
@@ -21,38 +21,38 @@
#include <klineedit.h>
#include <kconfig.h>
-#include <qgroupbox.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qwhatsthis.h>
+#include <tqgroupbox.h>
+#include <tqcheckbox.h>
+#include <tqlayout.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqwhatsthis.h>
using Tellico::Export::CSVExporter;
CSVExporter::CSVExporter() : Tellico::Export::Exporter(),
m_includeTitles(true),
- m_delimiter(QChar(',')),
+ m_delimiter(TQChar(',')),
m_widget(0) {
}
-QString CSVExporter::formatString() const {
+TQString CSVExporter::formatString() const {
return i18n("CSV");
}
-QString CSVExporter::fileFilter() const {
- return i18n("*.csv|CSV Files (*.csv)") + QChar('\n') + i18n("*|All Files");
+TQString CSVExporter::fileFilter() const {
+ return i18n("*.csv|CSV Files (*.csv)") + TQChar('\n') + i18n("*|All Files");
}
-QString& CSVExporter::escapeText(QString& text_) {
+TQString& CSVExporter::escapeText(TQString& text_) {
bool quotes = false;
- if(text_.find('"') != -1) {
+ if(text_.tqfind('"') != -1) {
quotes = true;
// quotation marks will be escaped by using a double pair
- text_.replace('"', QString::fromLatin1("\"\""));
+ text_.tqreplace('"', TQString::tqfromLatin1("\"\""));
}
// if the text contains quotes or the delimiter, it needs to be surrounded by quotes
- if(quotes || text_.find(m_delimiter) != -1) {
+ if(quotes || text_.tqfind(m_delimiter) != -1) {
text_.prepend('"');
text_.append('"');
}
@@ -64,14 +64,14 @@ bool CSVExporter::exec() {
return false;
}
- QString text;
+ TQString text;
Data::FieldVec fields = collection()->fields();
Data::FieldVec::Iterator fIt;
if(m_includeTitles) {
for(fIt = fields.begin(); fIt != fields.end(); ++fIt) {
- QString title = fIt->title();
+ TQString title = fIt->title();
text += escapeText(title);
if(!fIt.nextEnd()) {
text += m_delimiter;
@@ -82,7 +82,7 @@ bool CSVExporter::exec() {
bool format = options() & Export::ExportFormatted;
- QString tmp;
+ TQString tmp;
for(Data::EntryVec::ConstIterator entryIt = entries().begin(); entryIt != entries().end(); ++entryIt) {
for(fIt = fields.begin(); fIt != fields.end(); ++fIt) {
tmp = entryIt->field(fIt->name(), format);
@@ -98,61 +98,61 @@ bool CSVExporter::exec() {
return FileHandler::writeTextURL(url(), text, options() & ExportUTF8, options() & Export::ExportForce);
}
-QWidget* CSVExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
- if(m_widget && m_widget->parent() == parent_) {
+TQWidget* CSVExporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) {
+ if(m_widget && TQT_BASE_OBJECT(m_widget->tqparent()) == TQT_BASE_OBJECT(tqparent_)) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* box = new QGroupBox(1, Qt::Horizontal, i18n("CSV Options"), m_widget);
+ TQGroupBox* box = new TQGroupBox(1, Qt::Horizontal, i18n("CSV Options"), m_widget);
l->addWidget(box);
- m_checkIncludeTitles = new QCheckBox(i18n("Include field titles as column headers"), box);
+ m_checkIncludeTitles = new TQCheckBox(i18n("Include field titles as column headers"), box);
m_checkIncludeTitles->setChecked(m_includeTitles);
- QWhatsThis::add(m_checkIncludeTitles, i18n("If checked, a header row will be added with the "
+ TQWhatsThis::add(m_checkIncludeTitles, i18n("If checked, a header row will be added with the "
"field titles."));
- QButtonGroup* delimiterGroup = new QButtonGroup(0, Qt::Vertical, i18n("Delimiter"), box);
- QGridLayout* m_delimiterGroupLayout = new QGridLayout(delimiterGroup->layout());
- m_delimiterGroupLayout->setAlignment(Qt::AlignTop);
- QWhatsThis::add(delimiterGroup, i18n("In addition to a comma, other characters may be used as "
+ TQButtonGroup* delimiterGroup = new TQButtonGroup(0, Qt::Vertical, i18n("Delimiter"), box);
+ TQGridLayout* m_delimiterGroupLayout = new TQGridLayout(delimiterGroup->tqlayout());
+ m_delimiterGroupLayout->tqsetAlignment(TQt::AlignTop);
+ TQWhatsThis::add(delimiterGroup, i18n("In addition to a comma, other characters may be used as "
"a delimiter, separating each value in the file."));
- m_radioComma = new QRadioButton(delimiterGroup);
+ m_radioComma = new TQRadioButton(delimiterGroup);
m_radioComma->setText(i18n("Comma"));
m_radioComma->setChecked(true);
- QWhatsThis::add(m_radioComma, i18n("Use a comma as the delimiter."));
+ TQWhatsThis::add(m_radioComma, i18n("Use a comma as the delimiter."));
m_delimiterGroupLayout->addWidget(m_radioComma, 0, 0);
- m_radioSemicolon = new QRadioButton( delimiterGroup);
+ m_radioSemicolon = new TQRadioButton( delimiterGroup);
m_radioSemicolon->setText(i18n("Semicolon"));
- QWhatsThis::add(m_radioSemicolon, i18n("Use a semi-colon as the delimiter."));
+ TQWhatsThis::add(m_radioSemicolon, i18n("Use a semi-colon as the delimiter."));
m_delimiterGroupLayout->addWidget(m_radioSemicolon, 0, 1);
- m_radioTab = new QRadioButton(delimiterGroup);
+ m_radioTab = new TQRadioButton(delimiterGroup);
m_radioTab->setText(i18n("Tab"));
- QWhatsThis::add(m_radioTab, i18n("Use a tab as the delimiter."));
+ TQWhatsThis::add(m_radioTab, i18n("Use a tab as the delimiter."));
m_delimiterGroupLayout->addWidget(m_radioTab, 1, 0);
- m_radioOther = new QRadioButton(delimiterGroup);
+ m_radioOther = new TQRadioButton(delimiterGroup);
m_radioOther->setText(i18n("Other"));
- QWhatsThis::add(m_radioOther, i18n("Use a custom string as the delimiter."));
+ TQWhatsThis::add(m_radioOther, i18n("Use a custom string as the delimiter."));
m_delimiterGroupLayout->addWidget(m_radioOther, 1, 1);
m_editOther = new KLineEdit(delimiterGroup);
m_editOther->setEnabled(m_radioOther->isChecked());
- QWhatsThis::add(m_editOther, i18n("A custom string, such as a colon, may be used as a delimiter."));
+ TQWhatsThis::add(m_editOther, i18n("A custom string, such as a colon, may be used as a delimiter."));
m_delimiterGroupLayout->addWidget(m_editOther, 1, 2);
- QObject::connect(m_radioOther, SIGNAL(toggled(bool)),
- m_editOther, SLOT(setEnabled(bool)));
+ TQObject::connect(m_radioOther, TQT_SIGNAL(toggled(bool)),
+ m_editOther, TQT_SLOT(setEnabled(bool)));
- if(m_delimiter == QChar(',')) {
+ if(m_delimiter == TQChar(',')) {
m_radioComma->setChecked(true);
- } else if(m_delimiter == QChar(';')) {
+ } else if(m_delimiter == TQChar(';')) {
m_radioSemicolon->setChecked(true);
- } else if(m_delimiter == QChar('\t')) {
+ } else if(m_delimiter == TQChar('\t')) {
m_radioTab->setChecked(true);
} else if(!m_delimiter.isEmpty()) {
m_radioOther->setChecked(true);
@@ -165,7 +165,7 @@ QWidget* CSVExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
}
void CSVExporter::readOptions(KConfig* config_) {
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_includeTitles = group.readBoolEntry("Include Titles", m_includeTitles);
m_delimiter = group.readEntry("Delimiter", m_delimiter);
}
@@ -173,16 +173,16 @@ void CSVExporter::readOptions(KConfig* config_) {
void CSVExporter::saveOptions(KConfig* config_) {
m_includeTitles = m_checkIncludeTitles->isChecked();
if(m_radioComma->isChecked()) {
- m_delimiter = QChar(',');
+ m_delimiter = TQChar(',');
} else if(m_radioSemicolon->isChecked()) {
- m_delimiter = QChar(';');
+ m_delimiter = TQChar(';');
} else if(m_radioTab->isChecked()) {
- m_delimiter = QChar('\t');
+ m_delimiter = TQChar('\t');
} else {
m_delimiter = m_editOther->text();
}
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
group.writeEntry("Include Titles", m_includeTitles);
group.writeEntry("Delimiter", m_delimiter);
}
diff --git a/src/translators/csvexporter.h b/src/translators/csvexporter.h
index 23624e3..ee300cf 100644
--- a/src/translators/csvexporter.h
+++ b/src/translators/csvexporter.h
@@ -17,9 +17,9 @@
class KLineEdit;
class KConfig;
-class QWidget;
-class QCheckBox;
-class QRadioButton;
+class TQWidget;
+class TQCheckBox;
+class TQRadioButton;
#include "exporter.h"
@@ -31,30 +31,31 @@ namespace Tellico {
*/
class CSVExporter : public Exporter {
Q_OBJECT
+ TQ_OBJECT
public:
CSVExporter();
virtual bool exec();
- virtual QString formatString() const;
- virtual QString fileFilter() const;
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const;
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
virtual void readOptions(KConfig* config);
virtual void saveOptions(KConfig* config);
private:
- QString& escapeText(QString& text);
+ TQString& escapeText(TQString& text);
bool m_includeTitles;
- QString m_delimiter;
-
- QWidget* m_widget;
- QCheckBox* m_checkIncludeTitles;
- QRadioButton* m_radioComma;
- QRadioButton* m_radioSemicolon;
- QRadioButton* m_radioTab;
- QRadioButton* m_radioOther;
+ TQString m_delimiter;
+
+ TQWidget* m_widget;
+ TQCheckBox* m_checkIncludeTitles;
+ TQRadioButton* m_radioComma;
+ TQRadioButton* m_radioSemicolon;
+ TQRadioButton* m_radioTab;
+ TQRadioButton* m_radioOther;
KLineEdit* m_editOther;
};
diff --git a/src/translators/csvimporter.cpp b/src/translators/csvimporter.cpp
index f0c0900..683a3d1 100644
--- a/src/translators/csvimporter.cpp
+++ b/src/translators/csvimporter.cpp
@@ -36,17 +36,17 @@ extern "C" {
#include <kconfig.h>
#include <kmessagebox.h>
-#include <qgroupbox.h>
-#include <qlayout.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qwhatsthis.h>
-#include <qtable.h>
-#include <qvaluevector.h>
-#include <qregexp.h>
+#include <tqgroupbox.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqwhatsthis.h>
+#include <tqtable.h>
+#include <tqvaluevector.h>
+#include <tqregexp.h>
using Tellico::Import::CSVImporter;
@@ -55,22 +55,22 @@ static void writeRow(char buffer, void* data);
class CSVImporter::Parser {
public:
- Parser(const QString& str) : stream(new QTextIStream(&str)) { csv_init(&parser, 0); }
+ Parser(const TQString& str) : stream(new TQTextIStream(&str)) { csv_init(&parser, 0); }
~Parser() { csv_free(parser); delete stream; stream = 0; }
- void setDelimiter(const QString& s) { Q_ASSERT(s.length() == 1); csv_set_delim(parser, s[0].latin1()); }
- void reset(const QString& str) { delete stream; stream = new QTextIStream(&str); };
+ void setDelimiter(const TQString& s) { Q_ASSERT(s.length() == 1); csv_set_delim(parser, s[0].latin1()); }
+ void reset(const TQString& str) { delete stream; stream = new TQTextIStream(&str); };
bool hasNext() { return !stream->atEnd(); }
void skipLine() { stream->readLine(); }
- void addToken(const QString& t) { tokens += t; }
+ void addToken(const TQString& t) { tokens += t; }
void setRowDone(bool b) { done = b; }
- QStringList nextTokens() {
+ TQStringList nextTokens() {
tokens.clear();
done = false;
while(hasNext() && !done) {
- QCString line = stream->readLine().utf8() + '\n'; // need the eol char
+ TQCString line = stream->readLine().utf8() + '\n'; // need the eol char
csv_parse(parser, line, line.length(), &writeToken, &writeRow, this);
}
csv_fini(parser, &writeToken, &writeRow, this);
@@ -79,14 +79,14 @@ public:
private:
struct csv_parser* parser;
- QTextIStream* stream;
- QStringList tokens;
+ TQTextIStream* stream;
+ TQStringList tokens;
bool done;
};
static void writeToken(char* buffer, size_t len, void* data) {
CSVImporter::Parser* p = static_cast<CSVImporter::Parser*>(data);
- p->addToken(QString::fromUtf8(buffer, len));
+ p->addToken(TQString::fromUtf8(buffer, len));
}
static void writeRow(char c, void* data) {
@@ -99,7 +99,7 @@ CSVImporter::CSVImporter(const KURL& url_) : Tellico::Import::TextImporter(url_)
m_coll(0),
m_existingCollection(0),
m_firstRowHeader(false),
- m_delimiter(QString::fromLatin1(",")),
+ m_delimiter(TQString::tqfromLatin1(",")),
m_cancelled(false),
m_widget(0),
m_table(0),
@@ -123,12 +123,12 @@ Tellico::Data::CollPtr CSVImporter::collection() {
m_coll = CollectionFactory::collection(m_comboColl->currentType(), true);
}
- const QStringList existingNames = m_coll->fieldNames();
+ const TQStringList existingNames = m_coll->fieldNames();
- QValueVector<int> cols;
- QStringList names;
+ TQValueVector<int> cols;
+ TQStringList names;
for(int col = 0; col < m_table->numCols(); ++col) {
- QString t = m_table->horizontalHeader()->label(col);
+ TQString t = m_table->horizontalHeader()->label(col);
if(m_existingCollection && m_existingCollection->fieldByTitle(t)) {
// the collection might have the right field, but a different title, say for translations
Data::FieldPtr f = m_existingCollection->fieldByTitle(t);
@@ -157,23 +157,23 @@ Tellico::Data::CollPtr CSVImporter::collection() {
m_parser->skipLine();
}
- const uint numLines = text().contains('\n');
- const uint stepSize = QMAX(s_stepSize, numLines/100);
+ const uint numLines = text().tqcontains('\n');
+ const uint stepSize = TQMAX(s_stepSize, numLines/100);
const bool showProgress = options() & ImportProgress;
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(numLines);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
uint j = 0;
while(!m_cancelled && m_parser->hasNext()) {
bool empty = true;
Data::EntryPtr entry = new Data::Entry(m_coll);
- QStringList values = m_parser->nextTokens();
+ TQStringList values = m_parser->nextTokens();
for(uint i = 0; i < names.size(); ++i) {
-// QString value = values[cols[i]].simplifyWhiteSpace();
- QString value = values[cols[i]].stripWhiteSpace();
+// TQString value = values[cols[i]].simplifyWhiteSpace();
+ TQString value = values[cols[i]].stripWhiteSpace();
bool success = entry->setField(names[i], value);
// we might need to add a new allowed value
// assume that if the user is importing the value, it should be allowed
@@ -202,7 +202,7 @@ Tellico::Data::CollPtr CSVImporter::collection() {
}
{
- KConfigGroup config(KGlobal::config(), QString::fromLatin1("ImportOptions - CSV"));
+ KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - CSV"));
config.writeEntry("Delimiter", m_delimiter);
config.writeEntry("First Row Titles", m_firstRowHeader);
}
@@ -210,117 +210,117 @@ Tellico::Data::CollPtr CSVImporter::collection() {
return m_coll;
}
-QWidget* CSVImporter::widget(QWidget* parent_, const char* name_) {
- if(m_widget && m_widget->parent() == parent_) {
+TQWidget* CSVImporter::widget(TQWidget* tqparent_, const char* name_) {
+ if(m_widget && TQT_BASE_OBJECT(m_widget->tqparent()) == TQT_BASE_OBJECT(tqparent_)) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* group = new QGroupBox(1, Qt::Horizontal, i18n("CSV Options"), m_widget);
+ TQGroupBox* group = new TQGroupBox(1, Qt::Horizontal, i18n("CSV Options"), m_widget);
l->addWidget(group);
- QHBox* box = new QHBox(group);
+ TQHBox* box = new TQHBox(group);
box->setSpacing(5);
- QLabel* lab = new QLabel(i18n("Collection &type:"), box);
+ TQLabel* lab = new TQLabel(i18n("Collection &type:"), box);
m_comboColl = new GUI::CollectionTypeCombo(box);
lab->setBuddy(m_comboColl);
- QWhatsThis::add(m_comboColl, i18n("Select the type of collection being imported."));
- connect(m_comboColl, SIGNAL(activated(int)), SLOT(slotTypeChanged()));
+ TQWhatsThis::add(m_comboColl, i18n("Select the type of collection being imported."));
+ connect(m_comboColl, TQT_SIGNAL(activated(int)), TQT_SLOT(slotTypeChanged()));
// need a spacer
- QWidget* w = new QWidget(box);
+ TQWidget* w = new TQWidget(box);
box->setStretchFactor(w, 1);
- m_checkFirstRowHeader = new QCheckBox(i18n("&First row contains field titles"), group);
- QWhatsThis::add(m_checkFirstRowHeader, i18n("If checked, the first row is used as field titles."));
- connect(m_checkFirstRowHeader, SIGNAL(toggled(bool)), SLOT(slotFirstRowHeader(bool)));
+ m_checkFirstRowHeader = new TQCheckBox(i18n("&First row contains field titles"), group);
+ TQWhatsThis::add(m_checkFirstRowHeader, i18n("If checked, the first row is used as field titles."));
+ connect(m_checkFirstRowHeader, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotFirstRowHeader(bool)));
- QHBox* hbox2 = new QHBox(group);
- m_delimiterGroup = new QButtonGroup(0, Qt::Vertical, i18n("Delimiter"), hbox2);
- QGridLayout* m_delimiterGroupLayout = new QGridLayout(m_delimiterGroup->layout(), 3, 3);
- m_delimiterGroupLayout->setAlignment(Qt::AlignTop);
- QWhatsThis::add(m_delimiterGroup, i18n("In addition to a comma, other characters may be used as "
+ TQHBox* hbox2 = new TQHBox(group);
+ m_delimiterGroup = new TQButtonGroup(0, Qt::Vertical, i18n("Delimiter"), hbox2);
+ TQGridLayout* m_delimiterGroupLayout = new TQGridLayout(m_delimiterGroup->tqlayout(), 3, 3);
+ m_delimiterGroupLayout->tqsetAlignment(TQt::AlignTop);
+ TQWhatsThis::add(m_delimiterGroup, i18n("In addition to a comma, other characters may be used as "
"a delimiter, separating each value in the file."));
- connect(m_delimiterGroup, SIGNAL(clicked(int)), SLOT(slotDelimiter()));
+ connect(m_delimiterGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotDelimiter()));
- m_radioComma = new QRadioButton(m_delimiterGroup);
+ m_radioComma = new TQRadioButton(m_delimiterGroup);
m_radioComma->setText(i18n("&Comma"));
m_radioComma->setChecked(true);
- QWhatsThis::add(m_radioComma, i18n("Use a comma as the delimiter."));
+ TQWhatsThis::add(m_radioComma, i18n("Use a comma as the delimiter."));
m_delimiterGroupLayout->addWidget(m_radioComma, 1, 0);
- m_radioSemicolon = new QRadioButton( m_delimiterGroup);
+ m_radioSemicolon = new TQRadioButton( m_delimiterGroup);
m_radioSemicolon->setText(i18n("&Semicolon"));
- QWhatsThis::add(m_radioSemicolon, i18n("Use a semi-colon as the delimiter."));
+ TQWhatsThis::add(m_radioSemicolon, i18n("Use a semi-colon as the delimiter."));
m_delimiterGroupLayout->addWidget(m_radioSemicolon, 1, 1);
- m_radioTab = new QRadioButton(m_delimiterGroup);
+ m_radioTab = new TQRadioButton(m_delimiterGroup);
m_radioTab->setText(i18n("Ta&b"));
- QWhatsThis::add(m_radioTab, i18n("Use a tab as the delimiter."));
+ TQWhatsThis::add(m_radioTab, i18n("Use a tab as the delimiter."));
m_delimiterGroupLayout->addWidget(m_radioTab, 2, 0);
- m_radioOther = new QRadioButton(m_delimiterGroup);
+ m_radioOther = new TQRadioButton(m_delimiterGroup);
m_radioOther->setText(i18n("Ot&her:"));
- QWhatsThis::add(m_radioOther, i18n("Use a custom string as the delimiter."));
+ TQWhatsThis::add(m_radioOther, i18n("Use a custom string as the delimiter."));
m_delimiterGroupLayout->addWidget(m_radioOther, 2, 1);
m_editOther = new KLineEdit(m_delimiterGroup);
m_editOther->setEnabled(false);
m_editOther->setFixedWidth(m_widget->fontMetrics().width('X') * 4);
m_editOther->setMaxLength(1);
- QWhatsThis::add(m_editOther, i18n("A custom string, such as a colon, may be used as a delimiter."));
+ TQWhatsThis::add(m_editOther, i18n("A custom string, such as a colon, may be used as a delimiter."));
m_delimiterGroupLayout->addWidget(m_editOther, 2, 2);
- connect(m_radioOther, SIGNAL(toggled(bool)),
- m_editOther, SLOT(setEnabled(bool)));
- connect(m_editOther, SIGNAL(textChanged(const QString&)), SLOT(slotDelimiter()));
+ connect(m_radioOther, TQT_SIGNAL(toggled(bool)),
+ m_editOther, TQT_SLOT(setEnabled(bool)));
+ connect(m_editOther, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotDelimiter()));
- w = new QWidget(hbox2);
+ w = new TQWidget(hbox2);
hbox2->setStretchFactor(w, 1);
- m_table = new QTable(5, 0, group);
- m_table->setSelectionMode(QTable::Single);
- m_table->setFocusStyle(QTable::FollowStyle);
+ m_table = new TQTable(5, 0, group);
+ m_table->setSelectionMode(TQTable::Single);
+ m_table->setFocusStyle(TQTable::FollowStyle);
m_table->setLeftMargin(0);
m_table->verticalHeader()->hide();
m_table->horizontalHeader()->setClickEnabled(true);
m_table->setReadOnly(true);
m_table->setMinimumHeight(m_widget->fontMetrics().lineSpacing() * 8);
- QWhatsThis::add(m_table, i18n("The table shows up to the first five lines of the CSV file."));
- connect(m_table, SIGNAL(currentChanged(int, int)), SLOT(slotCurrentChanged(int, int)));
- connect(m_table->horizontalHeader(), SIGNAL(clicked(int)), SLOT(slotHeaderClicked(int)));
+ TQWhatsThis::add(m_table, i18n("The table shows up to the first five lines of the CSV file."));
+ connect(m_table, TQT_SIGNAL(currentChanged(int, int)), TQT_SLOT(slotCurrentChanged(int, int)));
+ connect(m_table->horizontalHeader(), TQT_SIGNAL(clicked(int)), TQT_SLOT(slotHeaderClicked(int)));
- QWidget* hbox = new QWidget(group);
- QHBoxLayout* hlay = new QHBoxLayout(hbox, 5);
+ TQWidget* hbox = new TQWidget(group);
+ TQHBoxLayout* hlay = new TQHBoxLayout(hbox, 5);
hlay->addStretch(10);
- QWhatsThis::add(hbox, i18n("<qt>Set each column to correspond to a field in the collection by choosing "
+ TQWhatsThis::add(hbox, i18n("<qt>Set each column to correspond to a field in the collection by choosing "
"a column, selecting the field, then clicking the <i>Assign Field</i> button.</qt>"));
- lab = new QLabel(i18n("Co&lumn:"), hbox);
+ lab = new TQLabel(i18n("Co&lumn:"), hbox);
hlay->addWidget(lab);
m_colSpinBox = new KIntSpinBox(hbox);
hlay->addWidget(m_colSpinBox);
m_colSpinBox->setMinValue(1);
- connect(m_colSpinBox, SIGNAL(valueChanged(int)), SLOT(slotSelectColumn(int)));
+ connect(m_colSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotSelectColumn(int)));
lab->setBuddy(m_colSpinBox);
hlay->addSpacing(10);
- lab = new QLabel(i18n("&Data field in this column:"), hbox);
+ lab = new TQLabel(i18n("&Data field in this column:"), hbox);
hlay->addWidget(lab);
m_comboField = new KComboBox(hbox);
hlay->addWidget(m_comboField);
- connect(m_comboField, SIGNAL(activated(int)), SLOT(slotFieldChanged(int)));
+ connect(m_comboField, TQT_SIGNAL(activated(int)), TQT_SLOT(slotFieldChanged(int)));
lab->setBuddy(m_comboField);
hlay->addSpacing(10);
m_setColumnBtn = new KPushButton(i18n("&Assign Field"), hbox);
hlay->addWidget(m_setColumnBtn);
- m_setColumnBtn->setIconSet(SmallIconSet(QString::fromLatin1("apply")));
- connect(m_setColumnBtn, SIGNAL(clicked()), SLOT(slotSetColumnTitle()));
+ m_setColumnBtn->setIconSet(SmallIconSet(TQString::tqfromLatin1("apply")));
+ connect(m_setColumnBtn, TQT_SIGNAL(clicked()), TQT_SLOT(slotSetColumnTitle()));
hlay->addStretch(10);
l->addStretch(1);
- KConfigGroup config(KGlobal::config(), QString::fromLatin1("ImportOptions - CSV"));
+ KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - CSV"));
m_delimiter = config.readEntry("Delimiter", m_delimiter);
m_firstRowHeader = config.readBoolEntry("First Row Titles", m_firstRowHeader);
@@ -361,13 +361,13 @@ void CSVImporter::fillTable() {
int maxCols = 0;
int row = 0;
for( ; m_parser->hasNext() && row < m_table->numRows(); ++row) {
- QStringList values = m_parser->nextTokens();
+ TQStringList values = m_parser->nextTokens();
if(static_cast<int>(values.count()) > m_table->numCols()) {
m_table->setNumCols(values.count());
m_colSpinBox->setMaxValue(values.count());
}
int col = 0;
- for(QStringList::ConstIterator it = values.begin(); it != values.end(); ++it) {
+ for(TQStringList::ConstIterator it = values.begin(); it != values.end(); ++it) {
m_table->setText(row, col, *it);
m_table->adjustColumn(col);
++col;
@@ -443,14 +443,14 @@ void CSVImporter::slotSelectColumn(int pos_) {
void CSVImporter::slotSetColumnTitle() {
int col = m_colSpinBox->value()-1;
- const QString title = m_comboField->currentText();
+ const TQString title = m_comboField->currentText();
m_table->horizontalHeader()->setLabel(col, title);
m_hasAssignedFields = true;
// make sure none of the other columns have this title
bool found = false;
for(int i = 0; i < col; ++i) {
if(m_table->horizontalHeader()->label(i) == title) {
- m_table->horizontalHeader()->setLabel(i, QString::number(i+1));
+ m_table->horizontalHeader()->setLabel(i, TQString::number(i+1));
found = true;
break;
}
@@ -461,7 +461,7 @@ void CSVImporter::slotSetColumnTitle() {
}
for(int i = col+1; i < m_table->numCols(); ++i) {
if(m_table->horizontalHeader()->label(i) == title) {
- m_table->horizontalHeader()->setLabel(i, QString::number(i+1));
+ m_table->horizontalHeader()->setLabel(i, TQString::number(i+1));
break;
}
}
@@ -477,7 +477,7 @@ void CSVImporter::updateHeader(bool force_) {
Data::CollPtr c = m_existingCollection ? m_existingCollection : m_coll;
for(int col = 0; col < m_table->numCols(); ++col) {
- QString s = m_table->text(0, col);
+ TQString s = m_table->text(0, col);
Data::FieldPtr f;
if(c) {
c->fieldByTitle(s);
@@ -489,7 +489,7 @@ void CSVImporter::updateHeader(bool force_) {
m_table->horizontalHeader()->setLabel(col, f->title());
m_hasAssignedFields = true;
} else {
- m_table->horizontalHeader()->setLabel(col, QString::number(col+1));
+ m_table->horizontalHeader()->setLabel(col, TQString::number(col+1));
}
}
}
@@ -504,7 +504,7 @@ void CSVImporter::slotFieldChanged(int idx_) {
uint count = c->fieldTitles().count();
CollectionFieldsDialog dlg(c, m_widget);
// dlg.setModal(true);
- if(dlg.exec() == QDialog::Accepted) {
+ if(dlg.exec() == TQDialog::Accepted) {
m_comboField->clear();
m_comboField->insertStringList(c->fieldTitles());
m_comboField->insertItem('<' + i18n("New Field") + '>');
@@ -536,7 +536,7 @@ void CSVImporter::slotActionChanged(int action_) {
case Import::Merge:
{
m_comboColl->clear();
- QString name = CollectionFactory::nameMap()[currColl->type()];
+ TQString name = CollectionFactory::nameMap()[currColl->type()];
m_comboColl->insertItem(name, currColl->type());
m_existingCollection = currColl;
}
diff --git a/src/translators/csvimporter.h b/src/translators/csvimporter.h
index 6561584..d12f3c0 100644
--- a/src/translators/csvimporter.h
+++ b/src/translators/csvimporter.h
@@ -21,10 +21,10 @@ class KComboBox;
class KIntSpinBox;
class KPushButton;
-class QButtonGroup;
-class QCheckBox;
-class QRadioButton;
-class QTable;
+class TQButtonGroup;
+class TQCheckBox;
+class TQRadioButton;
+class TQTable;
#include "textimporter.h"
#include "../datavectors.h"
@@ -40,6 +40,7 @@ namespace Tellico {
*/
class CSVImporter : public TextImporter {
Q_OBJECT
+ TQ_OBJECT
public:
class Parser;
@@ -55,7 +56,7 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
virtual bool validImport() const;
@@ -80,19 +81,19 @@ private:
Data::CollPtr m_coll;
Data::CollPtr m_existingCollection; // used to grab fields from current collection in window
bool m_firstRowHeader;
- QString m_delimiter;
+ TQString m_delimiter;
bool m_cancelled;
- QWidget* m_widget;
+ TQWidget* m_widget;
GUI::CollectionTypeCombo* m_comboColl;
- QCheckBox* m_checkFirstRowHeader;
- QButtonGroup* m_delimiterGroup;
- QRadioButton* m_radioComma;
- QRadioButton* m_radioSemicolon;
- QRadioButton* m_radioTab;
- QRadioButton* m_radioOther;
+ TQCheckBox* m_checkFirstRowHeader;
+ TQButtonGroup* m_delimiterGroup;
+ TQRadioButton* m_radioComma;
+ TQRadioButton* m_radioSemicolon;
+ TQRadioButton* m_radioTab;
+ TQRadioButton* m_radioOther;
KLineEdit* m_editOther;
- QTable* m_table;
+ TQTable* m_table;
KIntSpinBox* m_colSpinBox;
KComboBox* m_comboField;
KPushButton* m_setColumnBtn;
diff --git a/src/translators/dataimporter.h b/src/translators/dataimporter.h
index 4d21a53..46a512d 100644
--- a/src/translators/dataimporter.h
+++ b/src/translators/dataimporter.h
@@ -25,6 +25,7 @@ namespace Tellico {
*/
class DataImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
enum Source { URL, Text };
@@ -35,11 +36,11 @@ public:
// DataImporter(const KURL& url) : Importer(url), m_data(FileHandler::readDataFile(url)), m_source(URL) {}
DataImporter(const KURL& url) : Importer(url), m_source(URL) { m_fileRef = FileHandler::fileRef(url); }
/**
- * Since the conversion to a QCString appends a \0 character at the end, remove it.
+ * Since the conversion to a TQCString appends a \0 character at the end, remove it.
*
* @param text The text. It MUST be in UTF-8.
*/
- DataImporter(const QString& text) : Importer(text), m_data(text.utf8()), m_source(Text), m_fileRef(0)
+ DataImporter(const TQString& text) : Importer(text), m_data(text.utf8()), m_source(Text), m_fileRef(0)
{ m_data.truncate(m_data.size()-1); }
/**
*/
@@ -47,7 +48,7 @@ public:
Source source() const { return m_source; }
- virtual void setText(const QString& text) {
+ virtual void setText(const TQString& text) {
Importer::setText(text); m_data = text.utf8(); m_data.truncate(m_data.size()-1); m_source = Text;
}
@@ -57,11 +58,11 @@ protected:
*
* @return the file data
*/
- const QByteArray& data() const { return m_data; }
+ const TQByteArray& data() const { return m_data; }
FileHandler::FileRef& fileRef() const { return *m_fileRef; }
private:
- QByteArray m_data;
+ TQByteArray m_data;
Source m_source;
FileHandler::FileRef* m_fileRef;
};
diff --git a/src/translators/dcimporter.cpp b/src/translators/dcimporter.cpp
index c8bb59f..55d9716 100644
--- a/src/translators/dcimporter.cpp
+++ b/src/translators/dcimporter.cpp
@@ -21,41 +21,41 @@ using Tellico::Import::DCImporter;
DCImporter::DCImporter(const KURL& url_) : XMLImporter(url_) {
}
-DCImporter::DCImporter(const QString& text_) : XMLImporter(text_) {
+DCImporter::DCImporter(const TQString& text_) : XMLImporter(text_) {
}
-DCImporter::DCImporter(const QDomDocument& dom_) : XMLImporter(dom_) {
+DCImporter::DCImporter(const TQDomDocument& dom_) : XMLImporter(dom_) {
}
Tellico::Data::CollPtr DCImporter::collection() {
- const QString& dc = XML::nsDublinCore;
- const QString& zing = XML::nsZing;
+ const TQString& dc = XML::nsDublinCore;
+ const TQString& zing = XML::nsZing;
Data::CollPtr c = new Data::BookCollection(true);
- QDomDocument doc = domDocument();
+ TQDomDocument doc = domDocument();
- QRegExp authorDateRX(QString::fromLatin1(",?(\\s+\\d{4}-?(?:\\d{4})?\\.?)(.*)$"));
- QRegExp dateRX(QString::fromLatin1("\\d{4}"));
+ TQRegExp authorDateRX(TQString::tqfromLatin1(",?(\\s+\\d{4}-?(?:\\d{4})?\\.?)(.*)$"));
+ TQRegExp dateRX(TQString::tqfromLatin1("\\d{4}"));
- QDomNodeList recordList = doc.elementsByTagNameNS(zing, QString::fromLatin1("recordData"));
+ TQDomNodeList recordList = doc.elementsByTagNameNS(zing, TQString::tqfromLatin1("recordData"));
myDebug() << "DCImporter::collection() - number of records: " << recordList.count() << endl;
enum { UnknownNS, UseNS, NoNS } useNS = UnknownNS;
#define GETELEMENTS(s) (useNS == NoNS) \
- ? elem.elementsByTagName(QString::fromLatin1(s)) \
- : elem.elementsByTagNameNS(dc, QString::fromLatin1(s))
+ ? elem.elementsByTagName(TQString::tqfromLatin1(s)) \
+ : elem.elementsByTagNameNS(dc, TQString::tqfromLatin1(s))
for(uint i = 0; i < recordList.count(); ++i) {
Data::EntryPtr e = new Data::Entry(c);
- QDomElement elem = recordList.item(i).toElement();
+ TQDomElement elem = recordList.item(i).toElement();
- QDomNodeList nodeList = GETELEMENTS("title");
+ TQDomNodeList nodeList = GETELEMENTS("title");
if(nodeList.count() == 0) { // no title, skip
if(useNS == UnknownNS) {
- nodeList = elem.elementsByTagName(QString::fromLatin1("title"));
+ nodeList = elem.elementsByTagName(TQString::tqfromLatin1("title"));
if(nodeList.count() > 0) {
useNS = NoNS;
} else {
@@ -69,15 +69,15 @@ Tellico::Data::CollPtr DCImporter::collection() {
} else if(useNS == UnknownNS) {
useNS = UseNS;
}
- QString s = nodeList.item(0).toElement().text();
- s.replace('\n', ' ');
+ TQString s = nodeList.item(0).toElement().text();
+ s.tqreplace('\n', ' ');
s = s.simplifyWhiteSpace();
- e->setField(QString::fromLatin1("title"), s);
+ e->setField(TQString::tqfromLatin1("title"), s);
nodeList = GETELEMENTS("creator");
- QStringList creators;
+ TQStringList creators;
for(uint j = 0; j < nodeList.count(); ++j) {
- QString s = nodeList.item(j).toElement().text();
+ TQString s = nodeList.item(j).toElement().text();
if(authorDateRX.search(s) > -1) {
// check if anything after date like [publisher]
if(authorDateRX.cap(2).stripWhiteSpace().isEmpty()) {
@@ -91,33 +91,33 @@ Tellico::Data::CollPtr DCImporter::collection() {
creators << s;
}
}
- e->setField(QString::fromLatin1("author"), creators.join(QString::fromLatin1("; ")));
+ e->setField(TQString::tqfromLatin1("author"), creators.join(TQString::tqfromLatin1("; ")));
nodeList = GETELEMENTS("publisher");
- QStringList publishers;
+ TQStringList publishers;
for(uint j = 0; j < nodeList.count(); ++j) {
publishers << nodeList.item(j).toElement().text();
}
- e->setField(QString::fromLatin1("publisher"), publishers.join(QString::fromLatin1("; ")));
+ e->setField(TQString::tqfromLatin1("publisher"), publishers.join(TQString::tqfromLatin1("; ")));
nodeList = GETELEMENTS("subject");
- QStringList keywords;
+ TQStringList keywords;
for(uint j = 0; j < nodeList.count(); ++j) {
keywords << nodeList.item(j).toElement().text();
}
- e->setField(QString::fromLatin1("keyword"), keywords.join(QString::fromLatin1("; ")));
+ e->setField(TQString::tqfromLatin1("keyword"), keywords.join(TQString::tqfromLatin1("; ")));
nodeList = GETELEMENTS("date");
if(nodeList.count() > 0) {
- QString s = nodeList.item(0).toElement().text();
+ TQString s = nodeList.item(0).toElement().text();
if(dateRX.search(s) > -1) {
- e->setField(QString::fromLatin1("pub_year"), dateRX.cap());
+ e->setField(TQString::tqfromLatin1("pub_year"), dateRX.cap());
}
}
nodeList = GETELEMENTS("description");
if(nodeList.count() > 0) { // no title, skip
- e->setField(QString::fromLatin1("comments"), nodeList.item(0).toElement().text());
+ e->setField(TQString::tqfromLatin1("comments"), nodeList.item(0).toElement().text());
}
c->addEntries(e);
diff --git a/src/translators/dcimporter.h b/src/translators/dcimporter.h
index 03eaedf..8a9adce 100644
--- a/src/translators/dcimporter.h
+++ b/src/translators/dcimporter.h
@@ -22,8 +22,8 @@ namespace Tellico {
class DCImporter : public XMLImporter {
public:
DCImporter(const KURL& url);
- DCImporter(const QString& text);
- DCImporter(const QDomDocument& dom);
+ DCImporter(const TQString& text);
+ DCImporter(const TQDomDocument& dom);
~DCImporter() {}
virtual Data::CollPtr collection();
diff --git a/src/translators/deliciousimporter.cpp b/src/translators/deliciousimporter.cpp
index 5c434cd..78c128d 100644
--- a/src/translators/deliciousimporter.cpp
+++ b/src/translators/deliciousimporter.cpp
@@ -19,12 +19,12 @@
#include <kstandarddirs.h>
-#include <qfile.h>
+#include <tqfile.h>
using Tellico::Import::DeliciousImporter;
DeliciousImporter::DeliciousImporter(const KURL& url_) : XSLTImporter(url_) {
- QString xsltFile = locate("appdata", QString::fromLatin1("delicious2tellico.xsl"));
+ TQString xsltFile = locate("appdata", TQString::tqfromLatin1("delicious2tellico.xsl"));
if(!xsltFile.isEmpty()) {
KURL u;
u.setPath(xsltFile);
@@ -46,33 +46,33 @@ Tellico::Data::CollPtr DeliciousImporter::collection() {
KURL libraryDir = url();
libraryDir.setPath(url().directory() + "Images/");
- const QStringList imageDirs = QStringList()
- << QString::fromLatin1("Large Covers/")
- << QString::fromLatin1("Medium Covers/")
- << QString::fromLatin1("Small Covers/")
- << QString::fromLatin1("Plain Covers/");
- const QString commField = QString::fromLatin1("comments");
- const QString uuidField = QString::fromLatin1("uuid");
- const QString coverField = QString::fromLatin1("cover");
+ const TQStringList imageDirs = TQStringList()
+ << TQString::tqfromLatin1("Large Covers/")
+ << TQString::tqfromLatin1("Medium Covers/")
+ << TQString::tqfromLatin1("Small Covers/")
+ << TQString::tqfromLatin1("Plain Covers/");
+ const TQString commField = TQString::tqfromLatin1("comments");
+ const TQString uuidField = TQString::tqfromLatin1("uuid");
+ const TQString coverField = TQString::tqfromLatin1("cover");
const bool isLocal = url().isLocalFile();
Data::EntryVec entries = coll->entries();
for(Data::EntryVecIt entry = entries.begin(); entry != entries.end(); ++entry) {
- QString comments = entry->field(commField);
+ TQString comments = entry->field(commField);
if(!comments.isEmpty()) {
RTF2HTML rtf2html(comments);
entry->setField(commField, rtf2html.toHTML());
}
//try to add images
- QString uuid = entry->field(uuidField);
+ TQString uuid = entry->field(uuidField);
if(!uuid.isEmpty() && isLocal) {
- for(QStringList::ConstIterator it = imageDirs.begin(); it != imageDirs.end(); ++it) {
- QString imgPath = libraryDir.path() + *it + uuid;
- if(!QFile::exists(imgPath)) {
+ for(TQStringList::ConstIterator it = imageDirs.begin(); it != imageDirs.end(); ++it) {
+ TQString imgPath = libraryDir.path() + *it + uuid;
+ if(!TQFile::exists(imgPath)) {
continue;
}
- QString imgID = ImageFactory::addImage(imgPath, true);
+ TQString imgID = ImageFactory::addImage(imgPath, true);
if(!imgID.isEmpty()) {
entry->setField(coverField, imgID);
}
diff --git a/src/translators/deliciousimporter.h b/src/translators/deliciousimporter.h
index 657160e..77011dc 100644
--- a/src/translators/deliciousimporter.h
+++ b/src/translators/deliciousimporter.h
@@ -25,6 +25,7 @@ namespace Tellico {
*/
class DeliciousImporter : public XSLTImporter {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -36,7 +37,7 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget*, const char*) { return 0; }
+ virtual TQWidget* widget(TQWidget*, const char*) { return 0; }
virtual bool canImport(int type) const;
private:
diff --git a/src/translators/exporter.cpp b/src/translators/exporter.cpp
index 2fe78b7..4a5e2c9 100644
--- a/src/translators/exporter.cpp
+++ b/src/translators/exporter.cpp
@@ -17,10 +17,10 @@
using Tellico::Export::Exporter;
-Exporter::Exporter() : QObject(), m_options(Export::ExportUTF8 | Export::ExportComplete), m_coll(0) {
+Exporter::Exporter() : TQObject(), m_options(Export::ExportUTF8 | Export::ExportComplete), m_coll(0) {
}
-Exporter::Exporter(Data::CollPtr coll) : QObject(), m_options(Export::ExportUTF8), m_coll(coll) {
+Exporter::Exporter(Data::CollPtr coll) : TQObject(), m_options(Export::ExportUTF8), m_coll(coll) {
}
Exporter::~Exporter() {
diff --git a/src/translators/exporter.h b/src/translators/exporter.h
index 2ffc13b..3085609 100644
--- a/src/translators/exporter.h
+++ b/src/translators/exporter.h
@@ -16,15 +16,15 @@
class KConfig;
-class QWidget;
-class QString;
+class TQWidget;
+class TQString;
#include "../entry.h"
#include "../datavectors.h"
#include <kurl.h>
-#include <qobject.h>
+#include <tqobject.h>
namespace Tellico {
namespace Export {
@@ -43,8 +43,9 @@ namespace Tellico {
/**
* @author Robby Stephenson
*/
-class Exporter : public QObject {
+class Exporter : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
Exporter();
@@ -57,8 +58,8 @@ public:
void setEntries(const Data::EntryVec& entries) { m_entries = entries; }
void setOptions(long options) { m_options = options; reset(); }
- virtual QString formatString() const = 0;
- virtual QString fileFilter() const = 0;
+ virtual TQString formatString() const = 0;
+ virtual TQString fileFilter() const = 0;
const KURL& url() const { return m_url; }
const Data::EntryVec& entries() const { return m_entries; }
long options() const { return m_options; }
@@ -73,7 +74,7 @@ public:
*/
virtual void reset() {}
- virtual QWidget* widget(QWidget* parent, const char* name=0) = 0;
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0) = 0;
virtual void readOptions(KConfig*) {}
virtual void saveOptions(KConfig*) {}
diff --git a/src/translators/filelistingimporter.cpp b/src/translators/filelistingimporter.cpp
index bef9288..00e0709 100644
--- a/src/translators/filelistingimporter.cpp
+++ b/src/translators/filelistingimporter.cpp
@@ -28,12 +28,12 @@
#include <kio/job.h>
#include <kio/netaccess.h>
-#include <qcheckbox.h>
-#include <qvgroupbox.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
-#include <qfile.h>
-#include <qfileinfo.h>
+#include <tqcheckbox.h>
+#include <tqvgroupbox.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
#include <stdio.h>
@@ -62,17 +62,17 @@ Tellico::Data::CollPtr FileListingImporter::collection() {
ProgressItem& item = ProgressManager::self()->newProgressItem(this, i18n("Scanning files..."), true);
item.setTotalSteps(100);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
// going to assume only one volume will ever be imported
- QString volume = volumeName();
+ TQString volume = volumeName();
m_job = m_recursive->isChecked()
? KIO::listRecursive(url(), true, false)
: KIO::listDir(url(), true, false);
- connect(m_job, SIGNAL(entries(KIO::Job*, const KIO::UDSEntryList&)),
- SLOT(slotEntries(KIO::Job*, const KIO::UDSEntryList&)));
+ connect(m_job, TQT_SIGNAL(entries(KIO::Job*, const KIO::UDSEntryList&)),
+ TQT_SLOT(slotEntries(KIO::Job*, const KIO::UDSEntryList&)));
if(!KIO::NetAccess::synchronousRun(m_job, Kernel::self()->widget()) || m_cancelled) {
return 0;
@@ -80,24 +80,24 @@ Tellico::Data::CollPtr FileListingImporter::collection() {
const bool usePreview = m_filePreview->isChecked();
- const QString title = QString::fromLatin1("title");
- const QString url = QString::fromLatin1("url");
- const QString desc = QString::fromLatin1("description");
- const QString vol = QString::fromLatin1("volume");
- const QString folder = QString::fromLatin1("folder");
- const QString type = QString::fromLatin1("mimetype");
- const QString size = QString::fromLatin1("size");
- const QString perm = QString::fromLatin1("permissions");
- const QString owner = QString::fromLatin1("owner");
- const QString group = QString::fromLatin1("group");
- const QString created = QString::fromLatin1("created");
- const QString modified = QString::fromLatin1("modified");
- const QString metainfo = QString::fromLatin1("metainfo");
- const QString icon = QString::fromLatin1("icon");
+ const TQString title = TQString::tqfromLatin1("title");
+ const TQString url = TQString::tqfromLatin1("url");
+ const TQString desc = TQString::tqfromLatin1("description");
+ const TQString vol = TQString::tqfromLatin1("volume");
+ const TQString folder = TQString::tqfromLatin1("folder");
+ const TQString type = TQString::tqfromLatin1("mimetype");
+ const TQString size = TQString::tqfromLatin1("size");
+ const TQString perm = TQString::tqfromLatin1("permissions");
+ const TQString owner = TQString::tqfromLatin1("owner");
+ const TQString group = TQString::tqfromLatin1("group");
+ const TQString created = TQString::tqfromLatin1("created");
+ const TQString modified = TQString::tqfromLatin1("modified");
+ const TQString metainfo = TQString::tqfromLatin1("metainfo");
+ const TQString icon = TQString::tqfromLatin1("icon");
m_coll = new Data::FileCatalog(true);
- QString tmp;
- const uint stepSize = QMAX(1, m_files.count()/100);
+ TQString tmp;
+ const uint stepSize = TQMAX(1, m_files.count()/100);
const bool showProgress = options() & ImportProgress;
item.setTotalSteps(m_files.count());
@@ -121,30 +121,30 @@ Tellico::Data::CollPtr FileListingImporter::collection() {
time_t t = it.current()->time(KIO::UDS_CREATION_TIME);
if(t > 0) {
- QDateTime dt;
+ TQDateTime dt;
dt.setTime_t(t);
entry->setField(created, dt.toString(Qt::ISODate));
}
t = it.current()->time(KIO::UDS_MODIFICATION_TIME);
if(t > 0) {
- QDateTime dt;
+ TQDateTime dt;
dt.setTime_t(t);
entry->setField(modified, dt.toString(Qt::ISODate));
}
const KFileMetaInfo& meta = it.current()->metaInfo();
if(meta.isValid() && !meta.isEmpty()) {
- const QStringList keys = meta.supportedKeys();
- QStringList strings;
- for(QStringList::ConstIterator it2 = keys.begin(); it2 != keys.end(); ++it2) {
+ const TQStringList keys = meta.supportedKeys();
+ TQStringList strings;
+ for(TQStringList::ConstIterator it2 = keys.begin(); it2 != keys.end(); ++it2) {
KFileMetaInfoItem item = meta.item(*it2);
if(item.isValid()) {
- QString s = item.string();
+ TQString s = item.string();
if(!s.isEmpty()) {
strings << item.key() + "::" + s;
}
}
}
- entry->setField(metainfo, strings.join(QString::fromLatin1("; ")));
+ entry->setField(metainfo, strings.join(TQString::tqfromLatin1("; ")));
}
if(!m_cancelled && usePreview) {
@@ -158,7 +158,7 @@ Tellico::Data::CollPtr FileListingImporter::collection() {
if(!m_pixmap.isNull()) {
// is png best option?
- QString id = ImageFactory::addImage(m_pixmap, QString::fromLatin1("PNG"));
+ TQString id = ImageFactory::addImage(m_pixmap, TQString::tqfromLatin1("PNG"));
if(!id.isEmpty()) {
entry->setField(icon, id);
}
@@ -180,23 +180,23 @@ Tellico::Data::CollPtr FileListingImporter::collection() {
return m_coll;
}
-QWidget* FileListingImporter::widget(QWidget* parent_, const char* name_) {
+TQWidget* FileListingImporter::widget(TQWidget* tqparent_, const char* name_) {
if(m_widget) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QVGroupBox* box = new QVGroupBox(i18n("File Listing Options"), m_widget);
+ TQVGroupBox* box = new TQVGroupBox(i18n("File Listing Options"), m_widget);
- m_recursive = new QCheckBox(i18n("Recursive folder search"), box);
- QWhatsThis::add(m_recursive, i18n("If checked, folders are recursively searched for all files."));
+ m_recursive = new TQCheckBox(i18n("Recursive folder search"), box);
+ TQWhatsThis::add(m_recursive, i18n("If checked, folders are recursively searched for all files."));
// by default, make it checked
m_recursive->setChecked(true);
- m_filePreview = new QCheckBox(i18n("Generate file previews"), box);
- QWhatsThis::add(m_filePreview, i18n("If checked, previews of the file contents are generated, which can slow down "
+ m_filePreview = new TQCheckBox(i18n("Generate file previews"), box);
+ TQWhatsThis::add(m_filePreview, i18n("If checked, previews of the file contents are generated, which can slow down "
"the folder listing."));
// by default, make it no previews
m_filePreview->setChecked(false);
@@ -223,9 +223,9 @@ void FileListingImporter::slotEntries(KIO::Job* job_, const KIO::UDSEntryList& l
}
}
-QString FileListingImporter::volumeName() const {
+TQString FileListingImporter::volumeName() const {
// this functions turns /media/cdrom into /dev/hdc, then reads 32 bytes after the 16 x 2048 header
- QString volume;
+ TQString volume;
const KMountPoint::List mountPoints = KMountPoint::currentMountPoints(KMountPoint::NeedRealDeviceName);
for(KMountPoint::List::ConstIterator it = mountPoints.begin(), end = mountPoints.end(); it != end; ++it) {
// path() could be /media/cdrom
@@ -236,11 +236,11 @@ QString FileListingImporter::volumeName() const {
|| (*it)->mountType() == Latin1Literal("udf"))) {
volume = (*it)->mountPoint();
if(!(*it)->realDeviceName().isEmpty()) {
- QString devName = (*it)->realDeviceName();
- if(devName.endsWith(QChar('/'))) {
+ TQString devName = (*it)->realDeviceName();
+ if(devName.endsWith(TQChar('/'))) {
devName.truncate(devName.length()-1);
}
- // QFile can't do a sequential seek, and I don't want to do a 32808x loop on getch()
+ // TQFile can't do a sequential seek, and I don't want to do a 32808x loop on getch()
FILE* dev = 0;
if((dev = fopen(devName.latin1(), "rb")) != 0) {
// returns 0 on success
@@ -248,7 +248,7 @@ QString FileListingImporter::volumeName() const {
char buf[VOLUME_NAME_SIZE];
int ret = fread(buf, 1, VOLUME_NAME_SIZE, dev);
if(ret == VOLUME_NAME_SIZE) {
- volume = QString::fromLatin1(buf, VOLUME_NAME_SIZE).stripWhiteSpace();
+ volume = TQString::tqfromLatin1(buf, VOLUME_NAME_SIZE).stripWhiteSpace();
}
} else {
myDebug() << "FileListingImporter::volumeName() - can't seek " << devName << endl;
diff --git a/src/translators/filelistingimporter.h b/src/translators/filelistingimporter.h
index aca4602..452f3f6 100644
--- a/src/translators/filelistingimporter.h
+++ b/src/translators/filelistingimporter.h
@@ -20,9 +20,9 @@
#include <kio/global.h>
#include <kfileitem.h>
-#include <qguardedptr.h>
+#include <tqguardedptr.h>
-class QCheckBox;
+class TQCheckBox;
namespace KIO {
class Job;
}
@@ -35,6 +35,7 @@ namespace Tellico {
*/
class FileListingImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
FileListingImporter(const KURL& url);
@@ -45,7 +46,7 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget*, const char*);
+ virtual TQWidget* widget(TQWidget*, const char*);
virtual bool canImport(int type) const;
public slots:
@@ -55,15 +56,15 @@ private slots:
void slotEntries(KIO::Job* job, const KIO::UDSEntryList& list);
private:
- QString volumeName() const;
+ TQString volumeName() const;
Data::CollPtr m_coll;
- QWidget* m_widget;
- QCheckBox* m_recursive;
- QCheckBox* m_filePreview;
- QGuardedPtr<KIO::Job> m_job;
+ TQWidget* m_widget;
+ TQCheckBox* m_recursive;
+ TQCheckBox* m_filePreview;
+ TQGuardedPtr<KIO::Job> m_job;
KFileItemList m_files;
- QPixmap m_pixmap;
+ TQPixmap m_pixmap;
bool m_cancelled : 1;
};
diff --git a/src/translators/freedb_util.cpp b/src/translators/freedb_util.cpp
index 6640ef6..07292af 100644
--- a/src/translators/freedb_util.cpp
+++ b/src/translators/freedb_util.cpp
@@ -129,8 +129,8 @@ namespace {
};
}
-QValueList<uint> FreeDBImporter::offsetList(const QCString& drive_, QValueList<uint>& trackLengths_) {
- QValueList<uint> list;
+TQValueList<uint> FreeDBImporter::offsetList(const TQCString& drive_, TQValueList<uint>& trackLengths_) {
+ TQValueList<uint> list;
int drive = ::open(drive_.data(), O_RDONLY | O_NONBLOCK);
CloseDrive closer(drive);
@@ -235,7 +235,7 @@ ushort from2Byte(uchar* d) {
#define SIZE 61
// mostly taken from kover and k3b
// licensed under GPL
-FreeDBImporter::CDText FreeDBImporter::getCDText(const QCString& drive_) {
+FreeDBImporter::CDText FreeDBImporter::getCDText(const TQCString& drive_) {
CDText cdtext;
#ifdef USE_CDTEXT
// only works for linux ATM
@@ -337,23 +337,23 @@ FreeDBImporter::CDText FreeDBImporter::getCDText(const QCString& drive_) {
data[pos_data] = c;
if(track == 0) {
if(code == (char)0xFFFFFF80) {
- cdtext.title = QString::fromUtf8(data);
+ cdtext.title = TQString::fromUtf8(data);
} else if(code == (char)0xFFFFFF81) {
- cdtext.artist = QString::fromUtf8(data);
+ cdtext.artist = TQString::fromUtf8(data);
} else if (code == (char)0xFFFFFF85) {
- cdtext.message = QString::fromUtf8(data);
+ cdtext.message = TQString::fromUtf8(data);
}
} else {
if(code == (char)0xFFFFFF80) {
if(cdtext.trackTitles.size() < track) {
cdtext.trackTitles.resize(track);
}
- cdtext.trackTitles[track-1] = QString::fromUtf8(data);
+ cdtext.trackTitles[track-1] = TQString::fromUtf8(data);
} else if(code == (char)0xFFFFFF81) {
if(cdtext.trackArtists.size() < track) {
cdtext.trackArtists.resize(track);
}
- cdtext.trackArtists[track-1] = QString::fromUtf8(data);
+ cdtext.trackArtists[track-1] = TQString::fromUtf8(data);
}
}
rc = true;
@@ -365,7 +365,7 @@ FreeDBImporter::CDText FreeDBImporter::getCDText(const QCString& drive_) {
}
}
if(cdtext.trackTitles.size() != cdtext.trackArtists.size()) {
- int size = QMAX(cdtext.trackTitles.size(), cdtext.trackArtists.size());
+ int size = TQMAX(cdtext.trackTitles.size(), cdtext.trackArtists.size());
cdtext.trackTitles.resize(size);
cdtext.trackArtists.resize(size);
}
diff --git a/src/translators/freedbimporter.cpp b/src/translators/freedbimporter.cpp
index 14d92d8..1364b4e 100644
--- a/src/translators/freedbimporter.cpp
+++ b/src/translators/freedbimporter.cpp
@@ -24,14 +24,14 @@
#include <config.h>
#ifdef HAVE_KCDDB
-#ifdef QT_NO_CAST_ASCII
-#define HAD_QT_NO_CAST_ASCII
-#undef QT_NO_CAST_ASCII
+#ifdef TQT_NO_CAST_ASCII
+#define HAD_TQT_NO_CAST_ASCII
+#undef TQT_NO_CAST_ASCII
#endif
#include <libkcddb/client.h>
-#ifdef HAD_QT_NO_CAST_ASCII
-#define QT_NO_CAST_ASCII
-#undef HAD_QT_NO_CAST_ASCII
+#ifdef HAD_TQT_NO_CAST_ASCII
+#define TQT_NO_CAST_ASCII
+#undef HAD_TQT_NO_CAST_ASCII
#endif
#endif
@@ -40,16 +40,16 @@
#include <kapplication.h>
#include <kinputdialog.h>
-#include <qfile.h>
-#include <qdir.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qwhatsthis.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qhbox.h>
-#include <qcheckbox.h>
+#include <tqfile.h>
+#include <tqdir.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqwhatsthis.h>
+#include <tqradiobutton.h>
+#include <tqbuttongroup.h>
+#include <tqhbox.h>
+#include <tqcheckbox.h>
using Tellico::Import::FreeDBImporter;
@@ -79,16 +79,16 @@ Tellico::Data::CollPtr FreeDBImporter::collection() {
void FreeDBImporter::readCDROM() {
#ifdef HAVE_KCDDB
- QString drivePath = m_driveCombo->currentText();
+ TQString drivePath = m_driveCombo->currentText();
if(drivePath.isEmpty()) {
- setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").arg(drivePath));
+ setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").tqarg(drivePath));
myDebug() << "FreeDBImporter::readCDROM() - no drive!" << endl;
return;
}
// now it's ok to add device to saved list
m_driveCombo->insertItem(drivePath);
- QStringList drives;
+ TQStringList drives;
for(int i = 0; i < m_driveCombo->count(); ++i) {
if(drives.findIndex(m_driveCombo->text(i)) == -1) {
drives += m_driveCombo->text(i);
@@ -96,14 +96,14 @@ void FreeDBImporter::readCDROM() {
}
{
- KConfigGroup config(KGlobal::config(), QString::fromLatin1("ImportOptions - FreeDB"));
+ KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - FreeDB"));
config.writeEntry("CD-ROM Devices", drives);
config.writeEntry("Last Device", drivePath);
config.writeEntry("Cache Files Only", false);
}
- QCString drive = QFile::encodeName(drivePath);
- QValueList<uint> lengths;
+ TQCString drive = TQFile::encodeName(drivePath);
+ TQValueList<uint> lengths;
KCDDB::TrackOffsetList list;
#if 0
// a1107d0a - Kruder & Dorfmeister - The K&D Sessions - Disc One.
@@ -167,7 +167,7 @@ void FreeDBImporter::readCDROM() {
#endif
if(list.isEmpty()) {
- setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").arg(drivePath));
+ setStatusMessage(i18n("<qt>Tellico was unable to access the CD-ROM device - <i>%1</i>.</qt>").tqarg(drivePath));
return;
}
// myDebug() << KCDDB::CDDB::trackOffsetListToId(list) << endl;
@@ -182,24 +182,24 @@ void FreeDBImporter::readCDROM() {
KCDDB::CDDB::Result r = client.lookup(list);
// KCDDB doesn't return MultipleRecordFound properly, so check outselves
if(r == KCDDB::CDDB::MultipleRecordFound || client.lookupResponse().count() > 1) {
- QStringList list;
+ TQStringList list;
KCDDB::CDInfoList infoList = client.lookupResponse();
for(KCDDB::CDInfoList::iterator it = infoList.begin(); it != infoList.end(); ++it) {
- list.append(QString::fromLatin1("%1, %2, %3").arg((*it).artist)
- .arg((*it).title)
- .arg((*it).genre));
+ list.append(TQString::tqfromLatin1("%1, %2, %3").tqarg((*it).artist)
+ .tqarg((*it).title)
+ .tqarg((*it).genre));
}
// switch back to pointer cursor
- GUI::CursorSaver cs(Qt::arrowCursor);
+ GUI::CursorSaver cs(TQt::arrowCursor);
bool ok;
- QString res = KInputDialog::getItem(i18n("Select CDDB Entry"),
+ TQString res = KInputDialog::getItem(i18n("Select CDDB Entry"),
i18n("Select a CDDB entry:"),
list, 0, false, &ok,
Kernel::self()->widget());
if(ok) {
uint i = 0;
- for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it, ++i) {
+ for(TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it, ++i) {
if(*it == res) {
break;
}
@@ -214,7 +214,7 @@ void FreeDBImporter::readCDROM() {
info = client.bestLookupResponse();
} else {
// myDebug() << "FreeDBImporter::readCDROM() - no success! Return value = " << r << endl;
- QString s;
+ TQString s;
switch(r) {
case KCDDB::CDDB::NoRecordFound:
s = i18n("<qt>No records were found to match the CD.</qt>");
@@ -254,25 +254,25 @@ void FreeDBImporter::readCDROM() {
Data::EntryPtr entry = new Data::Entry(m_coll);
// obviously a CD
- entry->setField(QString::fromLatin1("medium"), i18n("Compact Disc"));
- entry->setField(QString::fromLatin1("title"), info.title);
- entry->setField(QString::fromLatin1("artist"), info.artist);
- entry->setField(QString::fromLatin1("genre"), info.genre);
+ entry->setField(TQString::tqfromLatin1("medium"), i18n("Compact Disc"));
+ entry->setField(TQString::tqfromLatin1("title"), info.title);
+ entry->setField(TQString::tqfromLatin1("artist"), info.artist);
+ entry->setField(TQString::tqfromLatin1("genre"), info.genre);
if(info.year > 0) {
- entry->setField(QString::fromLatin1("year"), QString::number(info.year));
+ entry->setField(TQString::tqfromLatin1("year"), TQString::number(info.year));
}
- entry->setField(QString::fromLatin1("keyword"), info.category);
- QString extd = info.extd;
- extd.replace('\n', QString::fromLatin1("<br/>"));
- entry->setField(QString::fromLatin1("comments"), extd);
+ entry->setField(TQString::tqfromLatin1("keyword"), info.category);
+ TQString extd = info.extd;
+ extd.tqreplace('\n', TQString::tqfromLatin1("<br/>"));
+ entry->setField(TQString::tqfromLatin1("comments"), extd);
- QStringList trackList;
+ TQStringList trackList;
KCDDB::TrackInfoList t = info.trackInfoList;
for(uint i = 0; i < t.count(); ++i) {
#if KDE_IS_VERSION(3,4,90)
- QString s = t[i].get(QString::fromLatin1("title")).toString() + "::" + info.artist;
+ TQString s = t[i].get(TQString::tqfromLatin1("title")).toString() + "::" + info.artist;
#else
- QString s = t[i].title + "::" + info.artist;
+ TQString s = t[i].title + "::" + info.artist;
#endif
if(i < lengths.count()) {
s += "::" + Tellico::minutes(lengths[i]);
@@ -280,7 +280,7 @@ void FreeDBImporter::readCDROM() {
trackList << s;
// TODO: KDE4 will probably have track length too
}
- entry->setField(QString::fromLatin1("track"), trackList.join(QString::fromLatin1("; ")));
+ entry->setField(TQString::tqfromLatin1("track"), trackList.join(TQString::tqfromLatin1("; ")));
m_coll->addEntries(entry);
readCDText(drive);
@@ -291,41 +291,41 @@ void FreeDBImporter::readCache() {
#ifdef HAVE_KCDDB
{
// remember the import options
- KConfigGroup config(KGlobal::config(), QString::fromLatin1("ImportOptions - FreeDB"));
+ KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - FreeDB"));
config.writeEntry("Cache Files Only", true);
}
KCDDB::Config cfg;
cfg.readConfig();
- QStringList dirs = cfg.cacheLocations();
- for(QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) {
+ TQStringList dirs = cfg.cacheLocations();
+ for(TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) {
dirs += Tellico::findAllSubDirs(*it);
}
- // using a QMap is a lazy man's way of getting unique keys
+ // using a TQMap is a lazy man's way of getting unique keys
// the cddb info may be in multiple files, all with the same filename, the cddb id
- QMap<QString, QString> files;
- for(QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) {
+ TQMap<TQString, TQString> files;
+ for(TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) {
if((*it).isEmpty()) {
continue;
}
- QDir dir(*it);
- dir.setFilter(QDir::Files | QDir::Readable | QDir::Hidden); // hidden since I want directory files
- const QStringList list = dir.entryList();
- for(QStringList::ConstIterator it2 = list.begin(); it2 != list.end(); ++it2) {
+ TQDir dir(*it);
+ dir.setFilter(TQDir::Files | TQDir::Readable | TQDir::Hidden); // hidden since I want directory files
+ const TQStringList list = dir.entryList();
+ for(TQStringList::ConstIterator it2 = list.begin(); it2 != list.end(); ++it2) {
files.insert(*it2, dir.absFilePath(*it2), false);
}
// kapp->processEvents(); // really needed ?
}
- const QString title = QString::fromLatin1("title");
- const QString artist = QString::fromLatin1("artist");
- const QString year = QString::fromLatin1("year");
- const QString genre = QString::fromLatin1("genre");
- const QString track = QString::fromLatin1("track");
- const QString comments = QString::fromLatin1("comments");
+ const TQString title = TQString::tqfromLatin1("title");
+ const TQString artist = TQString::tqfromLatin1("artist");
+ const TQString year = TQString::tqfromLatin1("year");
+ const TQString genre = TQString::tqfromLatin1("genre");
+ const TQString track = TQString::tqfromLatin1("track");
+ const TQString comments = TQString::tqfromLatin1("comments");
uint numFiles = files.count();
if(numFiles == 0) {
@@ -335,32 +335,32 @@ void FreeDBImporter::readCache() {
m_coll = new Data::MusicCollection(true);
- const uint stepSize = QMAX(1, numFiles / 100);
+ const uint stepSize = TQMAX(1, numFiles / 100);
const bool showProgress = options() & ImportProgress;
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(numFiles);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
uint step = 1;
KCDDB::CDInfo info;
- for(QMap<QString, QString>::Iterator it = files.begin(); !m_cancelled && it != files.end(); ++it, ++step) {
+ for(TQMap<TQString, TQString>::Iterator it = files.begin(); !m_cancelled && it != files.end(); ++it, ++step) {
// open file and read content
- QFileInfo fileinfo(it.data()); // skip files larger than 10 kB
+ TQFileInfo fileinfo(it.data()); // skip files larger than 10 kB
if(!fileinfo.exists() || !fileinfo.isReadable() || fileinfo.size() > 10*1024) {
myDebug() << "FreeDBImporter::readCache() - skipping " << it.data() << endl;
continue;
}
- QFile file(it.data());
+ TQFile file(it.data());
if(!file.open(IO_ReadOnly)) {
continue;
}
- QTextStream ts(&file);
+ TQTextStream ts(&file);
// libkcddb always writes the cache files in utf-8
- ts.setEncoding(QTextStream::UnicodeUTF8);
- QString cddbData = ts.read();
+ ts.setEncoding(TQTextStream::UnicodeUTF8);
+ TQString cddbData = ts.read();
file.close();
if(cddbData.isEmpty() || !info.load(cddbData) || !info.isValid()) {
@@ -372,45 +372,45 @@ void FreeDBImporter::readCache() {
// create a new entry and set fields
Data::EntryPtr entry = new Data::Entry(m_coll);
// obviously a CD
- entry->setField(QString::fromLatin1("medium"), i18n("Compact Disc"));
+ entry->setField(TQString::tqfromLatin1("medium"), i18n("Compact Disc"));
entry->setField(title, info.title);
entry->setField(artist, info.artist);
entry->setField(genre, info.genre);
if(info.year > 0) {
- entry->setField(QString::fromLatin1("year"), QString::number(info.year));
+ entry->setField(TQString::tqfromLatin1("year"), TQString::number(info.year));
}
- entry->setField(QString::fromLatin1("keyword"), info.category);
- QString extd = info.extd;
- extd.replace('\n', QString::fromLatin1("<br/>"));
- entry->setField(QString::fromLatin1("comments"), extd);
+ entry->setField(TQString::tqfromLatin1("keyword"), info.category);
+ TQString extd = info.extd;
+ extd.tqreplace('\n', TQString::tqfromLatin1("<br/>"));
+ entry->setField(TQString::tqfromLatin1("comments"), extd);
// step through trackList
- QStringList trackList;
+ TQStringList trackList;
KCDDB::TrackInfoList t = info.trackInfoList;
for(uint i = 0; i < t.count(); ++i) {
#if KDE_IS_VERSION(3,4,90)
- trackList << t[i].get(QString::fromLatin1("title")).toString();
+ trackList << t[i].get(TQString::tqfromLatin1("title")).toString();
#else
trackList << t[i].title;
#endif
}
- entry->setField(track, trackList.join(QString::fromLatin1("; ")));
+ entry->setField(track, trackList.join(TQString::tqfromLatin1("; ")));
#if 0
// add CDDB info
- const QString br = QString::fromLatin1("<br/>");
- QString comment;
+ const TQString br = TQString::tqfromLatin1("<br/>");
+ TQString comment;
if(!info.extd.isEmpty()) {
comment.append(info.extd + br);
}
if(!info.id.isEmpty()) {
- comment.append(QString::fromLatin1("CDDB-ID: ") + info.id + br);
+ comment.append(TQString::tqfromLatin1("CDDB-ID: ") + info.id + br);
}
if(info.length > 0) {
- comment.append("Length: " + QString::number(info.length) + br);
+ comment.append("Length: " + TQString::number(info.length) + br);
}
if(info.revision > 0) {
- comment.append("Revision: " + QString::number(info.revision) + br);
+ comment.append("Revision: " + TQString::number(info.revision) + br);
}
entry->setField(comments, comment);
#endif
@@ -427,11 +427,11 @@ void FreeDBImporter::readCache() {
}
#define SETFIELD(name,value) \
- if(entry->field(QString::fromLatin1(name)).isEmpty()) { \
- entry->setField(QString::fromLatin1(name), value); \
+ if(entry->field(TQString::tqfromLatin1(name)).isEmpty()) { \
+ entry->setField(TQString::tqfromLatin1(name), value); \
}
-void FreeDBImporter::readCDText(const QCString& drive_) {
+void FreeDBImporter::readCDText(const TQCString& drive_) {
#ifdef USE_CDTEXT
Data::EntryPtr entry;
if(m_coll) {
@@ -443,7 +443,7 @@ void FreeDBImporter::readCDText(const QCString& drive_) {
}
if(!entry) {
entry = new Data::Entry(m_coll);
- entry->setField(QString::fromLatin1("medium"), i18n("Compact Disc"));
+ entry->setField(TQString::tqfromLatin1("medium"), i18n("Compact Disc"));
m_coll->addEntries(entry);
}
@@ -456,11 +456,11 @@ void FreeDBImporter::readCDText(const QCString& drive_) {
}
*/
- QString artist = cdtext.artist;
+ TQString artist = cdtext.artist;
SETFIELD("title", cdtext.title);
SETFIELD("artist", artist);
SETFIELD("comments", cdtext.message);
- QStringList tracks;
+ TQStringList tracks;
for(uint i = 0; i < cdtext.trackTitles.size(); ++i) {
tracks << cdtext.trackTitles[i] + "::" + cdtext.trackArtists[i];
if(artist.isEmpty()) {
@@ -470,7 +470,7 @@ void FreeDBImporter::readCDText(const QCString& drive_) {
artist = i18n("Various");
}
}
- SETFIELD("track", tracks.join(QString::fromLatin1("; ")));
+ SETFIELD("track", tracks.join(TQString::tqfromLatin1("; ")));
// something special for compilations and such
SETFIELD("title", i18n(Data::Collection::s_emptyGroupTitle));
@@ -479,53 +479,53 @@ void FreeDBImporter::readCDText(const QCString& drive_) {
}
#undef SETFIELD
-QWidget* FreeDBImporter::widget(QWidget* parent_, const char* name_/*=0*/) {
+TQWidget* FreeDBImporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) {
if(m_widget) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* bigbox = new QGroupBox(1, Qt::Horizontal, i18n("Audio CD Options"), m_widget);
+ TQGroupBox* bigbox = new TQGroupBox(1, Qt::Horizontal, i18n("Audio CD Options"), m_widget);
// cdrom stuff
- QHBox* box = new QHBox(bigbox);
- m_radioCDROM = new QRadioButton(i18n("Read data from CD-ROM device"), box);
+ TQHBox* box = new TQHBox(bigbox);
+ m_radioCDROM = new TQRadioButton(i18n("Read data from CD-ROM device"), box);
m_driveCombo = new KComboBox(true, box);
m_driveCombo->setDuplicatesEnabled(false);
- QString w = i18n("Select or input the CD-ROM device location.");
- QWhatsThis::add(m_radioCDROM, w);
- QWhatsThis::add(m_driveCombo, w);
+ TQString w = i18n("Select or input the CD-ROM device location.");
+ TQWhatsThis::add(m_radioCDROM, w);
+ TQWhatsThis::add(m_driveCombo, w);
/********************************************************************************/
- m_radioCache = new QRadioButton(i18n("Read all CDDB cache files only"), bigbox);
- QWhatsThis::add(m_radioCache, i18n("Read data recursively from all the CDDB cache files "
+ m_radioCache = new TQRadioButton(i18n("Read all CDDB cache files only"), bigbox);
+ TQWhatsThis::add(m_radioCache, i18n("Read data recursively from all the CDDB cache files "
"contained in the default cache folders."));
// cddb cache stuff
- m_buttonGroup = new QButtonGroup(m_widget);
- m_buttonGroup->hide(); // only use as button parent
+ m_buttonGroup = new TQButtonGroup(m_widget);
+ m_buttonGroup->hide(); // only use as button tqparent
m_buttonGroup->setExclusive(true);
m_buttonGroup->insert(m_radioCDROM);
m_buttonGroup->insert(m_radioCache);
- connect(m_buttonGroup, SIGNAL(clicked(int)), SLOT(slotClicked(int)));
+ connect(m_buttonGroup, TQT_SIGNAL(clicked(int)), TQT_SLOT(slotClicked(int)));
l->addWidget(bigbox);
l->addStretch(1);
// now read config options
- KConfigGroup config(KGlobal::config(), QString::fromLatin1("ImportOptions - FreeDB"));
- QStringList devices = config.readListEntry("CD-ROM Devices");
+ KConfigGroup config(KGlobal::config(), TQString::tqfromLatin1("ImportOptions - FreeDB"));
+ TQStringList devices = config.readListEntry("CD-ROM Devices");
if(devices.isEmpty()) {
#if defined(__OpenBSD__)
- devices += QString::fromLatin1("/dev/rcd0c");
+ devices += TQString::tqfromLatin1("/dev/rcd0c");
#endif
- devices += QString::fromLatin1("/dev/cdrom");
- devices += QString::fromLatin1("/dev/dvd");
+ devices += TQString::tqfromLatin1("/dev/cdrom");
+ devices += TQString::tqfromLatin1("/dev/dvd");
}
m_driveCombo->insertStringList(devices);
- QString device = config.readEntry("Last Device");
+ TQString device = config.readEntry("Last Device");
if(!device.isEmpty()) {
m_driveCombo->setCurrentText(device);
}
@@ -541,7 +541,7 @@ QWidget* FreeDBImporter::widget(QWidget* parent_, const char* name_/*=0*/) {
}
void FreeDBImporter::slotClicked(int id_) {
- QButton* button = m_buttonGroup->find(id_);
+ TQButton* button = m_buttonGroup->tqfind(id_);
if(!button) {
return;
}
diff --git a/src/translators/freedbimporter.h b/src/translators/freedbimporter.h
index 263f89d..22003ee 100644
--- a/src/translators/freedbimporter.h
+++ b/src/translators/freedbimporter.h
@@ -17,10 +17,10 @@
#include "importer.h"
#include "../datavectors.h"
-#include <qvaluevector.h>
+#include <tqvaluevector.h>
-class QButtonGroup;
-class QRadioButton;
+class TQButtonGroup;
+class TQRadioButton;
class KComboBox;
namespace Tellico {
@@ -33,6 +33,7 @@ namespace Tellico {
*/
class FreeDBImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -44,7 +45,7 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
virtual bool canImport(int type) const;
public slots:
@@ -54,28 +55,28 @@ private slots:
void slotClicked(int id);
private:
- typedef QValueVector<QString> StringVector;
+ typedef TQValueVector<TQString> StringVector;
struct CDText {
friend class FreeDBImporter;
- QString title;
- QString artist;
- QString message;
+ TQString title;
+ TQString artist;
+ TQString message;
StringVector trackTitles;
StringVector trackArtists;
};
- static QValueList<uint> offsetList(const QCString& drive, QValueList<uint>& trackLengths);
- static CDText getCDText(const QCString& drive);
+ static TQValueList<uint> offsetList(const TQCString& drive, TQValueList<uint>& trackLengths);
+ static CDText getCDText(const TQCString& drive);
void readCDROM();
void readCache();
- void readCDText(const QCString& drive);
+ void readCDText(const TQCString& drive);
Data::CollPtr m_coll;
- QWidget* m_widget;
- QButtonGroup* m_buttonGroup;
- QRadioButton* m_radioCDROM;
- QRadioButton* m_radioCache;
+ TQWidget* m_widget;
+ TQButtonGroup* m_buttonGroup;
+ TQRadioButton* m_radioCDROM;
+ TQRadioButton* m_radioCache;
KComboBox* m_driveCombo;
bool m_cancelled : 1;
};
diff --git a/src/translators/gcfilmsexporter.cpp b/src/translators/gcfilmsexporter.cpp
index b172996..5bf3285 100644
--- a/src/translators/gcfilmsexporter.cpp
+++ b/src/translators/gcfilmsexporter.cpp
@@ -33,12 +33,12 @@ using Tellico::Export::GCfilmsExporter;
GCfilmsExporter::GCfilmsExporter() : Tellico::Export::Exporter() {
}
-QString GCfilmsExporter::formatString() const {
+TQString GCfilmsExporter::formatString() const {
return i18n("GCfilms");
}
-QString GCfilmsExporter::fileFilter() const {
- return i18n("*.gcf|GCfilms Data Files (*.gcf)") + QChar('\n') + i18n("*|All Files");
+TQString GCfilmsExporter::fileFilter() const {
+ return i18n("*.gcf|GCfilms Data Files (*.gcf)") + TQChar('\n') + i18n("*|All Files");
#if 0
i18n("*.gcs|GCstar Data Files (*.gcs)")
#endif
@@ -50,8 +50,8 @@ bool GCfilmsExporter::exec() {
return false;
}
- QString text;
- QTextOStream ts(&text);
+ TQString text;
+ TQTextOStream ts(&text);
ts << "GCfilms|" << coll->entryCount() << "|";
if(options() & Export::ExportUTF8) {
@@ -61,19 +61,19 @@ bool GCfilmsExporter::exec() {
char d = GCFILMS_DELIMITER;
bool format = options() & Export::ExportFormatted;
// when importing GCfilms, a url field is added
- bool hasURL = coll->hasField(QString::fromLatin1("url"))
- && coll->fieldByName(QString::fromLatin1("url"))->type() == Data::Field::URL;
+ bool hasURL = coll->hasField(TQString::tqfromLatin1("url"))
+ && coll->fieldByName(TQString::tqfromLatin1("url"))->type() == Data::Field::URL;
uint minRating = 1;
uint maxRating = 5;
- Data::FieldPtr f = coll->fieldByName(QString::fromLatin1("rating"));
+ Data::FieldPtr f = coll->fieldByName(TQString::tqfromLatin1("rating"));
if(f) {
bool ok;
- uint n = Tellico::toUInt(f->property(QString::fromLatin1("minimum")), &ok);
+ uint n = Tellico::toUInt(f->property(TQString::tqfromLatin1("minimum")), &ok);
if(ok) {
minRating = n;
}
- n = Tellico::toUInt(f->property(QString::fromLatin1("maximum")), &ok);
+ n = Tellico::toUInt(f->property(TQString::tqfromLatin1("maximum")), &ok);
if(ok) {
maxRating = n;
}
@@ -83,8 +83,8 @@ bool GCfilmsExporter::exec() {
KURL imageDir;
if(url().isLocalFile()) {
imageDir = url();
- imageDir.cd(QString::fromLatin1(".."));
- imageDir.addPath(url().fileName().section('.', 0, 0) + QString::fromLatin1("_images/"));
+ imageDir.cd(TQString::tqfromLatin1(".."));
+ imageDir.addPath(url().fileName().section('.', 0, 0) + TQString::tqfromLatin1("_images/"));
if(!KIO::NetAccess::exists(imageDir, false, 0)) {
bool success = KIO::NetAccess::mkdir(imageDir, Kernel::self()->widget());
if(!success) {
@@ -93,7 +93,7 @@ bool GCfilmsExporter::exec() {
}
}
- QStringList images;
+ TQStringList images;
for(Data::EntryVec::ConstIterator entry = entries().begin(); entry != entries().end(); ++entry) {
ts << entry->id() << d;
push(ts, "title", entry, format);
@@ -103,7 +103,7 @@ bool GCfilmsExporter::exec() {
push(ts, "nationality", entry, format);
push(ts, "genre", entry, format);
// do image
- QString tmp = entry->field(QString::fromLatin1("cover"));
+ TQString tmp = entry->field(TQString::tqfromLatin1("cover"));
if(!tmp.isEmpty() && !imageDir.isEmpty()) {
images << tmp;
ts << imageDir.path() << tmp;
@@ -111,9 +111,9 @@ bool GCfilmsExporter::exec() {
ts << d;
// do not format cast since the commas could get mixed up
- const QStringList cast = entry->fields(QString::fromLatin1("cast"), false);
- for(QStringList::ConstIterator it = cast.begin(); it != cast.end(); ++it) {
- ts << (*it).section(QString::fromLatin1("::"), 0, 0);
+ const TQStringList cast = entry->fields(TQString::tqfromLatin1("cast"), false);
+ for(TQStringList::ConstIterator it = cast.begin(); it != cast.end(); ++it) {
+ ts << (*it).section(TQString::tqfromLatin1("::"), 0, 0);
if(it != cast.fromLast()) {
ts << ", ";
}
@@ -142,7 +142,7 @@ bool GCfilmsExporter::exec() {
// gcfilms's ratings go 0-10, just multiply by two
bool ok;
- int rat = Tellico::toUInt(entry->field(QString::fromLatin1("rating"), format), &ok);
+ int rat = Tellico::toUInt(entry->field(TQString::tqfromLatin1("rating"), format), &ok);
if(ok) {
ts << rat * 10/(maxRating-minRating);
}
@@ -154,7 +154,7 @@ bool GCfilmsExporter::exec() {
push(ts, "subtitle", entry, format);
// values[20] is borrower name, values[21] is loan date
- if(entry->field(QString::fromLatin1("loaned")).isEmpty()) {
+ if(entry->field(TQString::tqfromLatin1("loaned")).isEmpty()) {
ts << d << d;
} else {
// find loan
@@ -179,7 +179,7 @@ bool GCfilmsExporter::exec() {
ts << d;
// for certification, only thing we can do is assume default american ratings
- tmp = entry->field(QString::fromLatin1("certification"), format);
+ tmp = entry->field(TQString::tqfromLatin1("certification"), format);
int age = 0;
if(tmp == Latin1Literal("U (USA)")) {
age = 1;
@@ -202,7 +202,7 @@ bool GCfilmsExporter::exec() {
}
StringSet imageSet;
- for(QStringList::ConstIterator it = images.begin(); it != images.end(); ++it) {
+ for(TQStringList::ConstIterator it = images.begin(); it != images.end(); ++it) {
if(imageSet.has(*it)) {
continue;
}
@@ -217,15 +217,15 @@ bool GCfilmsExporter::exec() {
return FileHandler::writeTextURL(url(), text, options() & Export::ExportUTF8, options() & Export::ExportForce);
}
-void GCfilmsExporter::push(QTextOStream& ts_, QCString fieldName_, Data::EntryVec::ConstIterator entry_, bool format_) {
- Data::FieldPtr f = collection()->fieldByName(QString::fromLatin1(fieldName_));
+void GCfilmsExporter::push(TQTextOStream& ts_, TQCString fieldName_, Data::EntryVec::ConstIterator entry_, bool format_) {
+ Data::FieldPtr f = collection()->fieldByName(TQString::tqfromLatin1(fieldName_));
// don't format multiple names cause commas will cause problems
if(f->formatFlag() == Data::Field::FormatName && (f->flags() & Data::Field::AllowMultiple)) {
format_ = false;
}
- QString s = entry_->field(QString::fromLatin1(fieldName_), format_);
+ TQString s = entry_->field(TQString::tqfromLatin1(fieldName_), format_);
if(f->flags() & Data::Field::AllowMultiple) {
- ts_ << s.replace(QString::fromLatin1("; "), QChar(','));
+ ts_ << s.tqreplace(TQString::tqfromLatin1("; "), TQChar(','));
} else {
ts_ << s;
}
diff --git a/src/translators/gcfilmsexporter.h b/src/translators/gcfilmsexporter.h
index 50ee31c..c226d7d 100644
--- a/src/translators/gcfilmsexporter.h
+++ b/src/translators/gcfilmsexporter.h
@@ -14,7 +14,7 @@
#ifndef TELLICO_EXPORT_GCFILMSEXPORTER_H
#define TELLICO_EXPORT_GCFILMSEXPORTER_H
-class QTextOStream;
+class TQTextOStream;
#include "exporter.h"
@@ -26,19 +26,20 @@ namespace Tellico {
*/
class GCfilmsExporter : public Exporter {
Q_OBJECT
+ TQ_OBJECT
public:
GCfilmsExporter();
virtual bool exec();
- virtual QString formatString() const;
- virtual QString fileFilter() const;
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const;
// no options
- virtual QWidget* widget(QWidget*, const char*) { return 0; }
+ virtual TQWidget* widget(TQWidget*, const char*) { return 0; }
private:
- void push(QTextOStream& ts, QCString fieldName, Data::EntryVec::ConstIterator entry, bool format);
+ void push(TQTextOStream& ts, TQCString fieldName, Data::EntryVec::ConstIterator entry, bool format);
};
} // end namespace
diff --git a/src/translators/gcfilmsimporter.cpp b/src/translators/gcfilmsimporter.cpp
index e2ff9ca..5b66691 100644
--- a/src/translators/gcfilmsimporter.cpp
+++ b/src/translators/gcfilmsimporter.cpp
@@ -24,7 +24,7 @@
#include <kapplication.h>
#include <kstandarddirs.h>
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
#define CHECKLIMITS(n) if(values.count() <= n) continue
@@ -49,57 +49,57 @@ Tellico::Data::CollPtr GCfilmsImporter::collection() {
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(100);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
- QString str = text();
- QTextIStream t(&str);
- QString line = t.readLine();
- if(line.startsWith(QString::fromLatin1("GCfilms"))) {
+ TQString str = text();
+ TQTextIStream t(&str);
+ TQString line = t.readLine();
+ if(line.startsWith(TQString::tqfromLatin1("GCfilms"))) {
readGCfilms(str);
} else {
// need to reparse the string if it's in utf-8
- if(line.lower().find(QString::fromLatin1("utf-8")) > 0) {
- str = QString::fromUtf8(str.local8Bit());
+ if(line.lower().tqfind(TQString::tqfromLatin1("utf-8")) > 0) {
+ str = TQString::fromUtf8(str.local8Bit());
}
readGCstar(str);
}
return m_coll;
}
-void GCfilmsImporter::readGCfilms(const QString& text_) {
+void GCfilmsImporter::readGCfilms(const TQString& text_) {
m_coll = new Data::VideoCollection(true);
bool hasURL = false;
- if(m_coll->hasField(QString::fromLatin1("url"))) {
- hasURL = m_coll->fieldByName(QString::fromLatin1("url"))->type() == Data::Field::URL;
+ if(m_coll->hasField(TQString::tqfromLatin1("url"))) {
+ hasURL = m_coll->fieldByName(TQString::tqfromLatin1("url"))->type() == Data::Field::URL;
} else {
- Data::FieldPtr field = new Data::Field(QString::fromLatin1("url"), i18n("URL"), Data::Field::URL);
+ Data::FieldPtr field = new Data::Field(TQString::tqfromLatin1("url"), i18n("URL"), Data::Field::URL);
field->setCategory(i18n("General"));
m_coll->addField(field);
hasURL = true;
}
bool convertUTF8 = false;
- QMap<QString, Data::BorrowerPtr> borrowers;
- const QRegExp rx(QString::fromLatin1("\\s*,\\s*"));
- QRegExp year(QString::fromLatin1("\\d{4}"));
- QRegExp runTimeHr(QString::fromLatin1("(\\d+)\\s?hr?"));
- QRegExp runTimeMin(QString::fromLatin1("(\\d+)\\s?mi?n?"));
+ TQMap<TQString, Data::BorrowerPtr> borrowers;
+ const TQRegExp rx(TQString::tqfromLatin1("\\s*,\\s*"));
+ TQRegExp year(TQString::tqfromLatin1("\\d{4}"));
+ TQRegExp runTimeHr(TQString::tqfromLatin1("(\\d+)\\s?hr?"));
+ TQRegExp runTimeMin(TQString::tqfromLatin1("(\\d+)\\s?mi?n?"));
bool gotFirstLine = false;
uint total = 0;
- QTextIStream t(&text_);
+ TQTextIStream t(&text_);
const uint length = text_.length();
- const uint stepSize = QMAX(s_stepSize, length/100);
+ const uint stepSize = TQMAX(s_stepSize, length/100);
const bool showProgress = options() & ImportProgress;
ProgressManager::self()->setTotalSteps(this, length);
uint j = 0;
- for(QString line = t.readLine(); !m_cancelled && !line.isNull(); line = t.readLine(), j += line.length()) {
+ for(TQString line = t.readLine(); !m_cancelled && !line.isNull(); line = t.readLine(), j += line.length()) {
// string was wrongly converted
- QStringList values = QStringList::split('|', (convertUTF8 ? QString::fromUtf8(line.local8Bit()) : line), true);
+ TQStringList values = TQStringList::split('|', (convertUTF8 ? TQString::fromUtf8(line.local8Bit()) : line), true);
if(values.empty()) {
continue;
}
@@ -113,8 +113,8 @@ void GCfilmsImporter::readGCfilms(const QString& text_) {
total = Tellico::toUInt(values[1], 0)+1; // number of lines really
if(values.size() > 2 && values[2] == Latin1Literal("UTF8")) {
// if locale encoding isn't utf8, need to do a reconversion
- QTextCodec* codec = QTextCodec::codecForLocale();
- if(QCString(codec->name()).find("utf-8", 0, false) == -1) {
+ TQTextCodec* codec = TQTextCodec::codecForLocale();
+ if(TQCString(codec->name()).tqfind("utf-8", 0, false) == -1) {
convertUTF8 = true;
}
}
@@ -126,9 +126,9 @@ void GCfilmsImporter::readGCfilms(const QString& text_) {
Data::EntryPtr entry = new Data::Entry(m_coll);
entry->setId(Tellico::toUInt(values[0], &ok));
- entry->setField(QString::fromLatin1("title"), values[1]);
+ entry->setField(TQString::tqfromLatin1("title"), values[1]);
if(year.search(values[2]) > -1) {
- entry->setField(QString::fromLatin1("year"), year.cap());
+ entry->setField(TQString::tqfromLatin1("year"), year.cap());
}
uint time = 0;
@@ -139,57 +139,57 @@ void GCfilmsImporter::readGCfilms(const QString& text_) {
time += Tellico::toUInt(runTimeMin.cap(1), &ok);
}
if(time > 0) {
- entry->setField(QString::fromLatin1("running-time"), QString::number(time));
+ entry->setField(TQString::tqfromLatin1("running-time"), TQString::number(time));
}
- entry->setField(QString::fromLatin1("director"), splitJoin(rx, values[4]));
- entry->setField(QString::fromLatin1("nationality"), splitJoin(rx, values[5]));
- entry->setField(QString::fromLatin1("genre"), splitJoin(rx, values[6]));
+ entry->setField(TQString::tqfromLatin1("director"), splitJoin(rx, values[4]));
+ entry->setField(TQString::tqfromLatin1("nationality"), splitJoin(rx, values[5]));
+ entry->setField(TQString::tqfromLatin1("genre"), splitJoin(rx, values[6]));
KURL u = KURL::fromPathOrURL(values[7]);
if(!u.isEmpty()) {
- QString id = ImageFactory::addImage(u, true /* quiet */);
+ TQString id = ImageFactory::addImage(u, true /* quiet */);
if(!id.isEmpty()) {
- entry->setField(QString::fromLatin1("cover"), id);
+ entry->setField(TQString::tqfromLatin1("cover"), id);
}
}
- entry->setField(QString::fromLatin1("cast"), splitJoin(rx, values[8]));
+ entry->setField(TQString::tqfromLatin1("cast"), splitJoin(rx, values[8]));
// values[9] is the original title
- entry->setField(QString::fromLatin1("plot"), values[10]);
+ entry->setField(TQString::tqfromLatin1("plot"), values[10]);
if(hasURL) {
- entry->setField(QString::fromLatin1("url"), values[11]);
+ entry->setField(TQString::tqfromLatin1("url"), values[11]);
}
CHECKLIMITS(12);
// values[12] is whether the film has been viewed or not
- entry->setField(QString::fromLatin1("medium"), values[13]);
+ entry->setField(TQString::tqfromLatin1("medium"), values[13]);
// values[14] is number of DVDS?
// values[15] is place?
// gcfilms's ratings go 0-10, just divide by two
- entry->setField(QString::fromLatin1("rating"), QString::number(int(Tellico::toUInt(values[16], &ok)/2)));
- entry->setField(QString::fromLatin1("comments"), values[17]);
+ entry->setField(TQString::tqfromLatin1("rating"), TQString::number(int(Tellico::toUInt(values[16], &ok)/2)));
+ entry->setField(TQString::tqfromLatin1("comments"), values[17]);
CHECKLIMITS(18);
- QStringList s = QStringList::split(',', values[18]);
- QStringList tracks, langs;
- for(QStringList::ConstIterator it = s.begin(); it != s.end(); ++it) {
+ TQStringList s = TQStringList::split(',', values[18]);
+ TQStringList tracks, langs;
+ for(TQStringList::ConstIterator it = s.begin(); it != s.end(); ++it) {
langs << (*it).section(';', 0, 0);
tracks << (*it).section(';', 1, 1);
}
- entry->setField(QString::fromLatin1("language"), langs.join(QString::fromLatin1("; ")));
- entry->setField(QString::fromLatin1("audio-track"), tracks.join(QString::fromLatin1("; ")));
+ entry->setField(TQString::tqfromLatin1("language"), langs.join(TQString::tqfromLatin1("; ")));
+ entry->setField(TQString::tqfromLatin1("audio-track"), tracks.join(TQString::tqfromLatin1("; ")));
- entry->setField(QString::fromLatin1("subtitle"), splitJoin(rx, values[19]));
+ entry->setField(TQString::tqfromLatin1("subtitle"), splitJoin(rx, values[19]));
CHECKLIMITS(20);
// values[20] is borrower name
if(!values[20].isEmpty()) {
- QString tmp = values[20];
+ TQString tmp = values[20];
Data::BorrowerPtr b = borrowers[tmp];
if(!b) {
- b = new Data::Borrower(tmp, QString());
+ b = new Data::Borrower(tmp, TQString());
borrowers.insert(tmp, b);
}
// values[21] is loan date
@@ -198,8 +198,8 @@ void GCfilmsImporter::readGCfilms(const QString& text_) {
int d = Tellico::toUInt(tmp.section('/', 0, 0), &ok);
int m = Tellico::toUInt(tmp.section('/', 1, 1), &ok);
int y = Tellico::toUInt(tmp.section('/', 2, 2), &ok);
- b->addLoan(new Data::Loan(entry, QDate(y, m, d), QDate(), QString()));
- entry->setField(QString::fromLatin1("loaned"), QString::fromLatin1("true"));
+ b->addLoan(new Data::Loan(entry, TQDate(y, m, d), TQDate(), TQString()));
+ entry->setField(TQString::tqfromLatin1("loaned"), TQString::tqfromLatin1("true"));
}
}
// values[22] is history ?
@@ -209,15 +209,15 @@ void GCfilmsImporter::readGCfilms(const QString& text_) {
int age = Tellico::toUInt(values[23], &ok);
if(age < 2) {
- entry->setField(QString::fromLatin1("certification"), QString::fromLatin1("U (USA)"));
+ entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("U (USA)"));
} else if(age < 3) {
- entry->setField(QString::fromLatin1("certification"), QString::fromLatin1("G (USA)"));
+ entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("G (USA)"));
} else if(age < 6) {
- entry->setField(QString::fromLatin1("certification"), QString::fromLatin1("PG (USA)"));
+ entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("PG (USA)"));
} else if(age < 14) {
- entry->setField(QString::fromLatin1("certification"), QString::fromLatin1("PG-13 (USA)"));
+ entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("PG-13 (USA)"));
} else {
- entry->setField(QString::fromLatin1("certification"), QString::fromLatin1("R (USA)"));
+ entry->setField(TQString::tqfromLatin1("certification"), TQString::tqfromLatin1("R (USA)"));
}
m_coll->addEntries(entry);
@@ -233,22 +233,22 @@ void GCfilmsImporter::readGCfilms(const QString& text_) {
return;
}
- for(QMap<QString, Data::BorrowerPtr>::Iterator it = borrowers.begin(); it != borrowers.end(); ++it) {
+ for(TQMap<TQString, Data::BorrowerPtr>::Iterator it = borrowers.begin(); it != borrowers.end(); ++it) {
if(!it.data()->isEmpty()) {
m_coll->addBorrower(it.data());
}
}
}
-void GCfilmsImporter::readGCstar(const QString& text_) {
- QString xsltFile = locate("appdata", QString::fromLatin1("gcstar2tellico.xsl"));
+void GCfilmsImporter::readGCstar(const TQString& text_) {
+ TQString xsltFile = locate("appdata", TQString::tqfromLatin1("gcstar2tellico.xsl"));
XSLTHandler handler(xsltFile);
if(!handler.isValid()) {
setStatusMessage(i18n("Tellico encountered an error in XSLT processing."));
return;
}
- QString str = handler.applyStylesheet(text_);
+ TQString str = handler.applyStylesheet(text_);
if(str.isEmpty()) {
setStatusMessage(i18n("<qt>The file is not a valid GCstar data file.</qt>"));
@@ -261,8 +261,8 @@ void GCfilmsImporter::readGCstar(const QString& text_) {
}
inline
-QString GCfilmsImporter::splitJoin(const QRegExp& rx, const QString& s) {
- return QStringList::split(rx, s, false).join(QString::fromLatin1("; "));
+TQString GCfilmsImporter::splitJoin(const TQRegExp& rx, const TQString& s) {
+ return TQStringList::split(rx, s, false).join(TQString::tqfromLatin1("; "));
}
void GCfilmsImporter::slotCancel() {
diff --git a/src/translators/gcfilmsimporter.h b/src/translators/gcfilmsimporter.h
index 8fa9a0d..9dca11d 100644
--- a/src/translators/gcfilmsimporter.h
+++ b/src/translators/gcfilmsimporter.h
@@ -17,7 +17,7 @@
#include "textimporter.h"
#include "../datavectors.h"
-class QRegExp;
+class TQRegExp;
namespace Tellico {
namespace Import {
@@ -27,6 +27,7 @@ namespace Tellico {
*/
class GCfilmsImporter : public TextImporter {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -39,17 +40,17 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget*, const char*) { return 0; }
+ virtual TQWidget* widget(TQWidget*, const char*) { return 0; }
virtual bool canImport(int type) const;
public slots:
void slotCancel();
private:
- static QString splitJoin(const QRegExp& rx, const QString& s);
+ static TQString splitJoin(const TQRegExp& rx, const TQString& s);
- void readGCfilms(const QString& text);
- void readGCstar(const QString& text);
+ void readGCfilms(const TQString& text);
+ void readGCstar(const TQString& text);
Data::CollPtr m_coll;
bool m_cancelled;
diff --git a/src/translators/griffith2tellico.py b/src/translators/griffith2tellico.py
index 24bfb41..31c947e 100755
--- a/src/translators/griffith2tellico.py
+++ b/src/translators/griffith2tellico.py
@@ -149,7 +149,7 @@ class BasicTellicoDOM:
else:
field = key
- parentNode = self.__doc.createElement(field + 's')
+ tqparentNode = self.__doc.createElement(field + 's')
for value in values:
if len(value) == 0: continue
@@ -173,9 +173,9 @@ class BasicTellicoDOM:
else:
node.appendChild(self.__doc.createTextNode(value.strip()))
- if node.hasChildNodes(): parentNode.appendChild(node)
+ if node.hasChildNodes(): tqparentNode.appendChild(node)
- if parentNode.hasChildNodes(): entryNode.appendChild(parentNode)
+ if tqparentNode.hasChildNodes(): entryNode.appendChild(tqparentNode)
self.__collection.appendChild(entryNode)
@@ -246,12 +246,12 @@ class GriffithParser:
except:
value = str(row[i])
- col = columns[i].replace('[','').replace(']','')
+ col = columns[i].tqreplace('[','').tqreplace(']','')
if col == 'genre' or col == 'studio':
values = value.split('/')
elif col == 'plot' or col == 'notes':
- value = value.replace('\n', '\n<br/>')
+ value = value.tqreplace('\n', '\n<br/>')
values = (value,)
elif col == 'cast':
values = []
@@ -272,7 +272,7 @@ class GriffithParser:
values = (value,)
else:
values = (value,)
- col = col.replace('"','')
+ col = col.tqreplace('"','')
data[col] = values
# get medium
diff --git a/src/translators/griffithimporter.cpp b/src/translators/griffithimporter.cpp
index 8b0394f..953a159 100644
--- a/src/translators/griffithimporter.cpp
+++ b/src/translators/griffithimporter.cpp
@@ -20,8 +20,8 @@
#include <kstandarddirs.h>
#include <kprocess.h>
-#include <qdir.h>
-#include <qfile.h>
+#include <tqdir.h>
+#include <tqfile.h>
using Tellico::Import::GriffithImporter;
@@ -34,28 +34,28 @@ GriffithImporter::~GriffithImporter() {
}
Tellico::Data::CollPtr GriffithImporter::collection() {
- QString filename = QDir::homeDirPath() + QString::fromLatin1("/.griffith/griffith.db");
- if(!QFile::exists(filename)) {
+ TQString filename = TQDir::homeDirPath() + TQString::tqfromLatin1("/.griffith/griffith.db");
+ if(!TQFile::exists(filename)) {
myWarning() << "GriffithImporter::collection() - database not found: " << filename << endl;
return 0;
}
- QString python = KStandardDirs::findExe(QString::fromLatin1("python"));
+ TQString python = KStandardDirs::findExe(TQString::tqfromLatin1("python"));
if(python.isEmpty()) {
myWarning() << "GriffithImporter::collection() - python not found!" << endl;
return 0;
}
- QString griffith = KGlobal::dirs()->findResource("appdata", QString::fromLatin1("griffith2tellico.py"));
+ TQString griffith = KGlobal::dirs()->findResource("appdata", TQString::tqfromLatin1("griffith2tellico.py"));
if(griffith.isEmpty()) {
myWarning() << "GriffithImporter::collection() - griffith2tellico.py not found!" << endl;
return 0;
}
m_process = new KProcess();
- connect(m_process, SIGNAL(receivedStdout(KProcess*, char*, int)), SLOT(slotData(KProcess*, char*, int)));
- connect(m_process, SIGNAL(receivedStderr(KProcess*, char*, int)), SLOT(slotError(KProcess*, char*, int)));
- connect(m_process, SIGNAL(processExited(KProcess*)), SLOT(slotProcessExited(KProcess*)));
+ connect(m_process, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), TQT_SLOT(slotData(KProcess*, char*, int)));
+ connect(m_process, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), TQT_SLOT(slotError(KProcess*, char*, int)));
+ connect(m_process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(slotProcessExited(KProcess*)));
*m_process << python << griffith;
if(!m_process->start(KProcess::Block, KProcess::AllOutput)) {
myDebug() << "ExecExternalFetcher::startSearch() - process failed to start" << endl;
@@ -66,12 +66,12 @@ Tellico::Data::CollPtr GriffithImporter::collection() {
}
void GriffithImporter::slotData(KProcess*, char* buffer_, int len_) {
- QDataStream stream(m_data, IO_WriteOnly | IO_Append);
+ TQDataStream stream(m_data, IO_WriteOnly | IO_Append);
stream.writeRawBytes(buffer_, len_);
}
void GriffithImporter::slotError(KProcess*, char* buffer_, int len_) {
- QString msg = QString::fromLocal8Bit(buffer_, len_);
+ TQString msg = TQString::fromLocal8Bit(buffer_, len_);
myDebug() << "GriffithImporter::slotError() - " << msg << endl;
setStatusMessage(msg);
}
@@ -89,7 +89,7 @@ void GriffithImporter::slotProcessExited(KProcess*) {
return;
}
- QString text = QString::fromUtf8(m_data, m_data.size());
+ TQString text = TQString::fromUtf8(m_data, m_data.size());
TellicoImporter imp(text);
m_coll = imp.collection();
diff --git a/src/translators/griffithimporter.h b/src/translators/griffithimporter.h
index 60bae07..de3d59a 100644
--- a/src/translators/griffithimporter.h
+++ b/src/translators/griffithimporter.h
@@ -32,6 +32,7 @@ namespace Tellico {
*/
class GriffithImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -55,7 +56,7 @@ private:
Data::CollPtr m_coll;
KProcess* m_process;
- QByteArray m_data;
+ TQByteArray m_data;
};
} // end namespace
diff --git a/src/translators/grs1importer.cpp b/src/translators/grs1importer.cpp
index 7eca9e3..6b6c8d2 100644
--- a/src/translators/grs1importer.cpp
+++ b/src/translators/grs1importer.cpp
@@ -26,24 +26,24 @@ void GRS1Importer::initTagMap() {
if(!s_tagMap) {
s_tagMap = new TagMap();
// BT is special and is handled separately
- s_tagMap->insert(TagPair(2, 1), QString::fromLatin1("title"));
- s_tagMap->insert(TagPair(2, 2), QString::fromLatin1("author"));
- s_tagMap->insert(TagPair(2, 4), QString::fromLatin1("year"));
- s_tagMap->insert(TagPair(2, 7), QString::fromLatin1("publisher"));
- s_tagMap->insert(TagPair(2, 31), QString::fromLatin1("publisher"));
- s_tagMap->insert(TagPair(2, 20), QString::fromLatin1("language"));
- s_tagMap->insert(TagPair(2, 21), QString::fromLatin1("keyword"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("isbn/issn")), QString::fromLatin1("isbn"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("isbn")), QString::fromLatin1("isbn"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("notes")), QString::fromLatin1("note"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("note")), QString::fromLatin1("note"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("series")), QString::fromLatin1("series"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("physical description")), QString::fromLatin1("note"));
- s_tagMap->insert(TagPair(3, QString::fromLatin1("subtitle")), QString::fromLatin1("subtitle"));
+ s_tagMap->insert(TagPair(2, 1), TQString::tqfromLatin1("title"));
+ s_tagMap->insert(TagPair(2, 2), TQString::tqfromLatin1("author"));
+ s_tagMap->insert(TagPair(2, 4), TQString::tqfromLatin1("year"));
+ s_tagMap->insert(TagPair(2, 7), TQString::tqfromLatin1("publisher"));
+ s_tagMap->insert(TagPair(2, 31), TQString::tqfromLatin1("publisher"));
+ s_tagMap->insert(TagPair(2, 20), TQString::tqfromLatin1("language"));
+ s_tagMap->insert(TagPair(2, 21), TQString::tqfromLatin1("keyword"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("isbn/issn")), TQString::tqfromLatin1("isbn"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("isbn")), TQString::tqfromLatin1("isbn"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("notes")), TQString::tqfromLatin1("note"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("note")), TQString::tqfromLatin1("note"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("series")), TQString::tqfromLatin1("series"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("physical description")), TQString::tqfromLatin1("note"));
+ s_tagMap->insert(TagPair(3, TQString::tqfromLatin1("subtitle")), TQString::tqfromLatin1("subtitle"));
}
}
-GRS1Importer::GRS1Importer(const QString& text_) : TextImporter(text_) {
+GRS1Importer::GRS1Importer(const TQString& text_) : TextImporter(text_) {
initTagMap();
}
@@ -54,12 +54,12 @@ bool GRS1Importer::canImport(int type) const {
Tellico::Data::CollPtr GRS1Importer::collection() {
Data::CollPtr coll = new Data::BibtexCollection(true);
- Data::FieldPtr f = new Data::Field(QString::fromLatin1("isbn"), i18n("ISBN#"));
+ Data::FieldPtr f = new Data::Field(TQString::tqfromLatin1("isbn"), i18n("ISBN#"));
f->setCategory(i18n("Publishing"));
f->setDescription(i18n("International Standard Book Number"));
coll->addField(f);
- f = new Data::Field(QString::fromLatin1("language"), i18n("Language"));
+ f = new Data::Field(TQString::tqfromLatin1("language"), i18n("Language"));
f->setCategory(i18n("Publishing"));
f->setFlags(Data::Field::AllowCompletion | Data::Field::AllowGrouped | Data::Field::AllowMultiple);
coll->addField(f);
@@ -68,20 +68,20 @@ Tellico::Data::CollPtr GRS1Importer::collection() {
bool empty = true;
// in format "(tag, tag) value"
- QRegExp rx(QString::fromLatin1("\\s*\\((\\d+),\\s*(.+)\\s*\\)\\s*(.+)\\s*"));
+ TQRegExp rx(TQString::tqfromLatin1("\\s*\\((\\d+),\\s*(.+)\\s*\\)\\s*(.+)\\s*"));
// rx.setMinimal(true);
- QRegExp dateRx(QString::fromLatin1(",[^,]*\\d{3,4}[^,]*")); // remove dates from authors
- QRegExp pubRx(QString::fromLatin1("([^:]+):([^,]+),?")); // split location and publisher
+ TQRegExp dateRx(TQString::tqfromLatin1(",[^,]*\\d{3,4}[^,]*")); // remove dates from authors
+ TQRegExp pubRx(TQString::tqfromLatin1("([^:]+):([^,]+),?")); // split location and publisher
bool ok;
int n;
- QVariant v;
- QString tmp, field, val, str = text();
+ TQVariant v;
+ TQString tmp, field, val, str = text();
if(str.isEmpty()) {
return 0;
}
- QTextStream t(&str, IO_ReadOnly);
- for(QString line = t.readLine(); !line.isNull(); line = t.readLine()) {
+ TQTextStream t(&str, IO_ReadOnly);
+ for(TQString line = t.readLine(); !line.isNull(); line = t.readLine()) {
// myDebug() << line << endl;
if(!rx.exactMatch(line)) {
continue;
@@ -105,18 +105,18 @@ Tellico::Data::CollPtr GRS1Importer::collection() {
if(field == Latin1Literal("title")) {
val = val.section('/', 0, 0).stripWhiteSpace(); // only take portion of title before slash
} else if(field == Latin1Literal("author")) {
- val.replace(dateRx, QString::null);
+ val.tqreplace(dateRx, TQString());
} else if(field == Latin1Literal("publisher")) {
- int pos = val.find(pubRx);
+ int pos = val.tqfind(pubRx);
if(pos > -1) {
- e->setField(QString::fromLatin1("address"), pubRx.cap(1));
+ e->setField(TQString::tqfromLatin1("address"), pubRx.cap(1));
val = pubRx.cap(2);
}
}
tmp = e->field(field);
if(!tmp.isEmpty()) {
- tmp += QString::fromLatin1("; ");
+ tmp += TQString::tqfromLatin1("; ");
}
e->setField(field, tmp + val);
}
diff --git a/src/translators/grs1importer.h b/src/translators/grs1importer.h
index a4929a4..04ea35b 100644
--- a/src/translators/grs1importer.h
+++ b/src/translators/grs1importer.h
@@ -17,9 +17,9 @@
#include "textimporter.h"
#include "../datavectors.h"
-#include <qvariant.h>
-#include <qmap.h>
-#include <qpair.h>
+#include <tqvariant.h>
+#include <tqmap.h>
+#include <tqpair.h>
namespace Tellico {
namespace Import {
@@ -29,9 +29,10 @@ namespace Tellico {
*/
class GRS1Importer : public TextImporter {
Q_OBJECT
+ TQ_OBJECT
public:
- GRS1Importer(const QString& text);
+ GRS1Importer(const TQString& text);
virtual ~GRS1Importer() {}
/**
@@ -40,23 +41,23 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget*, const char*) { return 0; }
+ virtual TQWidget* widget(TQWidget*, const char*) { return 0; }
virtual bool canImport(int type) const;
private:
static void initTagMap();
- class TagPair : public QPair<int, QVariant> {
+ class TagPair : public TQPair<int, TQVariant> {
public:
- TagPair() : QPair<int, QVariant>(-1, QVariant()) {}
- TagPair(int n, const QVariant& v) : QPair<int, QVariant>(n, v) {}
- QString toString() const { return QString::number(first) + second.toString(); }
+ TagPair() : TQPair<int, TQVariant>(-1, TQVariant()) {}
+ TagPair(int n, const TQVariant& v) : TQPair<int, TQVariant>(n, v) {}
+ TQString toString() const { return TQString::number(first) + second.toString(); }
bool operator< (const TagPair& p) const {
return toString() < p.toString();
}
};
- typedef QMap<TagPair, QString> TagMap;
+ typedef TQMap<TagPair, TQString> TagMap;
static TagMap* s_tagMap;
};
diff --git a/src/translators/htmlexporter.cpp b/src/translators/htmlexporter.cpp
index e947793..b8a38c0 100644
--- a/src/translators/htmlexporter.cpp
+++ b/src/translators/htmlexporter.cpp
@@ -32,14 +32,14 @@
#include <kapplication.h>
#include <klocale.h>
-#include <qdom.h>
-#include <qgroupbox.h>
-#include <qlayout.h>
-#include <qcheckbox.h>
-#include <qwhatsthis.h>
-#include <qfile.h>
-#include <qhbox.h>
-#include <qlabel.h>
+#include <tqdom.h>
+#include <tqgroupbox.h>
+#include <tqlayout.h>
+#include <tqcheckbox.h>
+#include <tqwhatsthis.h>
+#include <tqfile.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
extern "C" {
#include <libxml/HTMLparser.h>
@@ -59,7 +59,7 @@ HTMLExporter::HTMLExporter() : Tellico::Export::Exporter(),
m_imageWidth(0),
m_imageHeight(0),
m_widget(0),
- m_xsltFile(QString::fromLatin1("tellico2html.xsl")) {
+ m_xsltFile(TQString::tqfromLatin1("tellico2html.xsl")) {
}
HTMLExporter::HTMLExporter(Data::CollPtr coll_) : Tellico::Export::Exporter(coll_),
@@ -73,7 +73,7 @@ HTMLExporter::HTMLExporter(Data::CollPtr coll_) : Tellico::Export::Exporter(coll
m_imageWidth(0),
m_imageHeight(0),
m_widget(0),
- m_xsltFile(QString::fromLatin1("tellico2html.xsl")) {
+ m_xsltFile(TQString::tqfromLatin1("tellico2html.xsl")) {
}
HTMLExporter::~HTMLExporter() {
@@ -81,12 +81,12 @@ HTMLExporter::~HTMLExporter() {
m_handler = 0;
}
-QString HTMLExporter::formatString() const {
+TQString HTMLExporter::formatString() const {
return i18n("HTML");
}
-QString HTMLExporter::fileFilter() const {
- return i18n("*.html|HTML Files (*.html)") + QChar('\n') + i18n("*|All Files");
+TQString HTMLExporter::fileFilter() const {
+ return i18n("*.html|HTML Files (*.html)") + TQChar('\n') + i18n("*|All Files");
}
void HTMLExporter::reset() {
@@ -118,9 +118,9 @@ bool HTMLExporter::exec() {
m_cancelled = false;
// TODO: maybe need label?
if(options() & ExportProgress) {
- ProgressItem& item = ProgressManager::self()->newProgressItem(this, QString::null, true);
+ ProgressItem& item = ProgressManager::self()->newProgressItem(this, TQString(), true);
item.setTotalSteps(100);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
}
// ok if not ExportProgress, no worries
ProgressItem::Done done(this);
@@ -141,9 +141,9 @@ bool HTMLExporter::exec() {
xmlChar* c;
int bytes;
htmlDocDumpMemory(htmlDoc, &c, &bytes);
- QString allText;
+ TQString allText;
if(bytes > 0) {
- allText = QString::fromUtf8(reinterpret_cast<const char*>(c), bytes);
+ allText = TQString::fromUtf8(reinterpret_cast<const char*>(c), bytes);
xmlFree(c);
}
@@ -158,7 +158,7 @@ bool HTMLExporter::exec() {
}
bool HTMLExporter::loadXSLTFile() {
- QString xsltfile = locate("appdata", m_xsltFile);
+ TQString xsltfile = locate("appdata", m_xsltFile);
if(xsltfile.isNull()) {
myDebug() << "HTMLExporter::loadXSLTFile() - no xslt file for " << m_xsltFile << endl;
return false;
@@ -167,9 +167,9 @@ bool HTMLExporter::loadXSLTFile() {
KURL u;
u.setPath(xsltfile);
// do NOT do namespace processing, it messes up the XSL declaration since
- // QDom thinks there are no elements in the Tellico namespace and as a result
+ // TQDom thinks there are no elements in the Tellico namespace and as a result
// removes the namespace declaration
- QDomDocument dom = FileHandler::readXMLFile(u, false);
+ TQDomDocument dom = FileHandler::readXMLFile(u, false);
if(dom.isNull()) {
myDebug() << "HTMLExporter::loadXSLTFile() - error loading xslt file: " << xsltfile << endl;
return false;
@@ -186,7 +186,7 @@ bool HTMLExporter::loadXSLTFile() {
}
delete m_handler;
- m_handler = new XSLTHandler(dom, QFile::encodeName(xsltfile), true /*translate*/);
+ m_handler = new XSLTHandler(dom, TQFile::encodeName(xsltfile), true /*translate*/);
if(!m_handler->isValid()) {
delete m_handler;
m_handler = 0;
@@ -195,13 +195,13 @@ bool HTMLExporter::loadXSLTFile() {
if(m_exportEntryFiles) {
// export entries to same place as all the other date files
- m_handler->addStringParam("entrydir", QFile::encodeName(fileDir().fileName())+ '/');
+ m_handler->addStringParam("entrydir", TQFile::encodeName(fileDir().fileName())+ '/');
// be sure to link all the entries
m_handler->addParam("link-entries", "true()");
}
if(!m_collectionURL.isEmpty()) {
- QString s = QString::fromLatin1("../") + m_collectionURL.fileName();
+ TQString s = TQString::tqfromLatin1("../") + m_collectionURL.fileName();
m_handler->addStringParam("collection-file", s.utf8());
}
@@ -209,12 +209,12 @@ bool HTMLExporter::loadXSLTFile() {
// if parseDOM, that means we want the locations to be the actual location
// otherwise, we assume it'll be relative
if(m_parseDOM && m_dataDir.isEmpty()) {
- m_dataDir = KGlobal::dirs()->findResourceDir("appdata", QString::fromLatin1("pics/tellico.png"));
+ m_dataDir = KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png"));
} else if(!m_parseDOM) {
m_dataDir.truncate(0);
}
if(!m_dataDir.isEmpty()) {
- m_handler->addStringParam("datadir", QFile::encodeName(m_dataDir));
+ m_handler->addStringParam("datadir", TQFile::encodeName(m_dataDir));
}
setFormattingOptions(collection());
@@ -222,16 +222,16 @@ bool HTMLExporter::loadXSLTFile() {
return m_handler->isValid();
}
-QString HTMLExporter::text() {
+TQString HTMLExporter::text() {
if((!m_handler || !m_handler->isValid()) && !loadXSLTFile()) {
kdWarning() << "HTMLExporter::text() - error loading xslt file: " << m_xsltFile << endl;
- return QString::null;
+ return TQString();
}
Data::CollPtr coll = collection();
if(!coll) {
myDebug() << "HTMLExporter::text() - no collection pointer!" << endl;
- return QString::null;
+ return TQString();
}
if(m_groupBy.isEmpty()) {
@@ -248,21 +248,21 @@ QString HTMLExporter::text() {
exporter.setIncludeGroups(m_printGrouped);
// yes, this should be in utf8, always
exporter.setOptions(options() | Export::ExportUTF8 | Export::ExportImages);
- QDomDocument output = exporter.exportXML();
+ TQDomDocument output = exporter.exportXML();
#if 0
- QFile f(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
+ TQTextStream t(&f);
t << output.toString();
}
f.close();
#endif
- QString text = m_handler->applyStylesheet(output.toString());
+ TQString text = m_handler->applyStylesheet(output.toString());
#if 0
- QFile f2(QString::fromLatin1("/tmp/test.html"));
+ TQFile f2(TQString::tqfromLatin1("/tmp/test.html"));
if(f2.open(IO_WriteOnly)) {
- QTextStream t(&f2);
+ TQTextStream t(&f2);
t << text;
// t << "\n\n-------------------------------------------------------\n\n";
// t << Tellico::i18nReplace(text);
@@ -275,15 +275,15 @@ QString HTMLExporter::text() {
}
void HTMLExporter::setFormattingOptions(Data::CollPtr coll) {
- QString file = Kernel::self()->URL().fileName();
+ TQString file = Kernel::self()->URL().fileName();
if(file != i18n("Untitled")) {
- m_handler->addStringParam("filename", QFile::encodeName(file));
+ m_handler->addStringParam("filename", TQFile::encodeName(file));
}
- m_handler->addStringParam("cdate", KGlobal::locale()->formatDate(QDate::currentDate()).utf8());
+ m_handler->addStringParam("cdate", KGlobal::locale()->formatDate(TQDate::tqcurrentDate()).utf8());
m_handler->addParam("show-headers", m_printHeaders ? "true()" : "false()");
m_handler->addParam("group-entries", m_printGrouped ? "true()" : "false()");
- QStringList sortTitles;
+ TQStringList sortTitles;
if(!m_sort1.isEmpty()) {
sortTitles << m_sort1;
}
@@ -292,7 +292,7 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) {
}
// the third sort column may be same as first
- if(!m_sort3.isEmpty() && sortTitles.findIndex(m_sort3) == -1) {
+ if(!m_sort3.isEmpty() && sortTitles.tqfindIndex(m_sort3) == -1) {
sortTitles << m_sort3;
}
@@ -308,38 +308,38 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) {
// no longer showing "sorted by..." since the column headers are clickable
// but still use "grouped by"
- QString sortString;
+ TQString sortString;
if(m_printGrouped) {
- QString s;
+ TQString s;
// if more than one, then it's the People pseudo-group
if(m_groupBy.count() > 1) {
s = i18n("People");
} else {
s = coll->fieldTitleByName(m_groupBy[0]);
}
- sortString = i18n("(grouped by %1)").arg(s);
+ sortString = i18n("(grouped by %1)").tqarg(s);
- QString groupFields;
- for(QStringList::ConstIterator it = m_groupBy.begin(); it != m_groupBy.end(); ++it) {
+ TQString groupFields;
+ for(TQStringList::ConstIterator it = m_groupBy.begin(); it != m_groupBy.end(); ++it) {
Data::FieldPtr f = coll->fieldByName(*it);
if(!f) {
continue;
}
if(f->flags() & Data::Field::AllowMultiple) {
- groupFields += QString::fromLatin1("tc:") + *it + QString::fromLatin1("s/tc:") + *it;
+ groupFields += TQString::tqfromLatin1("tc:") + *it + TQString::tqfromLatin1("s/tc:") + *it;
} else {
- groupFields += QString::fromLatin1("tc:") + *it;
+ groupFields += TQString::tqfromLatin1("tc:") + *it;
}
int ncols = 0;
if(f->type() == Data::Field::Table) {
bool ok;
- ncols = Tellico::toUInt(f->property(QString::fromLatin1("columns")), &ok);
+ ncols = Tellico::toUInt(f->property(TQString::tqfromLatin1("columns")), &ok);
if(!ok) {
ncols = 1;
}
}
if(ncols > 1) {
- groupFields += QString::fromLatin1("/tc:column[1]");
+ groupFields += TQString::tqfromLatin1("/tc:column[1]");
}
if(*it != m_groupBy.last()) {
groupFields += '|';
@@ -350,29 +350,29 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) {
m_handler->addStringParam("sort-title", sortString.utf8());
}
- QString pageTitle = coll->title();
- pageTitle += QChar(' ') + sortString;
+ TQString pageTitle = coll->title();
+ pageTitle += TQChar(' ') + sortString;
m_handler->addStringParam("page-title", pageTitle.utf8());
- QStringList showFields;
- for(QStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) {
+ TQStringList showFields;
+ for(TQStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) {
showFields << coll->fieldNameByTitle(*it);
}
- m_handler->addStringParam("column-names", showFields.join(QChar(' ')).utf8());
+ m_handler->addStringParam("column-names", showFields.join(TQChar(' ')).utf8());
if(m_imageWidth > 0 && m_imageHeight > 0) {
- m_handler->addParam("image-width", QCString().setNum(m_imageWidth));
- m_handler->addParam("image-height", QCString().setNum(m_imageHeight));
+ m_handler->addParam("image-width", TQCString().setNum(m_imageWidth));
+ m_handler->addParam("image-height", TQCString().setNum(m_imageHeight));
}
// add system colors to stylesheet
const int type = coll->type();
- m_handler->addStringParam("font", Config::templateFont(type).family().latin1());
- m_handler->addStringParam("fontsize", QCString().setNum(Config::templateFont(type).pointSize()));
- m_handler->addStringParam("bgcolor", Config::templateBaseColor(type).name().latin1());
- m_handler->addStringParam("fgcolor", Config::templateTextColor(type).name().latin1());
- m_handler->addStringParam("color1", Config::templateHighlightedTextColor(type).name().latin1());
- m_handler->addStringParam("color2", Config::templateHighlightedBaseColor(type).name().latin1());
+ m_handler->addStringParam("font", TQString(Config::templateFont(type).family()).latin1());
+ m_handler->addStringParam("fontsize", TQCString().setNum(Config::templateFont(type).pointSize()));
+ m_handler->addStringParam("bgcolor", TQString(Config::templateBaseColor(type).name()).latin1());
+ m_handler->addStringParam("fgcolor", TQString(Config::templateTextColor(type).name()).latin1());
+ m_handler->addStringParam("color1", TQString(Config::templateHighlightedTextColor(type).name()).latin1());
+ m_handler->addStringParam("color2", TQString(Config::templateHighlightedBaseColor(type).name()).latin1());
// add locale code to stylesheet (for sorting)
m_handler->addStringParam("lang", KGlobal::locale()->languagesTwoAlpha().first().utf8());
@@ -381,7 +381,7 @@ void HTMLExporter::setFormattingOptions(Data::CollPtr coll) {
void HTMLExporter::writeImages(Data::CollPtr coll_) {
// keep track of which image fields to write, this is for field names
StringSet imageFields;
- for(QStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) {
+ for(TQStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) {
if(coll_->fieldByTitle(*it)->type() == Data::Field::Image) {
imageFields.add(*it);
}
@@ -402,7 +402,7 @@ void HTMLExporter::writeImages(Data::CollPtr coll_) {
// all of them are going to get written to tmp file
bool useTemp = url().isEmpty();
KURL imgDir;
- QString imgDirRelative;
+ TQString imgDirRelative;
// really some convoluted logic here
// basically, four cases. 1) we're writing to a tmp file, for printing probably
// so then write all the images to the tmp directory, 2) we're exporting to HTML, and
@@ -423,16 +423,16 @@ void HTMLExporter::writeImages(Data::CollPtr coll_) {
imgDirRelative = KURL::relativeURL(url(), imgDir);
createDir();
}
- m_handler->addStringParam("imgdir", QFile::encodeName(imgDirRelative));
+ m_handler->addStringParam("imgdir", TQFile::encodeName(imgDirRelative));
int count = 0;
const int processCount = 100; // process after every 100 events
- QStringList fieldsList = imageFields.toList();
+ TQStringList fieldsList = imageFields.toList();
StringSet imageSet; // track which images are written
- for(QStringList::ConstIterator fieldName = fieldsList.begin(); fieldName != fieldsList.end(); ++fieldName) {
+ for(TQStringList::ConstIterator fieldName = fieldsList.begin(); fieldName != fieldsList.end(); ++fieldName) {
for(Data::EntryVec::ConstIterator entryIt = entries().begin(); entryIt != entries().end(); ++entryIt) {
- QString id = entryIt->field(*fieldName);
+ TQString id = entryIt->field(*fieldName);
// if no id or is already writen, continue
if(id.isEmpty() || imageSet.has(id)) {
continue;
@@ -454,29 +454,29 @@ void HTMLExporter::writeImages(Data::CollPtr coll_) {
}
}
-QWidget* HTMLExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
- if(m_widget && m_widget->parent() == parent_) {
+TQWidget* HTMLExporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) {
+ if(m_widget && TQT_BASE_OBJECT(m_widget->tqparent()) == TQT_BASE_OBJECT(tqparent_)) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* box = new QGroupBox(1, Qt::Horizontal, i18n("HTML Options"), m_widget);
+ TQGroupBox* box = new TQGroupBox(1, Qt::Horizontal, i18n("HTML Options"), m_widget);
l->addWidget(box);
- m_checkPrintHeaders = new QCheckBox(i18n("Print field headers"), box);
- QWhatsThis::add(m_checkPrintHeaders, i18n("If checked, the field names will be "
+ m_checkPrintHeaders = new TQCheckBox(i18n("Print field headers"), box);
+ TQWhatsThis::add(m_checkPrintHeaders, i18n("If checked, the field names will be "
"printed as table headers."));
m_checkPrintHeaders->setChecked(m_printHeaders);
- m_checkPrintGrouped = new QCheckBox(i18n("Group the entries"), box);
- QWhatsThis::add(m_checkPrintGrouped, i18n("If checked, the entries will be grouped by "
+ m_checkPrintGrouped = new TQCheckBox(i18n("Group the entries"), box);
+ TQWhatsThis::add(m_checkPrintGrouped, i18n("If checked, the entries will be grouped by "
"the selected field."));
m_checkPrintGrouped->setChecked(m_printGrouped);
- m_checkExportEntryFiles = new QCheckBox(i18n("Export individual entry files"), box);
- QWhatsThis::add(m_checkExportEntryFiles, i18n("If checked, individual files will be created for each entry."));
+ m_checkExportEntryFiles = new TQCheckBox(i18n("Export individual entry files"), box);
+ TQWhatsThis::add(m_checkExportEntryFiles, i18n("If checked, individual files will be created for each entry."));
m_checkExportEntryFiles->setChecked(m_exportEntryFiles);
l->addStretch(1);
@@ -484,19 +484,19 @@ QWidget* HTMLExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
}
void HTMLExporter::readOptions(KConfig* config_) {
- KConfigGroup exportConfig(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup exportConfig(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_printHeaders = exportConfig.readBoolEntry("Print Field Headers", m_printHeaders);
m_printGrouped = exportConfig.readBoolEntry("Print Grouped", m_printGrouped);
m_exportEntryFiles = exportConfig.readBoolEntry("Export Entry Files", m_exportEntryFiles);
// read current entry export template
m_entryXSLTFile = Config::templateName(collection()->type());
- m_entryXSLTFile = locate("appdata", QString::fromLatin1("entry-templates/")
- + m_entryXSLTFile + QString::fromLatin1(".xsl"));
+ m_entryXSLTFile = locate("appdata", TQString::tqfromLatin1("entry-templates/")
+ + m_entryXSLTFile + TQString::tqfromLatin1(".xsl"));
}
void HTMLExporter::saveOptions(KConfig* config_) {
- KConfigGroup cfg(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup cfg(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_printHeaders = m_checkPrintHeaders->isChecked();
cfg.writeEntry("Print Field Headers", m_printHeaders);
m_printGrouped = m_checkPrintGrouped->isChecked();
@@ -505,13 +505,13 @@ void HTMLExporter::saveOptions(KConfig* config_) {
cfg.writeEntry("Export Entry Files", m_exportEntryFiles);
}
-void HTMLExporter::setXSLTFile(const QString& filename_) {
+void HTMLExporter::setXSLTFile(const TQString& filename_) {
if(m_xsltFile == filename_) {
return;
}
m_xsltFile = filename_;
- m_xsltFilePath = QString::null;
+ m_xsltFilePath = TQString();
reset();
}
@@ -521,25 +521,25 @@ KURL HTMLExporter::fileDir() const {
}
KURL fileDir = url();
// cd to directory of target URL
- fileDir.cd(QString::fromLatin1(".."));
+ fileDir.cd(TQString::tqfromLatin1(".."));
fileDir.addPath(fileDirName());
return fileDir;
}
-QString HTMLExporter::fileDirName() const {
+TQString HTMLExporter::fileDirName() const {
if(!m_collectionURL.isEmpty()) {
- return QString::fromLatin1("/");
+ return TQString::tqfromLatin1("/");
}
- return url().fileName().section('.', 0, 0) + QString::fromLatin1("_files/");
+ return url().fileName().section('.', 0, 0) + TQString::tqfromLatin1("_files/");
}
// how ugly is this?
const xmlChar* HTMLExporter::handleLink(const xmlChar* link_) {
- return reinterpret_cast<xmlChar*>(qstrdup(handleLink(QString::fromUtf8(reinterpret_cast<const char*>(link_))).utf8()));
+ return reinterpret_cast<xmlChar*>(qstrdup(handleLink(TQString::fromUtf8(reinterpret_cast<const char*>(link_))).utf8()));
}
-QString HTMLExporter::handleLink(const QString& link_) {
- if(m_links.contains(link_)) {
+TQString HTMLExporter::handleLink(const TQString& link_) {
+ if(m_links.tqcontains(link_)) {
return m_links[link_];
}
// assume that if the link_ is not relative, then we don't need to copy it
@@ -569,10 +569,10 @@ QString HTMLExporter::handleLink(const QString& link_) {
// if we're exporting entry files, we want pics/ to
// go in pics/
- const bool isPic = link_.startsWith(m_dataDir + QString::fromLatin1("pics/"));
- QString midDir;
+ const bool isPic = link_.startsWith(m_dataDir + TQString::tqfromLatin1("pics/"));
+ TQString midDir;
if(m_exportEntryFiles && isPic) {
- midDir = QString::fromLatin1("pics/");
+ midDir = TQString::tqfromLatin1("pics/");
}
// pictures are special since they might not exist when the HTML is exported, since they might get copied later
// on the other hand, don't change the file location if it doesn't exist
@@ -585,28 +585,28 @@ QString HTMLExporter::handleLink(const QString& link_) {
}
const xmlChar* HTMLExporter::analyzeInternalCSS(const xmlChar* str_) {
- return reinterpret_cast<xmlChar*>(qstrdup(analyzeInternalCSS(QString::fromUtf8(reinterpret_cast<const char*>(str_))).utf8()));
+ return reinterpret_cast<xmlChar*>(qstrdup(analyzeInternalCSS(TQString::fromUtf8(reinterpret_cast<const char*>(str_))).utf8()));
}
-QString HTMLExporter::analyzeInternalCSS(const QString& str_) {
- QString str = str_;
+TQString HTMLExporter::analyzeInternalCSS(const TQString& str_) {
+ TQString str = str_;
int start = 0;
int end = 0;
- const QString url = QString::fromLatin1("url(");
- for(int pos = str.find(url); pos >= 0; pos = str.find(url, pos+1)) {
+ const TQString url = TQString::tqfromLatin1("url(");
+ for(int pos = str.tqfind(url); pos >= 0; pos = str.tqfind(url, pos+1)) {
pos += 4; // url(
if(str[pos] == '"' || str[pos] == '\'') {
++pos;
}
start = pos;
- pos = str.find(')', start);
+ pos = str.tqfind(')', start);
end = pos;
if(str[pos-1] == '"' || str[pos-1] == '\'') {
--end;
}
- str.replace(start, end-start, handleLink(str.mid(start, end-start)));
+ str.tqreplace(start, end-start, handleLink(str.mid(start, end-start)));
}
return str;
}
@@ -633,7 +633,7 @@ bool HTMLExporter::copyFiles() {
}
const uint start = 20;
const uint maxProgress = m_exportEntryFiles ? 40 : 80;
- const uint stepSize = QMAX(1, m_files.count()/maxProgress);
+ const uint stepSize = TQMAX(1, m_files.count()/maxProgress);
uint j = 0;
createDir();
@@ -656,7 +656,7 @@ bool HTMLExporter::copyFiles() {
}
if(j%stepSize == 0) {
if(options() & ExportProgress) {
- ProgressManager::self()->setProgress(this, QMIN(start+j/stepSize, 99));
+ ProgressManager::self()->setProgress(this, TQMIN(start+j/stepSize, 99));
}
kapp->processEvents();
}
@@ -671,19 +671,19 @@ bool HTMLExporter::writeEntryFiles() {
}
const uint start = 60;
- const uint stepSize = QMAX(1, entries().count()/40);
+ const uint stepSize = TQMAX(1, entries().count()/40);
uint j = 0;
// now worry about actually exporting entry files
// I can't reliable encode a string as a URI, so I'm punting, and I'll just replace everything but
// a-zA-Z0-9 with an underscore. This MUST match the filename template in tellico2html.xsl
// the id is used so uniqueness is guaranteed
- const QRegExp badChars(QString::fromLatin1("[^-a-zA-Z0-9]"));
+ const TQRegExp badChars(TQString::tqfromLatin1("[^-a-zA-Z0-9]"));
bool formatted = options() & Export::ExportFormatted;
KURL outputFile = fileDir();
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
HTMLExporter exporter(collection());
long opt = options() | Export::ExportForce;
@@ -693,19 +693,19 @@ bool HTMLExporter::writeEntryFiles() {
exporter.setCollectionURL(url());
bool parseDOM = true;
- const QString title = QString::fromLatin1("title");
- const QString html = QString::fromLatin1(".html");
+ const TQString title = TQString::tqfromLatin1("title");
+ const TQString html = TQString::tqfromLatin1(".html");
bool multipleTitles = collection()->fieldByName(title)->flags() & Data::Field::AllowMultiple;
Data::EntryVec entries = this->entries(); // not const since the pointer has to be copied
for(Data::EntryVecIt entryIt = entries.begin(); entryIt != entries.end() && !m_cancelled; ++entryIt, ++j) {
- QString file = entryIt->field(title, formatted);
+ TQString file = entryIt->field(title, formatted);
// but only use the first title if it has multiple
if(multipleTitles) {
file = file.section(';', 0, 0);
}
- file.replace(badChars, QChar('_'));
- file += QChar('-') + QString::number(entryIt->id()) + html;
+ file.tqreplace(badChars, TQChar('_'));
+ file += TQChar('-') + TQString::number(entryIt->id()) + html;
outputFile.setFileName(file);
exporter.setEntries(Data::EntryVec(entryIt));
@@ -725,24 +725,24 @@ bool HTMLExporter::writeEntryFiles() {
if(j%stepSize == 0) {
if(options() & ExportProgress) {
- ProgressManager::self()->setProgress(this, QMIN(start+j/stepSize, 99));
+ ProgressManager::self()->setProgress(this, TQMIN(start+j/stepSize, 99));
}
kapp->processEvents();
}
}
// the images in "pics/" are special data images, copy them always
// since the entry files may refer to them, but we don't know that
- QStringList dataImages;
- dataImages << QString::fromLatin1("checkmark.png");
+ TQStringList dataImages;
+ dataImages << TQString::tqfromLatin1("checkmark.png");
for(uint i = 1; i <= 10; ++i) {
- dataImages << QString::fromLatin1("stars%1.png").arg(i);
+ dataImages << TQString::tqfromLatin1("stars%1.png").tqarg(i);
}
KURL dataDir;
- dataDir.setPath(KGlobal::dirs()->findResourceDir("appdata", QString::fromLatin1("pics/tellico.png")) + "pics/");
+ dataDir.setPath(KGlobal::dirs()->findResourceDir("appdata", TQString::tqfromLatin1("pics/tellico.png")) + "pics/");
KURL target = fileDir();
- target.addPath(QString::fromLatin1("pics/"));
+ target.addPath(TQString::tqfromLatin1("pics/"));
KIO::NetAccess::mkdir(target, m_widget);
- for(QStringList::ConstIterator it = dataImages.begin(); it != dataImages.end(); ++it) {
+ for(TQStringList::ConstIterator it = dataImages.begin(); it != dataImages.end(); ++it) {
dataDir.setFileName(*it);
target.setFileName(*it);
KIO::NetAccess::copy(dataDir, target, m_widget);
@@ -764,12 +764,12 @@ void HTMLExporter::parseDOM(xmlNode* node_) {
bool parseChildren = true;
if(node_->type == XML_ELEMENT_NODE) {
- const QCString nodeName = QCString(reinterpret_cast<const char*>(node_->name)).upper();
+ const TQCString nodeName = TQCString(reinterpret_cast<const char*>(node_->name)).upper();
xmlElement* elem = reinterpret_cast<xmlElement*>(node_);
// to speed up things, check now for nodename
if(nodeName == "IMG" || nodeName == "SCRIPT" || nodeName == "LINK") {
for(xmlAttribute* attr = elem->attributes; attr; attr = reinterpret_cast<xmlAttribute*>(attr->next)) {
- QCString attrName = QCString(reinterpret_cast<const char*>(attr->name)).upper();
+ TQCString attrName = TQCString(reinterpret_cast<const char*>(attr->name)).upper();
if( (attrName == "SRC" && (nodeName == "IMG" || nodeName == "SCRIPT")) ||
(attrName == "HREF" && nodeName == "LINK")) {
diff --git a/src/translators/htmlexporter.h b/src/translators/htmlexporter.h
index be89bbf..421d09e 100644
--- a/src/translators/htmlexporter.h
+++ b/src/translators/htmlexporter.h
@@ -14,12 +14,12 @@
#ifndef HTMLEXPORTER_H
#define HTMLEXPORTER_H
-class QCheckBox;
+class TQCheckBox;
#include "exporter.h"
#include "../stringset.h"
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <libxml/xmlstring.h>
@@ -40,6 +40,7 @@ namespace Tellico {
*/
class HTMLExporter : public Exporter {
Q_OBJECT
+ TQ_OBJECT
public:
HTMLExporter();
@@ -48,25 +49,25 @@ public:
virtual bool exec();
virtual void reset();
- virtual QString formatString() const;
- virtual QString fileFilter() const;
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const;
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
virtual void readOptions(KConfig*);
virtual void saveOptions(KConfig*);
void setCollectionURL(const KURL& url) { m_collectionURL = url; m_links.clear(); }
- void setXSLTFile(const QString& filename);
+ void setXSLTFile(const TQString& filename);
void setPrintHeaders(bool printHeaders) { m_printHeaders = printHeaders; }
void setPrintGrouped(bool printGrouped) { m_printGrouped = printGrouped; }
void setMaxImageSize(int w, int h) { m_imageWidth = w; m_imageHeight = h; }
- void setGroupBy(const QStringList& groupBy) { m_groupBy = groupBy; }
- void setSortTitles(const QStringList& l)
+ void setGroupBy(const TQStringList& groupBy) { m_groupBy = groupBy; }
+ void setSortTitles(const TQStringList& l)
{ m_sort1 = l[0]; m_sort2 = l[1]; m_sort3 = l[2]; }
- void setColumns(const QStringList& columns) { m_columns = columns; }
+ void setColumns(const TQStringList& columns) { m_columns = columns; }
void setParseDOM(bool parseDOM) { m_parseDOM = parseDOM; reset(); }
- QString text();
+ TQString text();
public slots:
void slotCancel();
@@ -76,12 +77,12 @@ private:
void writeImages(Data::CollPtr coll);
bool writeEntryFiles();
KURL fileDir() const;
- QString fileDirName() const;
+ TQString fileDirName() const;
void parseDOM(_xmlNode* node);
- QString handleLink(const QString& link);
+ TQString handleLink(const TQString& link);
const xmlChar* handleLink(const xmlChar* link);
- QString analyzeInternalCSS(const QString& string);
+ TQString analyzeInternalCSS(const TQString& string);
const xmlChar* analyzeInternalCSS(const xmlChar* string);
bool copyFiles();
bool loadXSLTFile();
@@ -97,25 +98,25 @@ private:
int m_imageWidth;
int m_imageHeight;
- QWidget* m_widget;
- QCheckBox* m_checkPrintHeaders;
- QCheckBox* m_checkPrintGrouped;
- QCheckBox* m_checkExportEntryFiles;
- QCheckBox* m_checkExportImages;
+ TQWidget* m_widget;
+ TQCheckBox* m_checkPrintHeaders;
+ TQCheckBox* m_checkPrintGrouped;
+ TQCheckBox* m_checkExportEntryFiles;
+ TQCheckBox* m_checkExportImages;
KURL m_collectionURL;
- QString m_xsltFile;
- QString m_xsltFilePath;
- QString m_dataDir;
- QStringList m_groupBy;
- QString m_sort1;
- QString m_sort2;
- QString m_sort3;
- QStringList m_columns;
- QString m_entryXSLTFile;
+ TQString m_xsltFile;
+ TQString m_xsltFilePath;
+ TQString m_dataDir;
+ TQStringList m_groupBy;
+ TQString m_sort1;
+ TQString m_sort2;
+ TQString m_sort3;
+ TQStringList m_columns;
+ TQString m_entryXSLTFile;
KURL::List m_files;
- QMap<QString, QString> m_links;
+ TQMap<TQString, TQString> m_links;
StringSet m_copiedFiles;
};
diff --git a/src/translators/importer.h b/src/translators/importer.h
index 4df5ccb..d10e027 100644
--- a/src/translators/importer.h
+++ b/src/translators/importer.h
@@ -14,15 +14,15 @@
#ifndef IMPORTER_H
#define IMPORTER_H
-class QWidget;
+class TQWidget;
#include "../datavectors.h"
#include <klocale.h>
#include <kurl.h>
-#include <qobject.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstring.h>
namespace Tellico {
namespace Import {
@@ -39,20 +39,21 @@ namespace Tellico {
*
* @author Robby Stephenson
*/
-class Importer : public QObject {
+class Importer : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
- Importer() : QObject(), m_options(ImportProgress) {}
+ Importer() : TQObject(), m_options(ImportProgress) {}
/**
* The constructor should immediately load the contents of the file to be imported.
* Any warnings or errors should be added the the status message queue.
*
* @param url The URL of the file to import
*/
- Importer(const KURL& url) : QObject(), m_options(ImportProgress), m_urls(url) {}
- Importer(const KURL::List& urls) : QObject(), m_options(ImportProgress), m_urls(urls) {}
- Importer(const QString& text) : QObject(), m_options(ImportProgress), m_text(text) {}
+ Importer(const KURL& url) : TQObject(), m_options(ImportProgress), m_urls(url) {}
+ Importer(const KURL::List& urls) : TQObject(), m_options(ImportProgress), m_urls(urls) {}
+ Importer(const TQString& text) : TQObject(), m_options(ImportProgress), m_text(text) {}
/**
*/
virtual ~Importer() {}
@@ -71,14 +72,14 @@ public:
*
* @return The status message
*/
- const QString& statusMessage() const { return m_statusMsg; }
+ const TQString& statusMessage() const { return m_statusMsg; }
/**
* Returns a widget with the setting specific to this importer, or 0 if no
* options are needed.
*
* @return A pointer to the setting widget
*/
- virtual QWidget* widget(QWidget*, const char*) { return 0; }
+ virtual TQWidget* widget(TQWidget*, const char*) { return 0; }
/**
* Checks to see if the importer can return a collection of this type
*
@@ -90,14 +91,14 @@ public:
* Validate the import settings
*/
virtual bool validImport() const { return true; }
- virtual void setText(const QString& text) { m_text = text; }
+ virtual void setText(const TQString& text) { m_text = text; }
long options() const { return m_options; }
void setOptions(long options) { m_options = options; }
/**
* Returns a string useful for the ProgressManager
*/
- QString progressLabel() const {
- if(url().isEmpty()) return i18n("Loading data..."); else return i18n("Loading %1...").arg(url().fileName());
+ TQString progressLabel() const {
+ if(url().isEmpty()) return i18n("Loading data..."); else return i18n("Loading %1...").tqarg(url().fileName());
}
public slots:
@@ -114,21 +115,21 @@ protected:
*/
KURL url() const { return m_urls.isEmpty() ? KURL() : m_urls[0]; }
KURL::List urls() const { return m_urls; }
- QString text() const { return m_text; }
+ TQString text() const { return m_text; }
/**
* Adds a message to the status queue.
*
* @param msg A string containing a warning or error.
*/
- void setStatusMessage(const QString& msg) { if(!msg.isEmpty()) m_statusMsg += msg + QChar(' '); }
+ void setStatusMessage(const TQString& msg) { if(!msg.isEmpty()) m_statusMsg += msg + TQChar(' '); }
static const uint s_stepSize;
private:
long m_options;
KURL::List m_urls;
- QString m_text;
- QString m_statusMsg;
+ TQString m_text;
+ TQString m_statusMsg;
};
} // end namespace
diff --git a/src/translators/libcsv.c b/src/translators/libcsv.c
index 4e53f63..6cb39a0 100644
--- a/src/translators/libcsv.c
+++ b/src/translators/libcsv.c
@@ -114,7 +114,7 @@ csv_init(struct csv_parser **p, unsigned char options)
(*p)->entry_size = MEM_BLK_SIZE;
(*p)->status = 0;
(*p)->options = options;
- (*p)->quote_char = CSV_QUOTE;
+ (*p)->quote_char = CSV_TQUOTE;
(*p)->delim_char = CSV_COMMA;
(*p)->is_space = NULL;
(*p)->is_term = NULL;
diff --git a/src/translators/libcsv.h b/src/translators/libcsv.h
index 9058192..4830c15 100644
--- a/src/translators/libcsv.h
+++ b/src/translators/libcsv.h
@@ -46,7 +46,7 @@ Copyright (C) 2007 Robert Gamble
#define CSV_CR 0x0d
#define CSV_LF 0x0a
#define CSV_COMMA 0x2c
-#define CSV_QUOTE 0x22
+#define CSV_TQUOTE 0x22
struct csv_parser {
int pstate; /* Parser state */
diff --git a/src/translators/onixexporter.cpp b/src/translators/onixexporter.cpp
index 4479b2f..d58e9fe 100644
--- a/src/translators/onixexporter.cpp
+++ b/src/translators/onixexporter.cpp
@@ -29,27 +29,27 @@
#include <kconfig.h>
#include <klocale.h>
-#include <qdom.h>
-#include <qfile.h>
-#include <qdatetime.h>
-#include <qbuffer.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
-#include <qcheckbox.h>
-#include <qgroupbox.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqdatetime.h>
+#include <tqbuffer.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
+#include <tqcheckbox.h>
+#include <tqgroupbox.h>
using Tellico::Export::ONIXExporter;
ONIXExporter::ONIXExporter() : Tellico::Export::Exporter(),
m_handler(0),
- m_xsltFile(QString::fromLatin1("tellico2onix.xsl")),
+ m_xsltFile(TQString::tqfromLatin1("tellico2onix.xsl")),
m_includeImages(true),
m_widget(0) {
}
ONIXExporter::ONIXExporter(Data::CollPtr coll_) : Tellico::Export::Exporter(coll_),
m_handler(0),
- m_xsltFile(QString::fromLatin1("tellico2onix.xsl")),
+ m_xsltFile(TQString::tqfromLatin1("tellico2onix.xsl")),
m_includeImages(true),
m_widget(0) {
}
@@ -59,12 +59,12 @@ ONIXExporter::~ONIXExporter() {
m_handler = 0;
}
-QString ONIXExporter::formatString() const {
+TQString ONIXExporter::formatString() const {
return i18n("ONIX Archive");
}
-QString ONIXExporter::fileFilter() const {
- return i18n("*.zip|Zip Files (*.zip)") + QChar('\n') + i18n("*|All Files");
+TQString ONIXExporter::fileFilter() const {
+ return i18n("*.zip|Zip Files (*.zip)") + TQChar('\n') + i18n("*|All Files");
}
bool ONIXExporter::exec() {
@@ -73,26 +73,26 @@ bool ONIXExporter::exec() {
return false;
}
- QCString xml = text().utf8(); // encoded in utf-8
+ TQCString xml = text().utf8(); // encoded in utf-8
- QByteArray data;
- QBuffer buf(data);
+ TQByteArray data;
+ TQBuffer buf(data);
- KZip zip(&buf);
+ KZip zip(TQT_TQIODEVICE(&buf));
zip.open(IO_WriteOnly);
- zip.writeFile(QString::fromLatin1("onix.xml"), QString::null, QString::null, xml.length(), xml);
+ zip.writeFile(TQString::tqfromLatin1("onix.xml"), TQString(), TQString(), xml.length(), xml);
// use a dict for fast random access to keep track of which images were written to the file
if(m_includeImages) { // for now, we're ignoring (options() & Export::ExportImages)
- const QString cover = QString::fromLatin1("cover");
+ const TQString cover = TQString::tqfromLatin1("cover");
StringSet imageSet;
for(Data::EntryVec::ConstIterator it = entries().begin(); it != entries().end(); ++it) {
const Data::Image& img = ImageFactory::imageById(it->field(cover));
if(!img.isNull() && !imageSet.has(img.id())
&& (img.format() == "JPEG" || img.format() == "JPG" || img.format() == "GIF")) { /// onix only understands jpeg and gif
- QByteArray ba = img.byteArray();
- zip.writeFile(QString::fromLatin1("images/") + it->field(cover),
- QString::null, QString::null, ba.size(), ba);
+ TQByteArray ba = img.byteArray();
+ zip.writeFile(TQString::tqfromLatin1("images/") + it->field(cover),
+ TQString(), TQString(), ba.size(), ba);
imageSet.add(img.id());
}
}
@@ -103,17 +103,17 @@ bool ONIXExporter::exec() {
// return FileHandler::writeTextURL(url(), text(), options() & Export::ExportUTF8, options() & Export::ExportForce);
}
-QString ONIXExporter::text() {
- QString xsltfile = locate("appdata", m_xsltFile);
+TQString ONIXExporter::text() {
+ TQString xsltfile = locate("appdata", m_xsltFile);
if(xsltfile.isNull()) {
myDebug() << "ONIXExporter::text() - no xslt file for " << m_xsltFile << endl;
- return QString::null;
+ return TQString();
}
Data::CollPtr coll = collection();
if(!coll) {
myDebug() << "ONIXExporter::text() - no collection pointer!" << endl;
- return QString::null;
+ return TQString();
}
// notes about utf-8 encoding:
@@ -123,12 +123,12 @@ QString ONIXExporter::text() {
KURL u;
u.setPath(xsltfile);
// do NOT do namespace processing, it messes up the XSL declaration since
- // QDom thinks there are no elements in the Tellico namespace and as a result
+ // TQDom thinks there are no elements in the Tellico namespace and as a result
// removes the namespace declaration
- QDomDocument dom = FileHandler::readXMLFile(u, false);
+ TQDomDocument dom = FileHandler::readXMLFile(u, false);
if(dom.isNull()) {
myDebug() << "ONIXExporter::text() - error loading xslt file: " << xsltfile << endl;
- return QString::null;
+ return TQString();
}
// the stylesheet prints utf-8 by default, if using locale encoding, need
@@ -138,14 +138,14 @@ QString ONIXExporter::text() {
}
delete m_handler;
- m_handler = new XSLTHandler(dom, QFile::encodeName(xsltfile));
+ m_handler = new XSLTHandler(dom, TQFile::encodeName(xsltfile));
- QDateTime now = QDateTime::currentDateTime();
- m_handler->addStringParam("sentDate", now.toString(QString::fromLatin1("yyyyMMddhhmm")).utf8());
+ TQDateTime now = TQDateTime::tqcurrentDateTime();
+ m_handler->addStringParam("sentDate", now.toString(TQString::tqfromLatin1("yyyyMMddhhmm")).utf8());
m_handler->addStringParam("version", VERSION);
- GUI::CursorSaver cs(Qt::waitCursor);
+ GUI::CursorSaver cs(TQt::waitCursor);
// now grab the XML
TellicoXMLExporter exporter(coll);
@@ -153,11 +153,11 @@ QString ONIXExporter::text() {
exporter.setIncludeImages(false); // do not include images in XML
// yes, this should be in utf8, always
exporter.setOptions(options() | Export::ExportUTF8);
- QDomDocument output = exporter.exportXML();
+ TQDomDocument output = exporter.exportXML();
#if 0
- QFile f(QString::fromLatin1("/tmp/test.xml"));
+ TQFile f(TQString::tqfromLatin1("/tmp/test.xml"));
if(f.open(IO_WriteOnly)) {
- QTextStream t(&f);
+ TQTextStream t(&f);
t << output.toString();
}
f.close();
@@ -165,34 +165,34 @@ QString ONIXExporter::text() {
return m_handler->applyStylesheet(output.toString());
}
-QWidget* ONIXExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
- if(m_widget && m_widget->parent() == parent_) {
+TQWidget* ONIXExporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) {
+ if(m_widget && TQT_BASE_OBJECT(m_widget->tqparent()) == TQT_BASE_OBJECT(tqparent_)) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* box = new QGroupBox(1, Qt::Horizontal, i18n("ONIX Archive Options"), m_widget);
+ TQGroupBox* box = new TQGroupBox(1, Qt::Horizontal, i18n("ONIX Archive Options"), m_widget);
l->addWidget(box);
- m_checkIncludeImages = new QCheckBox(i18n("Include images in archive"), box);
+ m_checkIncludeImages = new TQCheckBox(i18n("Include images in archive"), box);
m_checkIncludeImages->setChecked(m_includeImages);
- QWhatsThis::add(m_checkIncludeImages, i18n("If checked, the images in the document will be included "
+ TQWhatsThis::add(m_checkIncludeImages, i18n("If checked, the images in the document will be included "
"in the zipped ONIX archive."));
return m_widget;
}
void ONIXExporter::readOptions(KConfig* config_) {
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_includeImages = group.readBoolEntry("Include Images", m_includeImages);
}
void ONIXExporter::saveOptions(KConfig* config_) {
m_includeImages = m_checkIncludeImages->isChecked();
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
group.writeEntry("Include Images", m_includeImages);
}
diff --git a/src/translators/onixexporter.h b/src/translators/onixexporter.h
index 19d52dd..fd947ae 100644
--- a/src/translators/onixexporter.h
+++ b/src/translators/onixexporter.h
@@ -14,7 +14,7 @@
#ifndef ONIXEXPORTER_H
#define ONIXEXPORTER_H
-class QCheckBox;
+class TQCheckBox;
#include "exporter.h"
@@ -30,6 +30,7 @@ namespace Tellico {
*/
class ONIXExporter : public Exporter {
Q_OBJECT
+ TQ_OBJECT
public:
ONIXExporter();
@@ -37,22 +38,22 @@ public:
~ONIXExporter();
virtual bool exec();
- virtual QString formatString() const;
- virtual QString fileFilter() const;
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const;
- virtual QWidget* widget(QWidget*, const char* name=0);
+ virtual TQWidget* widget(TQWidget*, const char* name=0);
virtual void readOptions(KConfig*);
virtual void saveOptions(KConfig*);
- QString text();
+ TQString text();
private:
XSLTHandler* m_handler;
- QString m_xsltFile;
+ TQString m_xsltFile;
bool m_includeImages;
- QWidget* m_widget;
- QCheckBox* m_checkIncludeImages;
+ TQWidget* m_widget;
+ TQCheckBox* m_checkIncludeImages;
};
} // end namespace
diff --git a/src/translators/pdfimporter.cpp b/src/translators/pdfimporter.cpp
index 2d59b33..09df294 100644
--- a/src/translators/pdfimporter.cpp
+++ b/src/translators/pdfimporter.cpp
@@ -48,7 +48,7 @@ bool PDFImporter::canImport(int type_) const {
}
Tellico::Data::CollPtr PDFImporter::collection() {
- QString xsltfile = ::locate("appdata", QString::fromLatin1("xmp2tellico.xsl"));
+ TQString xsltfile = ::locate("appdata", TQString::tqfromLatin1("xmp2tellico.xsl"));
if(xsltfile.isEmpty()) {
kdWarning() << "DropHandler::handleURL() - can not locate xmp2tellico.xsl" << endl;
return 0;
@@ -56,7 +56,7 @@ Tellico::Data::CollPtr PDFImporter::collection() {
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(urls().count());
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
const bool showProgress = options() & ImportProgress;
@@ -86,12 +86,12 @@ Tellico::Data::CollPtr PDFImporter::collection() {
Data::CollPtr newColl;
Data::EntryPtr entry;
- QString xmp = xmpHandler.extractXMP(ref->fileName());
+ TQString xmp = xmpHandler.extractXMP(ref->fileName());
// myDebug() << xmp << endl;
if(xmp.isEmpty()) {
setStatusMessage(i18n("Tellico was unable to read any metadata from the PDF file."));
} else {
- setStatusMessage(QString());
+ setStatusMessage(TQString());
Import::TellicoImporter importer(xsltHandler.applyStylesheet(xmp));
newColl = importer.collection();
@@ -100,7 +100,7 @@ Tellico::Data::CollPtr PDFImporter::collection() {
setStatusMessage(i18n("Tellico was unable to read any metadata from the PDF file."));
} else {
entry = newColl->entries().front();
- hasDOI |= !entry->field(QString::fromLatin1("doi")).isEmpty();
+ hasDOI |= !entry->field(TQString::tqfromLatin1("doi")).isEmpty();
}
}
@@ -119,30 +119,30 @@ Tellico::Data::CollPtr PDFImporter::collection() {
if(doc && !doc->isLocked()) {
// now the question is, do we overwrite XMP data with Poppler data?
// for now, let's say yes conditionally
- QString s = doc->getInfo(QString::fromLatin1("Title")).simplifyWhiteSpace();
+ TQString s = doc->getInfo(TQString::tqfromLatin1("Title")).simplifyWhiteSpace();
if(!s.isEmpty()) {
- entry->setField(QString::fromLatin1("title"), s);
+ entry->setField(TQString::tqfromLatin1("title"), s);
}
// author could be separated by commas, "and" or whatever
// we're not going to overwrite it
- if(entry->field(QString::fromLatin1("author")).isEmpty()) {
- QRegExp rx(QString::fromLatin1("\\s*(and|,|;)\\s*"));
- QStringList authors = QStringList::split(rx, doc->getInfo(QString::fromLatin1("Author")).simplifyWhiteSpace());
- entry->setField(QString::fromLatin1("author"), authors.join(QString::fromLatin1("; ")));
+ if(entry->field(TQString::tqfromLatin1("author")).isEmpty()) {
+ TQRegExp rx(TQString::tqfromLatin1("\\s*(and|,|;)\\s*"));
+ TQStringList authors = TQStringList::split(rx, doc->getInfo(TQString::tqfromLatin1("Author")).simplifyWhiteSpace());
+ entry->setField(TQString::tqfromLatin1("author"), authors.join(TQString::tqfromLatin1("; ")));
}
- s = doc->getInfo(QString::fromLatin1("Keywords")).simplifyWhiteSpace();
+ s = doc->getInfo(TQString::tqfromLatin1("Keywords")).simplifyWhiteSpace();
if(!s.isEmpty()) {
// keywords are also separated by semi-colons in poppler
- entry->setField(QString::fromLatin1("keyword"), s);
+ entry->setField(TQString::tqfromLatin1("keyword"), s);
}
// now parse the first page text and try to guess
Poppler::Page* page = doc->getPage(0);
if(page) {
// a null rectangle means get all text on page
- QString text = page->getText(Poppler::Rectangle());
+ TQString text = page->getText(Poppler::Rectangle());
// borrowed from Referencer
- QRegExp rx(QString::fromLatin1("(?:"
+ TQRegExp rx(TQString::tqfromLatin1("(?:"
"(?:[Dd][Oo][Ii]:? *)"
"|"
"(?:[Dd]igital *[Oo]bject *[Ii]dentifier:? *)"
@@ -155,26 +155,26 @@ Tellico::Data::CollPtr PDFImporter::collection() {
"[^\\s]+"
")"));
if(rx.search(text) > -1) {
- QString doi = rx.cap(1);
+ TQString doi = rx.cap(1);
myDebug() << "PDFImporter::collection() - in PDF file, found DOI: " << doi << endl;
- entry->setField(QString::fromLatin1("doi"), doi);
+ entry->setField(TQString::tqfromLatin1("doi"), doi);
hasDOI = true;
}
- rx = QRegExp(QString::fromLatin1("arXiv:"
+ rx = TQRegExp(TQString::tqfromLatin1("arXiv:"
"("
"[^\\/\\s]+"
"[\\/\\.]"
"[^\\s]+"
")"));
if(rx.search(text) > -1) {
- QString arxiv = rx.cap(1);
+ TQString arxiv = rx.cap(1);
myDebug() << "PDFImporter::collection() - in PDF file, found arxiv: " << arxiv << endl;
- if(entry->collection()->fieldByName(QString::fromLatin1("arxiv")) == 0) {
- Data::FieldPtr field = new Data::Field(QString::fromLatin1("arxiv"), i18n("arXiv ID"));
+ if(entry->collection()->fieldByName(TQString::tqfromLatin1("arxiv")) == 0) {
+ Data::FieldPtr field = new Data::Field(TQString::tqfromLatin1("arxiv"), i18n("arXiv ID"));
field->setCategory(i18n("Publishing"));
entry->collection()->addField(field);
}
- entry->setField(QString::fromLatin1("arxiv"), arxiv);
+ entry->setField(TQString::tqfromLatin1("arxiv"), arxiv);
hasArxiv = true;
}
@@ -186,22 +186,22 @@ Tellico::Data::CollPtr PDFImporter::collection() {
delete doc;
#endif
- entry->setField(QString::fromLatin1("url"), (*it).url());
+ entry->setField(TQString::tqfromLatin1("url"), (*it).url());
// always an article?
- entry->setField(QString::fromLatin1("entry-type"), QString::fromLatin1("article"));
+ entry->setField(TQString::tqfromLatin1("entry-type"), TQString::tqfromLatin1("article"));
- QPixmap pix = NetAccess::filePreview(ref->fileName(), PDF_FILE_PREVIEW_SIZE);
+ TQPixmap pix = NetAccess::filePreview(ref->fileName(), PDF_FILE_PREVIEW_SIZE);
delete ref; // removes temp file
if(!pix.isNull()) {
// is png best option?
- QString id = ImageFactory::addImage(pix, QString::fromLatin1("PNG"));
+ TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG"));
if(!id.isEmpty()) {
- Data::FieldPtr field = newColl->fieldByName(QString::fromLatin1("cover"));
+ Data::FieldPtr field = newColl->fieldByName(TQString::tqfromLatin1("cover"));
if(!field && !newColl->imageFields().isEmpty()) {
field = newColl->imageFields().front();
} else if(!field) {
- field = new Data::Field(QString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
+ field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
newColl->addField(field);
}
entry->setField(field, id);
@@ -227,13 +227,13 @@ Tellico::Data::CollPtr PDFImporter::collection() {
myDebug() << "looking for DOI" << endl;
Fetch::FetcherVec vec = Fetch::Manager::self()->createUpdateFetchers(coll->type(), Fetch::DOI);
if(vec.isEmpty()) {
- GUI::CursorSaver cs(Qt::arrowCursor);
+ GUI::CursorSaver cs(TQt::arrowCursor);
KMessageBox::information(Kernel::self()->widget(),
i18n("Tellico is able to download information about entries with a DOI from "
"CrossRef.org. However, you must create an CrossRef account and add a new "
"data source with your account information."),
- QString::null,
- QString::fromLatin1("CrossRefSourceNeeded"));
+ TQString(),
+ TQString::tqfromLatin1("CrossRefSourceNeeded"));
} else {
Data::EntryVec entries = coll->entries();
for(Fetch::FetcherVec::Iterator fetcher = vec.begin(); fetcher != vec.end(); ++fetcher) {
@@ -263,8 +263,8 @@ Tellico::Data::CollPtr PDFImporter::collection() {
for(Data::EntryVecIt entry = entries.begin(); entry != entries.end(); ++entry) {
if(entry->title().isEmpty()) {
// use file name
- KURL u = entry->field(QString::fromLatin1("url"));
- entry->setField(QString::fromLatin1("title"), u.fileName());
+ KURL u = entry->field(TQString::tqfromLatin1("url"));
+ entry->setField(TQString::tqfromLatin1("title"), u.fileName());
}
}
diff --git a/src/translators/pdfimporter.h b/src/translators/pdfimporter.h
index 87da58e..b16136d 100644
--- a/src/translators/pdfimporter.h
+++ b/src/translators/pdfimporter.h
@@ -21,6 +21,7 @@ namespace Tellico {
class PDFImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
PDFImporter(const KURL::List& urls);
diff --git a/src/translators/pilotdb/pilotdb.cpp b/src/translators/pilotdb/pilotdb.cpp
index d7779e4..b42cb6a 100644
--- a/src/translators/pilotdb/pilotdb.cpp
+++ b/src/translators/pilotdb/pilotdb.cpp
@@ -17,7 +17,7 @@
#include <kdebug.h>
-#include <qbuffer.h>
+#include <tqbuffer.h>
using namespace PalmLib;
using Tellico::Export::PilotDB;
@@ -42,8 +42,8 @@ PilotDB::~PilotDB() {
}
}
-QByteArray PilotDB::data() {
- QBuffer b;
+TQByteArray PilotDB::data() {
+ TQBuffer b;
b.open(IO_WriteOnly);
pi_char_t buf[PI_HDR_SIZE];
@@ -53,7 +53,7 @@ QByteArray PilotDB::data() {
for(int i=0; i<32; ++i) {
buf[i] = 0;
}
- memcpy(buf, name().c_str(), QMIN(31, name().length()));
+ memcpy(buf, name().c_str(), TQMIN(31, name().length()));
set_short(buf + 32, flags());
set_short(buf + 34, version());
set_long(buf + 36, creation_time());
diff --git a/src/translators/pilotdb/pilotdb.h b/src/translators/pilotdb/pilotdb.h
index dd21c7b..871b6bb 100644
--- a/src/translators/pilotdb/pilotdb.h
+++ b/src/translators/pilotdb/pilotdb.h
@@ -23,7 +23,7 @@
#include "libpalm/Database.h"
#include "libflatfile/Field.h"
-#include <qcstring.h>
+#include <tqcstring.h>
namespace Tellico {
namespace Export {
@@ -36,7 +36,7 @@ public:
PilotDB();
~PilotDB();
- QByteArray data();
+ TQByteArray data();
/**
* Return the total number of records/resources in this database.
diff --git a/src/translators/pilotdb/strop.cpp b/src/translators/pilotdb/strop.cpp
index b8c7f55..3b0deeb 100644
--- a/src/translators/pilotdb/strop.cpp
+++ b/src/translators/pilotdb/strop.cpp
@@ -167,7 +167,7 @@ std::string StrOps::strip_front(const std::string& str,const std::string& what)
StrOps::string_list_t StrOps::csv_to_array(const std::string& str, char delim, bool quoted_string)
{
- enum { STATE_NORMAL, STATE_QUOTES } state;
+ enum { STATE_NORMAL, STATE_TQUOTES } state;
StrOps::string_list_t result;
std::string elem;
@@ -176,7 +176,7 @@ StrOps::string_list_t StrOps::csv_to_array(const std::string& str, char delim, b
switch (state) {
case STATE_NORMAL:
if (quoted_string && *p == '"') {
- state = STATE_QUOTES;
+ state = STATE_TQUOTES;
} else if (*p == delim) {
result.push_back(elem);
elem = "";
@@ -185,7 +185,7 @@ StrOps::string_list_t StrOps::csv_to_array(const std::string& str, char delim, b
}
break;
- case STATE_QUOTES:
+ case STATE_TQUOTES:
if (quoted_string && *p == '"') {
if ((p + 1) != str.end() && *(p+1) == '"') {
++p;
@@ -204,7 +204,7 @@ StrOps::string_list_t StrOps::csv_to_array(const std::string& str, char delim, b
case STATE_NORMAL:
result.push_back(elem);
break;
- case STATE_QUOTES:
+ case STATE_TQUOTES:
kdDebug() << "unterminated quotes" << endl;
break;
}
@@ -216,8 +216,8 @@ StrOps::string_list_t
StrOps::str_to_array(const std::string& str, const std::string& delim,
bool multiple_delim, bool handle_comments)
{
- enum { STATE_NORMAL, STATE_COMMENT, STATE_QUOTE_DOUBLE, STATE_QUOTE_SINGLE,
- STATE_BACKSLASH, STATE_BACKSLASH_DOUBLEQUOTE } state;
+ enum { STATE_NORMAL, STATE_COMMENT, STATE_TQUOTE_DOUBLE, STATE_TQUOTE_SINGLE,
+ STATE_BACKSLASH, STATE_BACKSLASH_DOUBLETQUOTE } state;
StrOps::string_list_t result;
std::string elem;
@@ -226,9 +226,9 @@ StrOps::str_to_array(const std::string& str, const std::string& delim,
switch (state) {
case STATE_NORMAL:
if (*p == '"') {
- state = STATE_QUOTE_DOUBLE;
+ state = STATE_TQUOTE_DOUBLE;
} else if (*p == '\'') {
- state = STATE_QUOTE_SINGLE;
+ state = STATE_TQUOTE_SINGLE;
} else if (std::find(delim.begin(), delim.end(), *p) != delim.end()) {
if (multiple_delim) {
++p;
@@ -252,16 +252,16 @@ StrOps::str_to_array(const std::string& str, const std::string& delim,
case STATE_COMMENT:
break;
- case STATE_QUOTE_DOUBLE:
+ case STATE_TQUOTE_DOUBLE:
if (*p == '"')
state = STATE_NORMAL;
else if (*p == '\\')
- state = STATE_BACKSLASH_DOUBLEQUOTE;
+ state = STATE_BACKSLASH_DOUBLETQUOTE;
else
elem += *p;
break;
- case STATE_QUOTE_SINGLE:
+ case STATE_TQUOTE_SINGLE:
if (*p == '\'')
state = STATE_NORMAL;
else
@@ -273,7 +273,7 @@ StrOps::str_to_array(const std::string& str, const std::string& delim,
state = STATE_NORMAL;
break;
- case STATE_BACKSLASH_DOUBLEQUOTE:
+ case STATE_BACKSLASH_DOUBLETQUOTE:
switch (*p) {
case '\\':
elem += '\\';
@@ -329,7 +329,7 @@ StrOps::str_to_array(const std::string& str, const std::string& delim,
}
// Escape is done. Go back to the normal double quote state.
- state = STATE_QUOTE_DOUBLE;
+ state = STATE_TQUOTE_DOUBLE;
break;
}
}
@@ -339,16 +339,16 @@ StrOps::str_to_array(const std::string& str, const std::string& delim,
result.push_back(elem);
break;
- case STATE_QUOTE_DOUBLE:
+ case STATE_TQUOTE_DOUBLE:
kdDebug() << "unterminated double quotes" << endl;
break;
- case STATE_QUOTE_SINGLE:
+ case STATE_TQUOTE_SINGLE:
kdDebug() << "unterminated single quotes" << endl;
break;
case STATE_BACKSLASH:
- case STATE_BACKSLASH_DOUBLEQUOTE:
+ case STATE_BACKSLASH_DOUBLETQUOTE:
kdDebug() << "an escape character must follow a backslash" << endl;
break;
diff --git a/src/translators/pilotdbexporter.cpp b/src/translators/pilotdbexporter.cpp
index b9e7367..03115e9 100644
--- a/src/translators/pilotdbexporter.cpp
+++ b/src/translators/pilotdbexporter.cpp
@@ -24,12 +24,12 @@
#include <kglobal.h>
#include <kcharsets.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qcheckbox.h>
-#include <qwhatsthis.h>
-#include <qtextcodec.h>
-#include <qdatetime.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqcheckbox.h>
+#include <tqwhatsthis.h>
+#include <tqtextcodec.h>
+#include <tqdatetime.h>
using Tellico::Export::PilotDBExporter;
@@ -39,12 +39,12 @@ PilotDBExporter::PilotDBExporter() : Tellico::Export::Exporter(),
m_checkBackup(0) {
}
-QString PilotDBExporter::formatString() const {
+TQString PilotDBExporter::formatString() const {
return i18n("PilotDB");
}
-QString PilotDBExporter::fileFilter() const {
- return i18n("*.pdb|Pilot Database Files (*.pdb)") + QChar('\n') + i18n("*|All Files");
+TQString PilotDBExporter::fileFilter() const {
+ return i18n("*.pdb|Pilot Database Files (*.pdb)") + TQChar('\n') + i18n("*|All Files");
}
bool PilotDBExporter::exec() {
@@ -55,14 +55,14 @@ bool PilotDBExporter::exec() {
// This is something of a hidden preference cause I don't want to put it in the GUI right now
// Latin1 by default
- QTextCodec* codec = 0;
+ TQTextCodec* codec = 0;
{
// Latin1 is default
- KConfigGroup group(KGlobal::config(), QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(KGlobal::config(), TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
codec = KGlobal::charsets()->codecForName(group.readEntry("Charset"));
}
if(!codec) {
- kdWarning() << "PilotDBExporter::exec() - no QTextCodec!" << endl;
+ kdWarning() << "PilotDBExporter::exec() - no TQTextCodec!" << endl;
return false;
#ifndef NDEBUG
} else {
@@ -89,7 +89,7 @@ bool PilotDBExporter::exec() {
case Data::Field::Choice:
// the charSeparator is actually defined in DB.h
db.appendField(codec->fromUnicode(fIt->title()).data(), PalmLib::FlatFile::Field::LIST,
- codec->fromUnicode(fIt->allowed().join(QChar('/'))).data());
+ codec->fromUnicode(fIt->allowed().join(TQChar('/'))).data());
outputFields.append(fIt);
break;
@@ -141,9 +141,9 @@ bool PilotDBExporter::exec() {
if(m_columns.count() > 0) {
PalmLib::FlatFile::ListView lv;
lv.name = codec->fromUnicode(i18n("View Columns")).data();
- for(QStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) {
+ for(TQStringList::ConstIterator it = m_columns.begin(); it != m_columns.end(); ++it) {
PalmLib::FlatFile::ListViewColumn col;
- col.field = coll->fieldTitles().findIndex(*it);
+ col.field = coll->fieldTitles().tqfindIndex(*it);
lv.push_back(col);
}
db.appendListView(lv);
@@ -153,11 +153,11 @@ bool PilotDBExporter::exec() {
Data::FieldVec::ConstIterator fIt, end = outputFields.constEnd();
bool format = options() & Export::ExportFormatted;
- QRegExp br(QString::fromLatin1("<br/?>"), false /*case-sensitive*/);
- QRegExp tags(QString::fromLatin1("<.*>"));
+ TQRegExp br(TQString::tqfromLatin1("<br/?>"), false /*case-sensitive*/);
+ TQRegExp tags(TQString::tqfromLatin1("<.*>"));
tags.setMinimal(true);
- QString value;
+ TQString value;
for(Data::EntryVec::ConstIterator entryIt = entries().begin(); entryIt != entries().end(); ++entryIt) {
PalmLib::FlatFile::Record record;
unsigned i = 0;
@@ -165,11 +165,11 @@ bool PilotDBExporter::exec() {
value = entryIt->field(fIt->name(), format);
if(fIt->type() == Data::Field::Date) {
- QStringList s = QStringList::split('-', value, true);
+ TQStringList s = TQStringList::split('-', value, true);
bool ok = true;
- int y = s.count() > 0 ? s[0].toInt(&ok) : QDate::currentDate().year();
+ int y = s.count() > 0 ? s[0].toInt(&ok) : TQDate::tqcurrentDate().year();
if(!ok) {
- y = QDate::currentDate().year();
+ y = TQDate::tqcurrentDate().year();
}
int m = s.count() > 1 ? s[1].toInt(&ok) : 1;
if(!ok) {
@@ -179,11 +179,11 @@ bool PilotDBExporter::exec() {
if(!ok) {
d = 1;
}
- QDate date(y, m, d);
- value = date.toString(QString::fromLatin1("yyyy/MM/dd"));
+ TQDate date(y, m, d);
+ value = date.toString(TQString::tqfromLatin1("yyyy/MM/dd"));
} else if(fIt->type() == Data::Field::Para) {
- value.replace(br, QChar('\n'));
- value.replace(tags, QString::null);
+ value.tqreplace(br, TQChar('\n'));
+ value.tqreplace(tags, TQString());
}
// the number of fields in the record must match the number of fields in the database
record.appendField(PilotDB::string2field(db.field_type(i),
@@ -199,32 +199,32 @@ bool PilotDBExporter::exec() {
return FileHandler::writeDataURL(url(), pdb.data(), options() & Export::ExportForce);
}
-QWidget* PilotDBExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
- if(m_widget && m_widget->parent() == parent_) {
+TQWidget* PilotDBExporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) {
+ if(m_widget && TQT_BASE_OBJECT(m_widget->tqparent()) == TQT_BASE_OBJECT(tqparent_)) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* box = new QGroupBox(1, Qt::Horizontal, i18n("PilotDB Options"), m_widget);
+ TQGroupBox* box = new TQGroupBox(1, Qt::Horizontal, i18n("PilotDB Options"), m_widget);
l->addWidget(box);
- m_checkBackup = new QCheckBox(i18n("Set PDA backup flag for database"), box);
+ m_checkBackup = new TQCheckBox(i18n("Set PDA backup flag for database"), box);
m_checkBackup->setChecked(m_backup);
- QWhatsThis::add(m_checkBackup, i18n("Set PDA backup flag for database"));
+ TQWhatsThis::add(m_checkBackup, i18n("Set PDA backup flag for database"));
l->addStretch(1);
return m_widget;
}
void PilotDBExporter::readOptions(KConfig* config_) {
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_backup = group.readBoolEntry("Backup", m_backup);
}
void PilotDBExporter::saveOptions(KConfig* config_) {
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_backup = m_checkBackup->isChecked();
group.writeEntry("Backup", m_backup);
}
diff --git a/src/translators/pilotdbexporter.h b/src/translators/pilotdbexporter.h
index 13d603b..8b3e4b2 100644
--- a/src/translators/pilotdbexporter.h
+++ b/src/translators/pilotdbexporter.h
@@ -14,11 +14,11 @@
#ifndef PILOTDBEXPORTER_H
#define PILOTDBEXPORTER_H
-class QCheckBox;
+class TQCheckBox;
#include "exporter.h"
-#include <qstringlist.h>
+#include <tqstringlist.h>
namespace Tellico {
namespace Export {
@@ -28,26 +28,27 @@ namespace Tellico {
*/
class PilotDBExporter : public Exporter {
Q_OBJECT
+ TQ_OBJECT
public:
PilotDBExporter();
virtual bool exec();
- virtual QString formatString() const;
- virtual QString fileFilter() const;
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const;
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
virtual void readOptions(KConfig* cfg);
virtual void saveOptions(KConfig* cfg);
- void setColumns(const QStringList& columns) { m_columns = columns; }
+ void setColumns(const TQStringList& columns) { m_columns = columns; }
private:
bool m_backup;
- QWidget* m_widget;
- QCheckBox* m_checkBackup;
- QStringList m_columns;
+ TQWidget* m_widget;
+ TQCheckBox* m_checkBackup;
+ TQStringList m_columns;
};
} // end namespace
diff --git a/src/translators/referencerimporter.cpp b/src/translators/referencerimporter.cpp
index 32ba251..332bf8c 100644
--- a/src/translators/referencerimporter.cpp
+++ b/src/translators/referencerimporter.cpp
@@ -21,7 +21,7 @@
using Tellico::Import::ReferencerImporter;
ReferencerImporter::ReferencerImporter(const KURL& url_) : XSLTImporter(url_) {
- QString xsltFile = locate("appdata", QString::fromLatin1("referencer2tellico.xsl"));
+ TQString xsltFile = locate("appdata", TQString::tqfromLatin1("referencer2tellico.xsl"));
if(!xsltFile.isEmpty()) {
KURL u;
u.setPath(xsltFile);
@@ -41,25 +41,25 @@ Tellico::Data::CollPtr ReferencerImporter::collection() {
return 0;
}
- Data::FieldPtr field = coll->fieldByName(QString::fromLatin1("cover"));
+ Data::FieldPtr field = coll->fieldByName(TQString::tqfromLatin1("cover"));
if(!field && !coll->imageFields().isEmpty()) {
field = coll->imageFields().front();
} else if(!field) {
- field = new Data::Field(QString::fromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
+ field = new Data::Field(TQString::tqfromLatin1("cover"), i18n("Front Cover"), Data::Field::Image);
coll->addField(field);
}
Data::EntryVec entries = coll->entries();
for(Data::EntryVecIt entry = entries.begin(); entry != entries.end(); ++entry) {
- QString url = entry->field(QString::fromLatin1("url"));
+ TQString url = entry->field(TQString::tqfromLatin1("url"));
if(url.isEmpty()) {
continue;
}
- QPixmap pix = NetAccess::filePreview(url);
+ TQPixmap pix = NetAccess::filePreview(url);
if(pix.isNull()) {
continue;
}
- QString id = ImageFactory::addImage(pix, QString::fromLatin1("PNG"));
+ TQString id = ImageFactory::addImage(pix, TQString::tqfromLatin1("PNG"));
if(id.isEmpty()) {
continue;
}
diff --git a/src/translators/referencerimporter.h b/src/translators/referencerimporter.h
index 65cc3a0..9105bd1 100644
--- a/src/translators/referencerimporter.h
+++ b/src/translators/referencerimporter.h
@@ -25,6 +25,7 @@ namespace Tellico {
*/
class ReferencerImporter : public XSLTImporter {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -36,7 +37,7 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget*, const char*) { return 0; }
+ virtual TQWidget* widget(TQWidget*, const char*) { return 0; }
virtual bool canImport(int type) const;
private:
diff --git a/src/translators/risimporter.cpp b/src/translators/risimporter.cpp
index 0420f66..e0a75a3 100644
--- a/src/translators/risimporter.cpp
+++ b/src/translators/risimporter.cpp
@@ -24,89 +24,89 @@
#include <kapplication.h>
-#include <qdict.h>
-#include <qregexp.h>
-#include <qmap.h>
+#include <tqdict.h>
+#include <tqregexp.h>
+#include <tqmap.h>
using Tellico::Import::RISImporter;
-QMap<QString, QString>* RISImporter::s_tagMap = 0;
-QMap<QString, QString>* RISImporter::s_typeMap = 0;
+TQMap<TQString, TQString>* RISImporter::s_tagMap = 0;
+TQMap<TQString, TQString>* RISImporter::s_typeMap = 0;
// static
void RISImporter::initTagMap() {
if(!s_tagMap) {
- s_tagMap = new QMap<QString, QString>();
+ s_tagMap = new TQMap<TQString, TQString>();
// BT is special and is handled separately
- s_tagMap->insert(QString::fromLatin1("TY"), QString::fromLatin1("entry-type"));
- s_tagMap->insert(QString::fromLatin1("ID"), QString::fromLatin1("bibtex-key"));
- s_tagMap->insert(QString::fromLatin1("T1"), QString::fromLatin1("title"));
- s_tagMap->insert(QString::fromLatin1("TI"), QString::fromLatin1("title"));
- s_tagMap->insert(QString::fromLatin1("T2"), QString::fromLatin1("booktitle"));
- s_tagMap->insert(QString::fromLatin1("A1"), QString::fromLatin1("author"));
- s_tagMap->insert(QString::fromLatin1("AU"), QString::fromLatin1("author"));
- s_tagMap->insert(QString::fromLatin1("ED"), QString::fromLatin1("editor"));
- s_tagMap->insert(QString::fromLatin1("YR"), QString::fromLatin1("year"));
- s_tagMap->insert(QString::fromLatin1("PY"), QString::fromLatin1("year"));
- s_tagMap->insert(QString::fromLatin1("N1"), QString::fromLatin1("note"));
- s_tagMap->insert(QString::fromLatin1("AB"), QString::fromLatin1("abstract")); // should be note?
- s_tagMap->insert(QString::fromLatin1("N2"), QString::fromLatin1("abstract"));
- s_tagMap->insert(QString::fromLatin1("KW"), QString::fromLatin1("keyword"));
- s_tagMap->insert(QString::fromLatin1("JF"), QString::fromLatin1("journal"));
- s_tagMap->insert(QString::fromLatin1("JO"), QString::fromLatin1("journal"));
- s_tagMap->insert(QString::fromLatin1("JA"), QString::fromLatin1("journal"));
- s_tagMap->insert(QString::fromLatin1("VL"), QString::fromLatin1("volume"));
- s_tagMap->insert(QString::fromLatin1("IS"), QString::fromLatin1("number"));
- s_tagMap->insert(QString::fromLatin1("PB"), QString::fromLatin1("publisher"));
- s_tagMap->insert(QString::fromLatin1("SN"), QString::fromLatin1("isbn"));
- s_tagMap->insert(QString::fromLatin1("AD"), QString::fromLatin1("address"));
- s_tagMap->insert(QString::fromLatin1("CY"), QString::fromLatin1("address"));
- s_tagMap->insert(QString::fromLatin1("UR"), QString::fromLatin1("url"));
- s_tagMap->insert(QString::fromLatin1("L1"), QString::fromLatin1("pdf"));
- s_tagMap->insert(QString::fromLatin1("T3"), QString::fromLatin1("series"));
- s_tagMap->insert(QString::fromLatin1("EP"), QString::fromLatin1("pages"));
+ s_tagMap->insert(TQString::tqfromLatin1("TY"), TQString::tqfromLatin1("entry-type"));
+ s_tagMap->insert(TQString::tqfromLatin1("ID"), TQString::tqfromLatin1("bibtex-key"));
+ s_tagMap->insert(TQString::tqfromLatin1("T1"), TQString::tqfromLatin1("title"));
+ s_tagMap->insert(TQString::tqfromLatin1("TI"), TQString::tqfromLatin1("title"));
+ s_tagMap->insert(TQString::tqfromLatin1("T2"), TQString::tqfromLatin1("booktitle"));
+ s_tagMap->insert(TQString::tqfromLatin1("A1"), TQString::tqfromLatin1("author"));
+ s_tagMap->insert(TQString::tqfromLatin1("AU"), TQString::tqfromLatin1("author"));
+ s_tagMap->insert(TQString::tqfromLatin1("ED"), TQString::tqfromLatin1("editor"));
+ s_tagMap->insert(TQString::tqfromLatin1("YR"), TQString::tqfromLatin1("year"));
+ s_tagMap->insert(TQString::tqfromLatin1("PY"), TQString::tqfromLatin1("year"));
+ s_tagMap->insert(TQString::tqfromLatin1("N1"), TQString::tqfromLatin1("note"));
+ s_tagMap->insert(TQString::tqfromLatin1("AB"), TQString::tqfromLatin1("abstract")); // should be note?
+ s_tagMap->insert(TQString::tqfromLatin1("N2"), TQString::tqfromLatin1("abstract"));
+ s_tagMap->insert(TQString::tqfromLatin1("KW"), TQString::tqfromLatin1("keyword"));
+ s_tagMap->insert(TQString::tqfromLatin1("JF"), TQString::tqfromLatin1("journal"));
+ s_tagMap->insert(TQString::tqfromLatin1("JO"), TQString::tqfromLatin1("journal"));
+ s_tagMap->insert(TQString::tqfromLatin1("JA"), TQString::tqfromLatin1("journal"));
+ s_tagMap->insert(TQString::tqfromLatin1("VL"), TQString::tqfromLatin1("volume"));
+ s_tagMap->insert(TQString::tqfromLatin1("IS"), TQString::tqfromLatin1("number"));
+ s_tagMap->insert(TQString::tqfromLatin1("PB"), TQString::tqfromLatin1("publisher"));
+ s_tagMap->insert(TQString::tqfromLatin1("SN"), TQString::tqfromLatin1("isbn"));
+ s_tagMap->insert(TQString::tqfromLatin1("AD"), TQString::tqfromLatin1("address"));
+ s_tagMap->insert(TQString::tqfromLatin1("CY"), TQString::tqfromLatin1("address"));
+ s_tagMap->insert(TQString::tqfromLatin1("UR"), TQString::tqfromLatin1("url"));
+ s_tagMap->insert(TQString::tqfromLatin1("L1"), TQString::tqfromLatin1("pdf"));
+ s_tagMap->insert(TQString::tqfromLatin1("T3"), TQString::tqfromLatin1("series"));
+ s_tagMap->insert(TQString::tqfromLatin1("EP"), TQString::tqfromLatin1("pages"));
}
}
// static
void RISImporter::initTypeMap() {
if(!s_typeMap) {
- s_typeMap = new QMap<QString, QString>();
+ s_typeMap = new TQMap<TQString, TQString>();
// leave capitalized, except for bibtex types
- s_typeMap->insert(QString::fromLatin1("ABST"), QString::fromLatin1("Abstract"));
- s_typeMap->insert(QString::fromLatin1("ADVS"), QString::fromLatin1("Audiovisual material"));
- s_typeMap->insert(QString::fromLatin1("ART"), QString::fromLatin1("Art Work"));
- s_typeMap->insert(QString::fromLatin1("BILL"), QString::fromLatin1("Bill/Resolution"));
- s_typeMap->insert(QString::fromLatin1("BOOK"), QString::fromLatin1("book")); // bibtex
- s_typeMap->insert(QString::fromLatin1("CASE"), QString::fromLatin1("Case"));
- s_typeMap->insert(QString::fromLatin1("CHAP"), QString::fromLatin1("inbook")); // == "inbook" ?
- s_typeMap->insert(QString::fromLatin1("COMP"), QString::fromLatin1("Computer program"));
- s_typeMap->insert(QString::fromLatin1("CONF"), QString::fromLatin1("inproceedings")); // == "conference" ?
- s_typeMap->insert(QString::fromLatin1("CTLG"), QString::fromLatin1("Catalog"));
- s_typeMap->insert(QString::fromLatin1("DATA"), QString::fromLatin1("Data file"));
- s_typeMap->insert(QString::fromLatin1("ELEC"), QString::fromLatin1("Electronic Citation"));
- s_typeMap->insert(QString::fromLatin1("GEN"), QString::fromLatin1("Generic"));
- s_typeMap->insert(QString::fromLatin1("HEAR"), QString::fromLatin1("Hearing"));
- s_typeMap->insert(QString::fromLatin1("ICOMM"), QString::fromLatin1("Internet Communication"));
- s_typeMap->insert(QString::fromLatin1("INPR"), QString::fromLatin1("In Press"));
- s_typeMap->insert(QString::fromLatin1("JFULL"), QString::fromLatin1("Journal (full)")); // = "periodical" ?
- s_typeMap->insert(QString::fromLatin1("JOUR"), QString::fromLatin1("article")); // "Journal"
- s_typeMap->insert(QString::fromLatin1("MAP"), QString::fromLatin1("Map"));
- s_typeMap->insert(QString::fromLatin1("MGZN"), QString::fromLatin1("article")); // bibtex
- s_typeMap->insert(QString::fromLatin1("MPCT"), QString::fromLatin1("Motion picture"));
- s_typeMap->insert(QString::fromLatin1("MUSIC"), QString::fromLatin1("Music score"));
- s_typeMap->insert(QString::fromLatin1("NEWS"), QString::fromLatin1("Newspaper"));
- s_typeMap->insert(QString::fromLatin1("PAMP"), QString::fromLatin1("Pamphlet")); // = "booklet" ?
- s_typeMap->insert(QString::fromLatin1("PAT"), QString::fromLatin1("Patent"));
- s_typeMap->insert(QString::fromLatin1("PCOMM"), QString::fromLatin1("Personal communication"));
- s_typeMap->insert(QString::fromLatin1("RPRT"), QString::fromLatin1("Report")); // = "techreport" ?
- s_typeMap->insert(QString::fromLatin1("SER"), QString::fromLatin1("Serial (BookMonograph)"));
- s_typeMap->insert(QString::fromLatin1("SLIDE"), QString::fromLatin1("Slide"));
- s_typeMap->insert(QString::fromLatin1("SOUND"), QString::fromLatin1("Sound recording"));
- s_typeMap->insert(QString::fromLatin1("STAT"), QString::fromLatin1("Statute"));
- s_typeMap->insert(QString::fromLatin1("THES"), QString::fromLatin1("phdthesis")); // "mastersthesis" ?
- s_typeMap->insert(QString::fromLatin1("UNBILL"), QString::fromLatin1("Unenacted bill/resolution"));
- s_typeMap->insert(QString::fromLatin1("UNPB"), QString::fromLatin1("unpublished")); // bibtex
- s_typeMap->insert(QString::fromLatin1("VIDEO"), QString::fromLatin1("Video recording"));
+ s_typeMap->insert(TQString::tqfromLatin1("ABST"), TQString::tqfromLatin1("Abstract"));
+ s_typeMap->insert(TQString::tqfromLatin1("ADVS"), TQString::tqfromLatin1("Audiovisual material"));
+ s_typeMap->insert(TQString::tqfromLatin1("ART"), TQString::tqfromLatin1("Art Work"));
+ s_typeMap->insert(TQString::tqfromLatin1("BILL"), TQString::tqfromLatin1("Bill/Resolution"));
+ s_typeMap->insert(TQString::tqfromLatin1("BOOK"), TQString::tqfromLatin1("book")); // bibtex
+ s_typeMap->insert(TQString::tqfromLatin1("CASE"), TQString::tqfromLatin1("Case"));
+ s_typeMap->insert(TQString::tqfromLatin1("CHAP"), TQString::tqfromLatin1("inbook")); // == "inbook" ?
+ s_typeMap->insert(TQString::tqfromLatin1("COMP"), TQString::tqfromLatin1("Computer program"));
+ s_typeMap->insert(TQString::tqfromLatin1("CONF"), TQString::tqfromLatin1("inproceedings")); // == "conference" ?
+ s_typeMap->insert(TQString::tqfromLatin1("CTLG"), TQString::tqfromLatin1("Catalog"));
+ s_typeMap->insert(TQString::tqfromLatin1("DATA"), TQString::tqfromLatin1("Data file"));
+ s_typeMap->insert(TQString::tqfromLatin1("ELEC"), TQString::tqfromLatin1("Electronic Citation"));
+ s_typeMap->insert(TQString::tqfromLatin1("GEN"), TQString::tqfromLatin1("Generic"));
+ s_typeMap->insert(TQString::tqfromLatin1("HEAR"), TQString::tqfromLatin1("Hearing"));
+ s_typeMap->insert(TQString::tqfromLatin1("ICOMM"), TQString::tqfromLatin1("Internet Communication"));
+ s_typeMap->insert(TQString::tqfromLatin1("INPR"), TQString::tqfromLatin1("In Press"));
+ s_typeMap->insert(TQString::tqfromLatin1("JFULL"), TQString::tqfromLatin1("Journal (full)")); // = "periodical" ?
+ s_typeMap->insert(TQString::tqfromLatin1("JOUR"), TQString::tqfromLatin1("article")); // "Journal"
+ s_typeMap->insert(TQString::tqfromLatin1("MAP"), TQString::tqfromLatin1("Map"));
+ s_typeMap->insert(TQString::tqfromLatin1("MGZN"), TQString::tqfromLatin1("article")); // bibtex
+ s_typeMap->insert(TQString::tqfromLatin1("MPCT"), TQString::tqfromLatin1("Motion picture"));
+ s_typeMap->insert(TQString::tqfromLatin1("MUSIC"), TQString::tqfromLatin1("Music score"));
+ s_typeMap->insert(TQString::tqfromLatin1("NEWS"), TQString::tqfromLatin1("Newspaper"));
+ s_typeMap->insert(TQString::tqfromLatin1("PAMP"), TQString::tqfromLatin1("Pamphlet")); // = "booklet" ?
+ s_typeMap->insert(TQString::tqfromLatin1("PAT"), TQString::tqfromLatin1("Patent"));
+ s_typeMap->insert(TQString::tqfromLatin1("PCOMM"), TQString::tqfromLatin1("Personal communication"));
+ s_typeMap->insert(TQString::tqfromLatin1("RPRT"), TQString::tqfromLatin1("Report")); // = "techreport" ?
+ s_typeMap->insert(TQString::tqfromLatin1("SER"), TQString::tqfromLatin1("Serial (BookMonograph)"));
+ s_typeMap->insert(TQString::tqfromLatin1("SLIDE"), TQString::tqfromLatin1("Slide"));
+ s_typeMap->insert(TQString::tqfromLatin1("SOUND"), TQString::tqfromLatin1("Sound recording"));
+ s_typeMap->insert(TQString::tqfromLatin1("STAT"), TQString::tqfromLatin1("Statute"));
+ s_typeMap->insert(TQString::tqfromLatin1("THES"), TQString::tqfromLatin1("phdthesis")); // "mastersthesis" ?
+ s_typeMap->insert(TQString::tqfromLatin1("UNBILL"), TQString::tqfromLatin1("Unenacted bill/resolution"));
+ s_typeMap->insert(TQString::tqfromLatin1("UNPB"), TQString::tqfromLatin1("unpublished")); // bibtex
+ s_typeMap->insert(TQString::tqfromLatin1("VIDEO"), TQString::tqfromLatin1("Video recording"));
}
}
@@ -126,7 +126,7 @@ Tellico::Data::CollPtr RISImporter::collection() {
m_coll = new Data::BibtexCollection(true);
- QDict<Data::Field> risFields;
+ TQDict<Data::Field> risFields;
// need to know if any extended properties in current collection point to RIS
// if so, add to collection
@@ -134,7 +134,7 @@ Tellico::Data::CollPtr RISImporter::collection() {
Data::FieldVec vec = currColl->fields();
for(Data::FieldVec::Iterator it = vec.begin(); it != vec.end(); ++it) {
// continue if property is empty
- QString ris = it->property(QString::fromLatin1("ris"));
+ TQString ris = it->property(TQString::tqfromLatin1("ris"));
if(ris.isEmpty()) {
continue;
}
@@ -144,13 +144,13 @@ Tellico::Data::CollPtr RISImporter::collection() {
f = new Data::Field(*it);
m_coll->addField(f);
}
- f->setProperty(QString::fromLatin1("ris"), ris);
+ f->setProperty(TQString::tqfromLatin1("ris"), ris);
risFields.insert(ris, f);
}
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(urls().count() * 100);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
int count = 0;
@@ -165,23 +165,23 @@ Tellico::Data::CollPtr RISImporter::collection() {
return m_coll;
}
-void RISImporter::readURL(const KURL& url_, int n, const QDict<Data::Field>& risFields_) {
- QString str = FileHandler::readTextFile(url_);
+void RISImporter::readURL(const KURL& url_, int n, const TQDict<Data::Field>& risFields_) {
+ TQString str = FileHandler::readTextFile(url_);
if(str.isEmpty()) {
return;
}
ISBNValidator isbnval(this);
- QTextIStream t(&str);
+ TQTextIStream t(&str);
const uint length = str.length();
- const uint stepSize = QMAX(s_stepSize, length/100);
+ const uint stepSize = TQMAX(s_stepSize, length/100);
const bool showProgress = options() & ImportProgress;
bool needToAddFinal = false;
- QString sp, ep;
+ TQString sp, ep;
uint j = 0;
Data::EntryPtr entry = new Data::Entry(m_coll);
@@ -189,19 +189,19 @@ void RISImporter::readURL(const KURL& url_, int n, const QDict<Data::Field>& ris
// however, at least one website (Springer) outputs RIS with no space after the final "ER -"
// so just strip the white space later
// also be gracious and allow only any amount of space before hyphen
- QRegExp rx(QString::fromLatin1("^(\\w\\w)\\s+-(.*)$"));
- QString currLine, nextLine;
+ TQRegExp rx(TQString::tqfromLatin1("^(\\w\\w)\\s+-(.*)$"));
+ TQString currLine, nextLine;
for(currLine = t.readLine(); !m_cancelled && !currLine.isNull(); currLine = nextLine, j += currLine.length()) {
nextLine = t.readLine();
rx.search(currLine);
- QString tag = rx.cap(1);
- QString value = rx.cap(2).stripWhiteSpace();
+ TQString tag = rx.cap(1);
+ TQString value = rx.cap(2).stripWhiteSpace();
if(tag.isEmpty()) {
continue;
}
// myDebug() << tag << ": " << value << endl;
// if the next line is not empty and does not match start regexp, append to value
- while(!nextLine.isEmpty() && nextLine.find(rx) == -1) {
+ while(!nextLine.isEmpty() && nextLine.tqfind(rx) == -1) {
value += nextLine.stripWhiteSpace();
nextLine = t.readLine();
}
@@ -212,7 +212,7 @@ void RISImporter::readURL(const KURL& url_, int n, const QDict<Data::Field>& ris
entry = new Data::Entry(m_coll);
needToAddFinal = false;
continue;
- } else if(tag == Latin1Literal("TY") && s_typeMap->contains(value)) {
+ } else if(tag == Latin1Literal("TY") && s_typeMap->tqcontains(value)) {
// for entry-type, switch it to normalized type name
value = (*s_typeMap)[value];
} else if(tag == Latin1Literal("SN")) {
@@ -225,9 +225,9 @@ void RISImporter::readURL(const KURL& url_, int n, const QDict<Data::Field>& ris
sp = value;
if(!ep.isEmpty()) {
value = sp + '-' + ep;
- tag = QString::fromLatin1("EP");
- sp = QString();
- ep = QString();
+ tag = TQString::tqfromLatin1("EP");
+ sp = TQString();
+ ep = TQString();
} else {
// nothing else to do
continue;
@@ -236,8 +236,8 @@ void RISImporter::readURL(const KURL& url_, int n, const QDict<Data::Field>& ris
ep = value;
if(!sp.isEmpty()) {
value = sp + '-' + ep;
- sp = QString();
- ep = QString();
+ sp = TQString();
+ ep = TQString();
} else {
continue;
}
@@ -248,15 +248,15 @@ void RISImporter::readURL(const KURL& url_, int n, const QDict<Data::Field>& ris
// the lookup scheme is:
// 1. any field has an RIS property that matches the tag name
// 2. default field mapping tag -> field name
- Data::FieldPtr f = risFields_.find(tag);
+ Data::FieldPtr f = risFields_.tqfind(tag);
if(!f) {
// special case for BT
// primary title for books, secondary for everything else
if(tag == Latin1Literal("BT")) {
- if(entry->field(QString::fromLatin1("entry-type")) == Latin1Literal("book")) {
- f = m_coll->fieldByName(QString::fromLatin1("title"));
+ if(entry->field(TQString::tqfromLatin1("entry-type")) == Latin1Literal("book")) {
+ f = m_coll->fieldByName(TQString::tqfromLatin1("title"));
} else {
- f = m_coll->fieldByName(QString::fromLatin1("booktitle"));
+ f = m_coll->fieldByName(TQString::tqfromLatin1("booktitle"));
}
} else {
f = fieldByTag(tag);
@@ -272,7 +272,7 @@ void RISImporter::readURL(const KURL& url_, int n, const QDict<Data::Field>& ris
f->addAllowed(value);
// if the field can have multiple values, append current values to new value
if((f->flags() & Data::Field::AllowMultiple) && !entry->field(f->name()).isEmpty()) {
- value.prepend(entry->field(f->name()) + QString::fromLatin1("; "));
+ value.prepend(entry->field(f->name()) + TQString::tqfromLatin1("; "));
}
entry->setField(f, value);
@@ -287,21 +287,21 @@ void RISImporter::readURL(const KURL& url_, int n, const QDict<Data::Field>& ris
}
}
-Tellico::Data::FieldPtr RISImporter::fieldByTag(const QString& tag_) {
+Tellico::Data::FieldPtr RISImporter::fieldByTag(const TQString& tag_) {
Data::FieldPtr f = 0;
- const QString& fieldTag = (*s_tagMap)[tag_];
+ const TQString& fieldTag = (*s_tagMap)[tag_];
if(!fieldTag.isEmpty()) {
f = m_coll->fieldByName(fieldTag);
if(f) {
- f->setProperty(QString::fromLatin1("ris"), tag_);
+ f->setProperty(TQString::tqfromLatin1("ris"), tag_);
return f;
}
}
// add non-default fields if not already there
if(tag_== Latin1Literal("L1")) {
- f = new Data::Field(QString::fromLatin1("pdf"), i18n("PDF"), Data::Field::URL);
- f->setProperty(QString::fromLatin1("ris"), QString::fromLatin1("L1"));
+ f = new Data::Field(TQString::tqfromLatin1("pdf"), i18n("PDF"), Data::Field::URL);
+ f->setProperty(TQString::tqfromLatin1("ris"), TQString::tqfromLatin1("L1"));
f->setCategory(i18n("Miscellaneous"));
}
m_coll->addField(f);
diff --git a/src/translators/risimporter.h b/src/translators/risimporter.h
index c7d08d2..9b5b07b 100644
--- a/src/translators/risimporter.h
+++ b/src/translators/risimporter.h
@@ -17,11 +17,11 @@
#include "importer.h"
#include "../datavectors.h"
-#include <qstring.h>
-#include <qmap.h>
+#include <tqstring.h>
+#include <tqmap.h>
template<class type>
-class QDict;
+class TQDict;
namespace Tellico {
namespace Data {
@@ -34,6 +34,7 @@ namespace Tellico {
*/
class RISImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -46,7 +47,7 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget*, const char*) { return 0; }
+ virtual TQWidget* widget(TQWidget*, const char*) { return 0; }
virtual bool canImport(int type) const;
public slots:
@@ -56,14 +57,14 @@ private:
static void initTagMap();
static void initTypeMap();
- Data::FieldPtr fieldByTag(const QString& tag);
- void readURL(const KURL& url, int n, const QDict<Data::Field>& risFields);
+ Data::FieldPtr fieldByTag(const TQString& tag);
+ void readURL(const KURL& url, int n, const TQDict<Data::Field>& risFields);
Data::CollPtr m_coll;
bool m_cancelled;
- static QMap<QString, QString>* s_tagMap;
- static QMap<QString, QString>* s_typeMap;
+ static TQMap<TQString, TQString>* s_tagMap;
+ static TQMap<TQString, TQString>* s_typeMap;
};
} // end namespace
diff --git a/src/translators/tellico_xml.cpp b/src/translators/tellico_xml.cpp
index 8e7ac61..cddae3b 100644
--- a/src/translators/tellico_xml.cpp
+++ b/src/translators/tellico_xml.cpp
@@ -17,11 +17,11 @@
#include <libxml/parser.h> // has to be before valid.h
#include <libxml/valid.h>
-#include <qregexp.h>
+#include <tqregexp.h>
-const QString Tellico::XML::nsXSL = QString::fromLatin1("http://www.w3.org/1999/XSL/Transform");
-const QString Tellico::XML::nsBibtexml = QString::fromLatin1("http://bibtexml.sf.net/");
-const QString Tellico::XML::dtdBibtexml = QString::fromLatin1("bibtexml.dtd");
+const TQString Tellico::XML::nsXSL = TQString::tqfromLatin1("http://www.w3.org/1999/XSL/Transform");
+const TQString Tellico::XML::nsBibtexml = TQString::tqfromLatin1("http://bibtexml.sf.net/");
+const TQString Tellico::XML::dtdBibtexml = TQString::tqfromLatin1("bibtexml.dtd");
/*
* VERSION 2 added namespaces, changed to multiple elements,
@@ -48,36 +48,36 @@ const QString Tellico::XML::dtdBibtexml = QString::fromLatin1("bibtexml.dtd");
* VERSION 10 added the game board collection.
*/
const uint Tellico::XML::syntaxVersion = 10;
-const QString Tellico::XML::nsTellico = QString::fromLatin1("http://periapsis.org/tellico/");
+const TQString Tellico::XML::nsTellico = TQString::tqfromLatin1("http://periapsis.org/tellico/");
-const QString Tellico::XML::nsBookcase = QString::fromLatin1("http://periapsis.org/bookcase/");
-const QString Tellico::XML::nsDublinCore = QString::fromLatin1("http://purl.org/dc/elements/1.1/");
-const QString Tellico::XML::nsZing = QString::fromLatin1("http://www.loc.gov/zing/srw/");
-const QString Tellico::XML::nsZingDiag = QString::fromLatin1("http://www.loc.gov/zing/srw/diagnostic/");
+const TQString Tellico::XML::nsBookcase = TQString::tqfromLatin1("http://periapsis.org/bookcase/");
+const TQString Tellico::XML::nsDublinCore = TQString::tqfromLatin1("http://purl.org/dc/elements/1.1/");
+const TQString Tellico::XML::nsZing = TQString::tqfromLatin1("http://www.loc.gov/zing/srw/");
+const TQString Tellico::XML::nsZingDiag = TQString::tqfromLatin1("http://www.loc.gov/zing/srw/diagnostic/");
-QString Tellico::XML::pubTellico(int version) {
- return QString::fromLatin1("-//Robby Stephenson/DTD Tellico V%1.0//EN").arg(version);
+TQString Tellico::XML::pubTellico(int version) {
+ return TQString::tqfromLatin1("-//Robby Stephenson/DTD Tellico V%1.0//EN").tqarg(version);
}
-QString Tellico::XML::dtdTellico(int version) {
- return QString::fromLatin1("http://periapsis.org/tellico/dtd/v%1/tellico.dtd").arg(version);
+TQString Tellico::XML::dtdTellico(int version) {
+ return TQString::tqfromLatin1("http://periapsis.org/tellico/dtd/v%1/tellico.dtd").tqarg(version);
}
-bool Tellico::XML::validXMLElementName(const QString& name_) {
+bool Tellico::XML::validXMLElementName(const TQString& name_) {
return xmlValidateNameValue((xmlChar *)name_.utf8().data());
}
-QString Tellico::XML::elementName(const QString& name_) {
- QString name = name_;
+TQString Tellico::XML::elementName(const TQString& name_) {
+ TQString name = name_;
// change white space to dashes
- name.replace(QRegExp(QString::fromLatin1("\\s+")), QString::fromLatin1("-"));
+ name.tqreplace(TQRegExp(TQString::tqfromLatin1("\\s+")), TQString::tqfromLatin1("-"));
// first cut, if it passes, we're done
if(XML::validXMLElementName(name)) {
return name;
}
// next check first characters IS_DIGIT is defined in libxml/vali.d
- for(uint i = 0; i < name.length() && (!IS_LETTER(name[i].unicode()) || name[i] == '_'); ++i) {
+ for(uint i = 0; i < name.length() && (!IS_LETTER(name[i].tqunicode()) || name[i] == '_'); ++i) {
name = name.mid(1);
}
if(name.isEmpty() || XML::validXMLElementName(name)) {
diff --git a/src/translators/tellico_xml.h b/src/translators/tellico_xml.h
index 7c1a3e2..6ff4c1b 100644
--- a/src/translators/tellico_xml.h
+++ b/src/translators/tellico_xml.h
@@ -14,27 +14,27 @@
#ifndef TELLICO_XML_H
#define TELLICO_XML_H
-#include <qstring.h>
+#include <tqstring.h>
namespace Tellico {
namespace XML {
- extern const QString nsXSL;
- extern const QString nsBibtexml;
- extern const QString dtdBibtexml;
+ extern const TQString nsXSL;
+ extern const TQString nsBibtexml;
+ extern const TQString dtdBibtexml;
extern const uint syntaxVersion;
- extern const QString nsTellico;
+ extern const TQString nsTellico;
- QString pubTellico(int version = syntaxVersion);
- QString dtdTellico(int version = syntaxVersion);
+ TQString pubTellico(int version = syntaxVersion);
+ TQString dtdTellico(int version = syntaxVersion);
- extern const QString nsBookcase;
- extern const QString nsDublinCore;
- extern const QString nsZing;
- extern const QString nsZingDiag;
+ extern const TQString nsBookcase;
+ extern const TQString nsDublinCore;
+ extern const TQString nsZing;
+ extern const TQString nsZingDiag;
- bool validXMLElementName(const QString& name);
- QString elementName(const QString& name);
+ bool validXMLElementName(const TQString& name);
+ TQString elementName(const TQString& name);
}
}
diff --git a/src/translators/tellicoimporter.cpp b/src/translators/tellicoimporter.cpp
index cb3c7a3..ae06500 100644
--- a/src/translators/tellicoimporter.cpp
+++ b/src/translators/tellicoimporter.cpp
@@ -32,10 +32,10 @@
#include <kzip.h>
#include <kapplication.h>
-#include <qdom.h>
-#include <qbuffer.h>
-#include <qfile.h>
-#include <qtimer.h>
+#include <tqdom.h>
+#include <tqbuffer.h>
+#include <tqfile.h>
+#include <tqtimer.h>
using Tellico::Import::TellicoImporter;
@@ -49,7 +49,7 @@ TellicoImporter::TellicoImporter(const KURL& url_, bool loadAllImages_) : DataIm
m_cancelled(false), m_hasImages(false), m_buffer(0), m_zip(0), m_imgDir(0) {
}
-TellicoImporter::TellicoImporter(const QString& text_) : DataImporter(text_),
+TellicoImporter::TellicoImporter(const TQString& text_) : DataImporter(text_),
m_coll(0), m_loadAllImages(true), m_format(Unknown), m_modified(false),
m_cancelled(false), m_hasImages(false), m_buffer(0), m_zip(0), m_imgDir(0) {
}
@@ -69,12 +69,12 @@ Tellico::Data::CollPtr TellicoImporter::collection() {
return m_coll;
}
- QCString s; // read first 5 characters
+ TQCString s; // read first 5 characters
if(source() == URL) {
if(!fileRef().open()) {
return 0;
}
- QIODevice* f = fileRef().file();
+ TQIODevice* f = fileRef().file();
for(uint i = 0; i < 5; ++i) {
s += static_cast<char>(f->getch());
}
@@ -84,14 +84,14 @@ Tellico::Data::CollPtr TellicoImporter::collection() {
m_format = Error;
return 0;
}
- s = QCString(data(), 6);
+ s = TQCString(data(), 6);
}
// need to decide if the data is xml text, or a zip file
// if the first 5 characters are <?xml then treat it like text
if(s[0] == '<' && s[1] == '?' && s[2] == 'x' && s[3] == 'm' && s[4] == 'l') {
m_format = XML;
- loadXMLData(source() == URL ? fileRef().file()->readAll() : data(), true);
+ loadXMLData(source() == URL ? TQByteArray(fileRef().file()->readAll()) : TQByteArray(data()), true);
} else {
m_format = Zip;
loadZipData();
@@ -99,38 +99,38 @@ Tellico::Data::CollPtr TellicoImporter::collection() {
return m_coll;
}
-void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
+void TellicoImporter::loadXMLData(const TQByteArray& data_, bool loadImages_) {
ProgressItem& item = ProgressManager::self()->newProgressItem(this, progressLabel(), true);
item.setTotalSteps(100);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
- QDomDocument dom;
- QString errorMsg;
+ TQDomDocument dom;
+ TQString errorMsg;
int errorLine, errorColumn;
if(!dom.setContent(data_, true, &errorMsg, &errorLine, &errorColumn)) {
- QString str = i18n(errorLoad).arg(url().fileName()) + QChar('\n');
- str += i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn);
- str += QString::fromLatin1("\n");
- str += i18n("The error message from Qt is:");
- str += QString::fromLatin1("\n\t") + errorMsg;
+ TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n');
+ str += i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn);
+ str += TQString::tqfromLatin1("\n");
+ str += i18n("The error message from TQt is:");
+ str += TQString::tqfromLatin1("\n\t") + errorMsg;
myDebug() << str << endl;
setStatusMessage(str);
m_format = Error;
return;
}
- QDomElement root = dom.documentElement();
+ TQDomElement root = dom.documentElement();
// the syntax version field name changed from "version" to "syntaxVersion" in version 3
uint syntaxVersion;
- if(root.hasAttribute(QString::fromLatin1("syntaxVersion"))) {
- syntaxVersion = root.attribute(QString::fromLatin1("syntaxVersion")).toInt();
- } else if (root.hasAttribute(QString::fromLatin1("version"))) {
- syntaxVersion = root.attribute(QString::fromLatin1("version")).toInt();
+ if(root.hasAttribute(TQString::tqfromLatin1("syntaxVersion"))) {
+ syntaxVersion = root.attribute(TQString::tqfromLatin1("syntaxVersion")).toInt();
+ } else if (root.hasAttribute(TQString::tqfromLatin1("version"))) {
+ syntaxVersion = root.attribute(TQString::tqfromLatin1("version")).toInt();
} else {
if(!url().isEmpty()) {
- setStatusMessage(i18n(errorLoad).arg(url().fileName()));
+ setStatusMessage(i18n(errorLoad).tqarg(url().fileName()));
}
m_format = Error;
return;
@@ -140,7 +140,7 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
if((syntaxVersion > 6 && root.tagName() != Latin1Literal("tellico"))
|| (syntaxVersion < 7 && root.tagName() != Latin1Literal("bookcase"))) {
if(!url().isEmpty()) {
- setStatusMessage(i18n(errorLoad).arg(url().fileName()));
+ setStatusMessage(i18n(errorLoad).tqarg(url().fileName()));
}
m_format = Error;
return;
@@ -148,7 +148,7 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
if(syntaxVersion > XML::syntaxVersion) {
if(!url().isEmpty()) {
- QString str = i18n(errorLoad).arg(url().fileName()) + QChar('\n');
+ TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n');
str += i18n("It is from a future version of Tellico.");
myDebug() << str << endl;
setStatusMessage(str);
@@ -159,7 +159,7 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
return;
} else if(versionConversion(syntaxVersion, XML::syntaxVersion)) {
// going form version 9 to 10, there's no conversion needed
- QString str = i18n("Tellico is converting the file to a more recent document format. "
+ TQString str = i18n("Tellico is converting the file to a more recent document format. "
"Information loss may occur if an older version of Tellico is used "
"to read this file in the future.");
myDebug() << str << endl;
@@ -170,8 +170,8 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
m_namespace = syntaxVersion > 6 ? XML::nsTellico : XML::nsBookcase;
// the collection item should be the first dom element child of the root
- QDomElement collelem;
- for(QDomNode n = root.firstChild(); !n.isNull(); n = n.nextSibling()) {
+ TQDomElement collelem;
+ for(TQDomNode n = root.firstChild(); !n.isNull(); n = n.nextSibling()) {
if(n.namespaceURI() != m_namespace) {
continue;
}
@@ -185,21 +185,21 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
return;
}
- QString title = collelem.attribute(QString::fromLatin1("title"));
+ TQString title = collelem.attribute(TQString::tqfromLatin1("title"));
// be careful not to have element name collision
// for fields, each true field element is a child of a fields element
- QDomNodeList fieldelems;
- for(QDomNode n = collelem.firstChild(); !n.isNull(); n = n.nextSibling()) {
+ TQDomNodeList fieldelems;
+ for(TQDomNode n = collelem.firstChild(); !n.isNull(); n = n.nextSibling()) {
if(n.namespaceURI() != m_namespace) {
continue;
}
// Latin1Literal is a macro, so can't say Latin1Literal(syntaxVersion > 3 ? "fields" : "attributes")
if((syntaxVersion > 3 && n.localName() == Latin1Literal("fields"))
|| (syntaxVersion < 4 && n.localName() == Latin1Literal("attributes"))) {
- QDomElement e = n.toElement();
- fieldelems = e.elementsByTagNameNS(m_namespace, (syntaxVersion > 3) ? QString::fromLatin1("field")
- : QString::fromLatin1("attribute"));
+ TQDomElement e = n.toElement();
+ fieldelems = e.elementsByTagNameNS(m_namespace, (syntaxVersion > 3) ? TQString::tqfromLatin1("field")
+ : TQString::tqfromLatin1("attribute"));
break;
}
}
@@ -209,26 +209,26 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
// if there are no attributes or if the first one has the special name of _default
bool addFields = (fieldelems.count() == 0);
if(!addFields) {
- QString name = fieldelems.item(0).toElement().attribute(QString::fromLatin1("name"));
+ TQString name = fieldelems.item(0).toElement().attribute(TQString::tqfromLatin1("name"));
addFields = (name == Latin1Literal("_default"));
- // removeChild only works for immediate children
+ // removeChild only works for immediate tqchildren
// remove _default field
if(addFields) {
- fieldelems.item(0).parentNode().removeChild(fieldelems.item(0));
+ fieldelems.item(0).tqparentNode().removeChild(fieldelems.item(0));
}
}
- QString entryName;
+ TQString entryName;
// in syntax 4, the element name was changed to "entry", always, rather than depending on
// on the entryName of the collection. A type field was added to the collection element
// to specify what type of collection it is.
if(syntaxVersion > 3) {
- entryName = QString::fromLatin1("entry");
- QString typeStr = collelem.attribute(QString::fromLatin1("type"));
+ entryName = TQString::tqfromLatin1("entry");
+ TQString typeStr = collelem.attribute(TQString::tqfromLatin1("type"));
Data::Collection::Type type = static_cast<Data::Collection::Type>(typeStr.toInt());
m_coll = CollectionFactory::collection(type, addFields);
} else {
- entryName = collelem.attribute(QString::fromLatin1("unit"));
+ entryName = collelem.attribute(TQString::tqfromLatin1("unit"));
m_coll = CollectionFactory::collection(entryName, addFields);
}
@@ -242,23 +242,23 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
if(m_coll->type() == Data::Collection::Bibtex) {
Data::BibtexCollection* c = static_cast<Data::BibtexCollection*>(m_coll.data());
- QDomNodeList macroelems;
- for(QDomNode n = collelem.firstChild(); !n.isNull(); n = n.nextSibling()) {
+ TQDomNodeList macroelems;
+ for(TQDomNode n = collelem.firstChild(); !n.isNull(); n = n.nextSibling()) {
if(n.namespaceURI() != m_namespace) {
continue;
}
if(n.localName() == Latin1Literal("macros")) {
- macroelems = n.toElement().elementsByTagNameNS(m_namespace, QString::fromLatin1("macro"));
+ macroelems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("macro"));
break;
}
}
// myDebug() << "TellicoImporter::loadXMLData() - found " << macroelems.count() << " macros" << endl;
for(uint j = 0; c && j < macroelems.count(); ++j) {
- QDomElement elem = macroelems.item(j).toElement();
- c->addMacro(elem.attribute(QString::fromLatin1("name")), elem.text());
+ TQDomElement elem = macroelems.item(j).toElement();
+ c->addMacro(elem.attribute(TQString::tqfromLatin1("name")), elem.text());
}
- for(QDomNode n = collelem.firstChild(); !n.isNull(); n = n.nextSibling()) {
+ for(TQDomNode n = collelem.firstChild(); !n.isNull(); n = n.nextSibling()) {
if(n.namespaceURI() != m_namespace) {
continue;
}
@@ -276,12 +276,12 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
// as a special case, for old book collections with a bibtex-id field, convert to Bibtex
if(syntaxVersion < 4 && m_coll->type() == Data::Collection::Book
- && m_coll->hasField(QString::fromLatin1("bibtex-id"))) {
+ && m_coll->hasField(TQString::tqfromLatin1("bibtex-id"))) {
m_coll = Data::BibtexCollection::convertBookCollection(m_coll);
}
const uint count = collelem.childNodes().count();
- const uint stepSize = QMAX(s_stepSize, count/100);
+ const uint stepSize = TQMAX(s_stepSize, count/100);
const bool showProgress = options() & ImportProgress;
item.setTotalSteps(count);
@@ -289,13 +289,13 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
// have to read images before entries so we can figure out if
// linkOnly() is true
// m_loadAllImages only pertains to zip files
- QDomNodeList imgelems;
- for(QDomNode n = collelem.firstChild(); !n.isNull(); n = n.nextSibling()) {
+ TQDomNodeList imgelems;
+ for(TQDomNode n = collelem.firstChild(); !n.isNull(); n = n.nextSibling()) {
if(n.namespaceURI() != m_namespace) {
continue;
}
if(n.localName() == Latin1Literal("images")) {
- imgelems = n.toElement().elementsByTagNameNS(m_namespace, QString::fromLatin1("image"));
+ imgelems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("image"));
break;
}
}
@@ -309,7 +309,7 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
}
uint j = 0;
- for(QDomNode n = collelem.firstChild(); !n.isNull() && !m_cancelled; n = n.nextSibling(), ++j) {
+ for(TQDomNode n = collelem.firstChild(); !n.isNull() && !m_cancelled; n = n.nextSibling(), ++j) {
if(n.namespaceURI() != m_namespace) {
continue;
}
@@ -332,17 +332,17 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
}
// filters and borrowers are at document root level, not collection
- for(QDomNode n = root.firstChild(); !n.isNull() && !m_cancelled; n = n.nextSibling()) {
+ for(TQDomNode n = root.firstChild(); !n.isNull() && !m_cancelled; n = n.nextSibling()) {
if(n.namespaceURI() != m_namespace) {
continue;
}
if(n.localName() == Latin1Literal("borrowers")) {
- QDomNodeList borrowerElems = n.toElement().elementsByTagNameNS(m_namespace, QString::fromLatin1("borrower"));
+ TQDomNodeList borrowerElems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("borrower"));
for(uint j = 0; j < borrowerElems.count(); ++j) {
readBorrower(borrowerElems.item(j).toElement());
}
} else if(n.localName() == Latin1Literal("filters")) {
- QDomNodeList filterElems = n.toElement().elementsByTagNameNS(m_namespace, QString::fromLatin1("filter"));
+ TQDomNodeList filterElems = n.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("filter"));
for(uint j = 0; j < filterElems.count(); ++j) {
readFilter(filterElems.item(j).toElement());
}
@@ -359,25 +359,25 @@ void TellicoImporter::loadXMLData(const QByteArray& data_, bool loadImages_) {
}
}
-void TellicoImporter::readField(uint syntaxVersion_, const QDomElement& elem_) {
+void TellicoImporter::readField(uint syntaxVersion_, const TQDomElement& elem_) {
// special case: if the i18n attribute equals true, then translate the title, description, and category
- bool isI18n = elem_.attribute(QString::fromLatin1("i18n")) == Latin1Literal("true");
+ bool isI18n = elem_.attribute(TQString::tqfromLatin1("i18n")) == Latin1Literal("true");
- QString name = elem_.attribute(QString::fromLatin1("name"), QString::fromLatin1("unknown"));
- QString title = elem_.attribute(QString::fromLatin1("title"), i18n("Unknown"));
+ TQString name = elem_.attribute(TQString::tqfromLatin1("name"), TQString::tqfromLatin1("unknown"));
+ TQString title = elem_.attribute(TQString::tqfromLatin1("title"), i18n("Unknown"));
if(isI18n) {
title = i18n(title.utf8());
}
- QString typeStr = elem_.attribute(QString::fromLatin1("type"), QString::number(Data::Field::Line));
+ TQString typeStr = elem_.attribute(TQString::tqfromLatin1("type"), TQString::number(Data::Field::Line));
Data::Field::Type type = static_cast<Data::Field::Type>(typeStr.toInt());
Data::FieldPtr field;
if(type == Data::Field::Choice) {
- QStringList allowed = QStringList::split(QString::fromLatin1(";"),
- elem_.attribute(QString::fromLatin1("allowed")));
+ TQStringList allowed = TQStringList::split(TQString::tqfromLatin1(";"),
+ elem_.attribute(TQString::tqfromLatin1("allowed")));
if(isI18n) {
- for(QStringList::Iterator it = allowed.begin(); it != allowed.end(); ++it) {
+ for(TQStringList::Iterator it = allowed.begin(); it != allowed.end(); ++it) {
(*it) = i18n((*it).utf8());
}
}
@@ -386,10 +386,10 @@ void TellicoImporter::readField(uint syntaxVersion_, const QDomElement& elem_) {
field = new Data::Field(name, title, type);
}
- if(elem_.hasAttribute(QString::fromLatin1("category"))) {
+ if(elem_.hasAttribute(TQString::tqfromLatin1("category"))) {
// at one point, the categories had keyboard accels
- QString cat = elem_.attribute(QString::fromLatin1("category"));
- if(syntaxVersion_ < 9 && cat.find('&') > -1) {
+ TQString cat = elem_.attribute(TQString::tqfromLatin1("category"));
+ if(syntaxVersion_ < 9 && cat.tqfind('&') > -1) {
cat.remove('&');
}
if(isI18n) {
@@ -398,8 +398,8 @@ void TellicoImporter::readField(uint syntaxVersion_, const QDomElement& elem_) {
field->setCategory(cat);
}
- if(elem_.hasAttribute(QString::fromLatin1("flags"))) {
- int flags = elem_.attribute(QString::fromLatin1("flags")).toInt();
+ if(elem_.hasAttribute(TQString::tqfromLatin1("flags"))) {
+ int flags = elem_.attribute(TQString::tqfromLatin1("flags")).toInt();
// I also changed the enum values for syntax 3, but the only custom field
// would have been bibtex-id
if(syntaxVersion_ < 3 && field->name() == Latin1Literal("bibtex-id")) {
@@ -414,12 +414,12 @@ void TellicoImporter::readField(uint syntaxVersion_, const QDomElement& elem_) {
field->setFlags(flags);
}
- QString formatStr = elem_.attribute(QString::fromLatin1("format"), QString::number(Data::Field::FormatNone));
+ TQString formatStr = elem_.attribute(TQString::tqfromLatin1("format"), TQString::number(Data::Field::FormatNone));
Data::Field::FormatFlag format = static_cast<Data::Field::FormatFlag>(formatStr.toInt());
field->setFormatFlag(format);
- if(elem_.hasAttribute(QString::fromLatin1("description"))) {
- QString desc = elem_.attribute(QString::fromLatin1("description"));
+ if(elem_.hasAttribute(TQString::tqfromLatin1("description"))) {
+ TQString desc = elem_.attribute(TQString::tqfromLatin1("description"));
if(isI18n) {
desc = i18n(desc.utf8());
}
@@ -427,42 +427,42 @@ void TellicoImporter::readField(uint syntaxVersion_, const QDomElement& elem_) {
}
if(syntaxVersion_ >= 5) {
- QDomNodeList props = elem_.elementsByTagNameNS(m_namespace, QString::fromLatin1("prop"));
+ TQDomNodeList props = elem_.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("prop"));
for(uint i = 0; i < props.count(); ++i) {
- QDomElement e = props.item(i).toElement();
- field->setProperty(e.attribute(QString::fromLatin1("name")), e.text());
+ TQDomElement e = props.item(i).toElement();
+ field->setProperty(e.attribute(TQString::tqfromLatin1("name")), e.text());
}
// all track fields in music collections prior to version 9 get converted to three columns
if(syntaxVersion_ < 9) {
if(m_coll->type() == Data::Collection::Album && field->name() == Latin1Literal("track")) {
- field->setProperty(QString::fromLatin1("columns"), QChar('3'));
- field->setProperty(QString::fromLatin1("column1"), i18n("Title"));
- field->setProperty(QString::fromLatin1("column2"), i18n("Artist"));
- field->setProperty(QString::fromLatin1("column3"), i18n("Length"));
+ field->setProperty(TQString::tqfromLatin1("columns"), TQChar('3'));
+ field->setProperty(TQString::tqfromLatin1("column1"), i18n("Title"));
+ field->setProperty(TQString::tqfromLatin1("column2"), i18n("Artist"));
+ field->setProperty(TQString::tqfromLatin1("column3"), i18n("Length"));
} else if(m_coll->type() == Data::Collection::Video && field->name() == Latin1Literal("cast")) {
- field->setProperty(QString::fromLatin1("column1"), i18n("Actor/Actress"));
- field->setProperty(QString::fromLatin1("column2"), i18n("Role"));
+ field->setProperty(TQString::tqfromLatin1("column1"), i18n("Actor/Actress"));
+ field->setProperty(TQString::tqfromLatin1("column2"), i18n("Role"));
}
}
- } else if(elem_.hasAttribute(QString::fromLatin1("bibtex-field"))) {
- field->setProperty(QString::fromLatin1("bibtex"), elem_.attribute(QString::fromLatin1("bibtex-field")));
+ } else if(elem_.hasAttribute(TQString::tqfromLatin1("bibtex-field"))) {
+ field->setProperty(TQString::tqfromLatin1("bibtex"), elem_.attribute(TQString::tqfromLatin1("bibtex-field")));
}
// Table2 is deprecated
if(field->type() == Data::Field::Table2) {
field->setType(Data::Field::Table);
- field->setProperty(QString::fromLatin1("columns"), QChar('2'));
+ field->setProperty(TQString::tqfromLatin1("columns"), TQChar('2'));
}
// for syntax 8, rating fields got their own type
if(syntaxVersion_ < 8) {
Data::Field::convertOldRating(field); // does all its own checking
}
m_coll->addField(field);
-// myDebug() << QString(" Added field: %1, %2").arg(field->name()).arg(field->title()) << endl;
+// myDebug() << TQString(" Added field: %1, %2").tqarg(field->name()).tqarg(field->title()) << endl;
}
-void TellicoImporter::readEntry(uint syntaxVersion_, const QDomElement& entryElem_) {
- const int id = entryElem_.attribute(QString::fromLatin1("id")).toInt();
+void TellicoImporter::readEntry(uint syntaxVersion_, const TQDomElement& entryElem_) {
+ const int id = entryElem_.attribute(TQString::tqfromLatin1("id")).toInt();
Data::EntryPtr entry;
if(id > 0) {
entry = new Data::Entry(m_coll, id);
@@ -472,31 +472,31 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const QDomElement& entryEle
bool oldMusic = (syntaxVersion_ < 9 && m_coll->type() == Data::Collection::Album);
- // iterate over all field value children
- for(QDomNode node = entryElem_.firstChild(); !node.isNull(); node = node.nextSibling()) {
- QDomElement elem = node.toElement();
+ // iterate over all field value tqchildren
+ for(TQDomNode node = entryElem_.firstChild(); !node.isNull(); node = node.nextSibling()) {
+ TQDomElement elem = node.toElement();
if(elem.isNull()) {
continue;
}
- bool isI18n = elem.attribute(QString::fromLatin1("i18n")) == Latin1Literal("true");
+ bool isI18n = elem.attribute(TQString::tqfromLatin1("i18n")) == Latin1Literal("true");
// Entry::setField checks to see if an field of 'name' is allowed
// in version 3 and prior, checkbox attributes had no text(), set it to "true" now
if(syntaxVersion_ < 4 && elem.text().isEmpty()) {
// "true" means checked
- entry->setField(elem.localName(), QString::fromLatin1("true"));
+ entry->setField(elem.localName(), TQString::tqfromLatin1("true"));
continue;
}
- QString name = elem.localName();
+ TQString name = elem.localName();
Data::FieldPtr f = m_coll->fieldByName(name);
// if the first child of the node is a text node, just set the attribute text
- // otherwise, recurse over the node's children
+ // otherwise, recurse over the node's tqchildren
// this is the case for <authors><author>..</author></authors>
// but if there's nothing but white space, then it's a BaseNode for some reason
-// if(node.firstChild().nodeType() == QDomNode::TextNode) {
+// if(node.firstChild().nodeType() == TQDomNode::TextNode) {
if(f) {
// if it's a derived value, no field value is added
if(f->type() == Data::Field::Dependent) {
@@ -506,18 +506,18 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const QDomElement& entryEle
// special case for Date fields
if(f->type() == Data::Field::Date) {
if(elem.hasChildNodes()) {
- QString value;
- QDomNode yNode = elem.elementsByTagNameNS(m_namespace, QString::fromLatin1("year")).item(0);
+ TQString value;
+ TQDomNode yNode = elem.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("year")).item(0);
if(!yNode.isNull()) {
value += yNode.toElement().text();
}
value += '-';
- QDomNode mNode = elem.elementsByTagNameNS(m_namespace, QString::fromLatin1("month")).item(0);
+ TQDomNode mNode = elem.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("month")).item(0);
if(!mNode.isNull()) {
value += mNode.toElement().text();
}
value += '-';
- QDomNode dNode = elem.elementsByTagNameNS(m_namespace, QString::fromLatin1("day")).item(0);
+ TQDomNode dNode = elem.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("day")).item(0);
if(!dNode.isNull()) {
value += dNode.toElement().text();
}
@@ -536,7 +536,7 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const QDomElement& entryEle
// text
// </value
// so we arbitrarily decide that only paragraphs get to have CRs?
- QString value = elem.text();
+ TQString value = elem.text();
if(f->type() != Data::Field::Para) {
value = value.stripWhiteSpace();
}
@@ -553,7 +553,7 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const QDomElement& entryEle
// for local files only, allow paths here
KURL u = KURL::fromPathOrURL(value);
if(u.isValid() && u.isLocalFile()) {
- QString result = ImageFactory::addImage(u, false /* quiet */);
+ TQString result = ImageFactory::addImage(u, false /* quiet */);
if(!result.isEmpty()) {
value = result;
}
@@ -567,11 +567,11 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const QDomElement& entryEle
bool ok;
uint i = Tellico::toUInt(value, &ok);
if(ok) {
- value = QString::number(i);
+ value = TQString::number(i);
}
} else if(syntaxVersion_ < 2 && name == Latin1Literal("keywords")) {
// in version 2, "keywords" changed to "keyword"
- name = QString::fromLatin1("keyword");
+ name = TQString::tqfromLatin1("keyword");
}
// special case: if the i18n attribute equals true, then translate the title, description, and category
if(isI18n) {
@@ -580,13 +580,13 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const QDomElement& entryEle
// special case for isbn fields, go ahead and validate
if(name == Latin1Literal("isbn")) {
const ISBNValidator val(0);
- if(elem.attribute(QString::fromLatin1("validate")) != Latin1Literal("no")) {
+ if(elem.attribute(TQString::tqfromLatin1("validate")) != Latin1Literal("no")) {
val.fixup(value);
}
}
entry->setField(name, value);
}
- } else { // if no field by the tag name, then it has children, iterate through them
+ } else { // if no field by the tag name, then it has tqchildren, iterate through them
// the field name has the final 's', so remove it
name.truncate(name.length() - 1);
f = m_coll->fieldByName(name);
@@ -598,69 +598,69 @@ void TellicoImporter::readEntry(uint syntaxVersion_, const QDomElement& entryEle
const bool oldTracks = (oldMusic && name == Latin1Literal("track"));
- QStringList values;
+ TQStringList values;
// concatenate values
- for(QDomNode childNode = node.firstChild(); !childNode.isNull(); childNode = childNode.nextSibling()) {
- QString value;
+ for(TQDomNode childNode = node.firstChild(); !childNode.isNull(); childNode = childNode.nextSibling()) {
+ TQString value;
// don't worry about i18n here, Tables are never translated
- QDomNodeList cols = childNode.toElement().elementsByTagNameNS(m_namespace, QString::fromLatin1("column"));
+ TQDomNodeList cols = childNode.toElement().elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("column"));
if(cols.count() > 0) {
for(uint i = 0; i < cols.count(); ++i) {
// special case for old tracks
if(oldTracks && i == 1) {
// if the second column holds the track length, bump it to next column
- QRegExp rx(QString::fromLatin1("\\d+:\\d\\d"));
+ TQRegExp rx(TQString::tqfromLatin1("\\d+:\\d\\d"));
if(rx.exactMatch(cols.item(i).toElement().text())) {
- value += entry->field(QString::fromLatin1("artist"));
- value += QString::fromLatin1("::");
+ value += entry->field(TQString::tqfromLatin1("artist"));
+ value += TQString::tqfromLatin1("::");
}
}
value += cols.item(i).toElement().text().stripWhiteSpace();
if(i < cols.count()-1) {
- value += QString::fromLatin1("::");
+ value += TQString::tqfromLatin1("::");
} else if(oldTracks && cols.count() == 1) {
- value += QString::fromLatin1("::");
- value += entry->field(QString::fromLatin1("artist"));
+ value += TQString::tqfromLatin1("::");
+ value += entry->field(TQString::tqfromLatin1("artist"));
}
}
values += value;
} else {
// really loose here, we don't even check that the element name
// is what we think it is
- QString s = childNode.toElement().text().stripWhiteSpace();
+ TQString s = childNode.toElement().text().stripWhiteSpace();
if(isI18n && !s.isEmpty()) {
value += i18n(s.utf8());
} else {
value += s;
}
if(oldTracks) {
- value += QString::fromLatin1("::");
- value += entry->field(QString::fromLatin1("artist"));
+ value += TQString::tqfromLatin1("::");
+ value += entry->field(TQString::tqfromLatin1("artist"));
}
- if(values.findIndex(value) == -1) {
+ if(values.tqfindIndex(value) == -1) {
values += value;
}
}
}
- entry->setField(name, values.join(QString::fromLatin1("; ")));
+ entry->setField(name, values.join(TQString::tqfromLatin1("; ")));
}
} // end field value loop
m_coll->addEntries(entry);
}
-void TellicoImporter::readImage(const QDomElement& elem_, bool loadImage_) {
- QString format = elem_.attribute(QString::fromLatin1("format"));
- const bool link = elem_.attribute(QString::fromLatin1("link")) == Latin1Literal("true");
- QString id = shareString(link ? elem_.attribute(QString::fromLatin1("id"))
- : Data::Image::idClean(elem_.attribute(QString::fromLatin1("id"))));
+void TellicoImporter::readImage(const TQDomElement& elem_, bool loadImage_) {
+ TQString format = elem_.attribute(TQString::tqfromLatin1("format"));
+ const bool link = elem_.attribute(TQString::tqfromLatin1("link")) == Latin1Literal("true");
+ TQString id = shareString(link ? elem_.attribute(TQString::tqfromLatin1("id"))
+ : Data::Image::idClean(elem_.attribute(TQString::tqfromLatin1("id"))));
bool readInfo = true;
if(loadImage_) {
- QByteArray ba;
- KCodecs::base64Decode(QCString(elem_.text().latin1()), ba);
+ TQByteArray ba;
+ KCodecs::base64Decode(TQCString(elem_.text().latin1()), ba);
if(!ba.isEmpty()) {
- QString result = ImageFactory::addImage(ba, format, id);
+ TQString result = ImageFactory::addImage(ba, format, id);
if(result.isEmpty()) {
myDebug() << "TellicoImporter::readImage(XML) - null image for " << id << endl;
}
@@ -670,42 +670,42 @@ void TellicoImporter::readImage(const QDomElement& elem_, bool loadImage_) {
}
if(readInfo) {
// a width or height of 0 is ok here
- int width = elem_.attribute(QString::fromLatin1("width")).toInt();
- int height = elem_.attribute(QString::fromLatin1("height")).toInt();
+ int width = elem_.attribute(TQString::tqfromLatin1("width")).toInt();
+ int height = elem_.attribute(TQString::tqfromLatin1("height")).toInt();
Data::ImageInfo info(id, format.latin1(), width, height, link);
ImageFactory::cacheImageInfo(info);
}
}
-void TellicoImporter::readFilter(const QDomElement& elem_) {
+void TellicoImporter::readFilter(const TQDomElement& elem_) {
FilterPtr f = new Filter(Filter::MatchAny);
- f->setName(elem_.attribute(QString::fromLatin1("name")));
+ f->setName(elem_.attribute(TQString::tqfromLatin1("name")));
- QString match = elem_.attribute(QString::fromLatin1("match"));
+ TQString match = elem_.attribute(TQString::tqfromLatin1("match"));
if(match == Latin1Literal("all")) {
f->setMatch(Filter::MatchAll);
}
- QDomNodeList rules = elem_.elementsByTagNameNS(m_namespace, QString::fromLatin1("rule"));
+ TQDomNodeList rules = elem_.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("rule"));
for(uint i = 0; i < rules.count(); ++i) {
- QDomElement e = rules.item(i).toElement();
+ TQDomElement e = rules.item(i).toElement();
if(e.isNull()) {
continue;
}
- QString field = e.attribute(QString::fromLatin1("field"));
+ TQString field = e.attribute(TQString::tqfromLatin1("field"));
// empty field means match any of them
- QString pattern = e.attribute(QString::fromLatin1("pattern"));
+ TQString pattern = e.attribute(TQString::tqfromLatin1("pattern"));
// empty pattern is bad
if(pattern.isEmpty()) {
kdWarning() << "TellicoImporter::readFilter() - empty rule!" << endl;
continue;
}
- QString function = e.attribute(QString::fromLatin1("function")).lower();
+ TQString function = e.attribute(TQString::tqfromLatin1("function")).lower();
FilterRule::Function func;
- if(function == Latin1Literal("contains")) {
+ if(function == Latin1Literal("tqcontains")) {
func = FilterRule::FuncContains;
- } else if(function == Latin1Literal("notcontains")) {
+ } else if(function == Latin1Literal("nottqcontains")) {
func = FilterRule::FuncNotContains;
} else if(function == Latin1Literal("equals")) {
func = FilterRule::FuncEquals;
@@ -727,37 +727,37 @@ void TellicoImporter::readFilter(const QDomElement& elem_) {
}
}
-void TellicoImporter::readBorrower(const QDomElement& elem_) {
- QString name = elem_.attribute(QString::fromLatin1("name"));
- QString uid = elem_.attribute(QString::fromLatin1("uid"));
+void TellicoImporter::readBorrower(const TQDomElement& elem_) {
+ TQString name = elem_.attribute(TQString::tqfromLatin1("name"));
+ TQString uid = elem_.attribute(TQString::tqfromLatin1("uid"));
Data::BorrowerPtr b = new Data::Borrower(name, uid);
- QDomNodeList loans = elem_.elementsByTagNameNS(m_namespace, QString::fromLatin1("loan"));
+ TQDomNodeList loans = elem_.elementsByTagNameNS(m_namespace, TQString::tqfromLatin1("loan"));
for(uint i = 0; i < loans.count(); ++i) {
- QDomElement e = loans.item(i).toElement();
+ TQDomElement e = loans.item(i).toElement();
if(e.isNull()) {
continue;
}
- long id = e.attribute(QString::fromLatin1("entryRef")).toLong();
+ long id = e.attribute(TQString::tqfromLatin1("entryRef")).toLong();
Data::EntryPtr entry = m_coll->entryById(id);
if(!entry) {
myDebug() << "TellicoImporter::readBorrower() - no entry with id = " << id << endl;
continue;
}
- QString uid = e.attribute(QString::fromLatin1("uid"));
- QDate loanDate, dueDate;
- QString s = e.attribute(QString::fromLatin1("loanDate"));
+ TQString uid = e.attribute(TQString::tqfromLatin1("uid"));
+ TQDate loanDate, dueDate;
+ TQString s = e.attribute(TQString::tqfromLatin1("loanDate"));
if(!s.isEmpty()) {
- loanDate = QDate::fromString(s, Qt::ISODate);
+ loanDate = TQDate::fromString(s, Qt::ISODate);
}
- s = e.attribute(QString::fromLatin1("dueDate"));
+ s = e.attribute(TQString::tqfromLatin1("dueDate"));
if(!s.isEmpty()) {
- dueDate = QDate::fromString(s, Qt::ISODate);
+ dueDate = TQDate::fromString(s, Qt::ISODate);
}
Data::LoanPtr loan = new Data::Loan(entry, loanDate, dueDate, e.text());
loan->setUID(uid);
b->addLoan(loan);
- s = e.attribute(QString::fromLatin1("calendar"));
+ s = e.attribute(TQString::tqfromLatin1("calendar"));
loan->setInCalendar(s == Latin1Literal("true"));
}
if(!b->isEmpty()) {
@@ -772,11 +772,11 @@ void TellicoImporter::loadZipData() {
m_buffer = 0;
m_zip = new KZip(fileRef().fileName());
} else {
- m_buffer = new QBuffer(data());
- m_zip = new KZip(m_buffer);
+ m_buffer = new TQBuffer(data());
+ m_zip = new KZip(TQT_TQIODEVICE(m_buffer));
}
if(!m_zip->open(IO_ReadOnly)) {
- setStatusMessage(i18n(errorLoad).arg(url().fileName()));
+ setStatusMessage(i18n(errorLoad).tqarg(url().fileName()));
m_format = Error;
delete m_zip;
m_zip = 0;
@@ -787,7 +787,7 @@ void TellicoImporter::loadZipData() {
const KArchiveDirectory* dir = m_zip->directory();
if(!dir) {
- QString str = i18n(errorLoad).arg(url().fileName()) + QChar('\n');
+ TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n');
str += i18n("The file is empty.");
setStatusMessage(str);
m_format = Error;
@@ -800,12 +800,12 @@ void TellicoImporter::loadZipData() {
}
// main file was changed from bookcase.xml to tellico.xml as of version 0.13
- const KArchiveEntry* entry = dir->entry(QString::fromLatin1("tellico.xml"));
+ const KArchiveEntry* entry = dir->entry(TQString::tqfromLatin1("tellico.xml"));
if(!entry) {
- entry = dir->entry(QString::fromLatin1("bookcase.xml"));
+ entry = dir->entry(TQString::tqfromLatin1("bookcase.xml"));
}
if(!entry || !entry->isFile()) {
- QString str = i18n(errorLoad).arg(url().fileName()) + QChar('\n');
+ TQString str = i18n(errorLoad).tqarg(url().fileName()) + TQChar('\n');
str += i18n("The file contains no collection data.");
setStatusMessage(str);
m_format = Error;
@@ -817,7 +817,7 @@ void TellicoImporter::loadZipData() {
return;
}
- const QByteArray xmlData = static_cast<const KArchiveFile*>(entry)->data();
+ const TQByteArray xmlData = static_cast<const KArchiveFile*>(entry)->data();
loadXMLData(xmlData, false);
if(!m_coll) {
m_format = Error;
@@ -838,7 +838,7 @@ void TellicoImporter::loadZipData() {
return;
}
- const KArchiveEntry* imgDirEntry = dir->entry(QString::fromLatin1("images"));
+ const KArchiveEntry* imgDirEntry = dir->entry(TQString::tqfromLatin1("images"));
if(!imgDirEntry || !imgDirEntry->isDirectory()) {
m_zip->close();
delete m_zip;
@@ -858,11 +858,11 @@ void TellicoImporter::loadZipData() {
return;
}
- const QStringList images = static_cast<const KArchiveDirectory*>(imgDirEntry)->entries();
- const uint stepSize = QMAX(s_stepSize, images.count()/100);
+ const TQStringList images = static_cast<const KArchiveDirectory*>(imgDirEntry)->entries();
+ const uint stepSize = TQMAX(s_stepSize, images.count()/100);
uint j = 0;
- for(QStringList::ConstIterator it = images.begin(); !m_cancelled && it != images.end(); ++it, ++j) {
+ for(TQStringList::ConstIterator it = images.begin(); !m_cancelled && it != images.end(); ++it, ++j) {
const KArchiveEntry* file = m_imgDir->entry(*it);
if(file && file->isFile()) {
ImageFactory::addImage(static_cast<const KArchiveFile*>(file)->data(),
@@ -876,11 +876,11 @@ void TellicoImporter::loadZipData() {
if(m_images.isEmpty()) {
// give it some time
- QTimer::singleShot(3000, this, SLOT(deleteLater()));
+ TQTimer::singleShot(3000, this, TQT_SLOT(deleteLater()));
}
}
-bool TellicoImporter::loadImage(const QString& id_) {
+bool TellicoImporter::loadImage(const TQString& id_) {
// myLog() << "TellicoImporter::loadImage() - id = " << id_ << endl;
if(m_format != Zip || !m_imgDir) {
return false;
@@ -889,12 +889,12 @@ bool TellicoImporter::loadImage(const QString& id_) {
if(!file || !file->isFile()) {
return false;
}
- QString newID = ImageFactory::addImage(static_cast<const KArchiveFile*>(file)->data(),
+ TQString newID = ImageFactory::addImage(static_cast<const KArchiveFile*>(file)->data(),
id_.section('.', -1).upper(), id_);
m_images.remove(id_);
if(m_images.isEmpty()) {
// give it some time
- QTimer::singleShot(3000, this, SLOT(deleteLater()));
+ TQTimer::singleShot(3000, this, TQT_SLOT(deleteLater()));
}
return !newID.isEmpty();
}
@@ -913,7 +913,7 @@ bool TellicoImporter::loadAllImages(const KURL& url_) {
KZip zip(url_.path());
if(!zip.open(IO_ReadOnly)) {
if(u != url_) {
- Kernel::self()->sorry(i18n(errorImageLoad).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorImageLoad).tqarg(url_.fileName()));
}
u = url_;
return false;
@@ -922,20 +922,20 @@ bool TellicoImporter::loadAllImages(const KURL& url_) {
const KArchiveDirectory* dir = zip.directory();
if(!dir) {
if(u != url_) {
- Kernel::self()->sorry(i18n(errorImageLoad).arg(url_.fileName()));
+ Kernel::self()->sorry(i18n(errorImageLoad).tqarg(url_.fileName()));
}
u = url_;
zip.close();
return false;
}
- const KArchiveEntry* imgDirEntry = dir->entry(QString::fromLatin1("images"));
+ const KArchiveEntry* imgDirEntry = dir->entry(TQString::tqfromLatin1("images"));
if(!imgDirEntry || !imgDirEntry->isDirectory()) {
zip.close();
return false;
}
- const QStringList images = static_cast<const KArchiveDirectory*>(imgDirEntry)->entries();
- for(QStringList::ConstIterator it = images.begin(); it != images.end(); ++it) {
+ const TQStringList images = static_cast<const KArchiveDirectory*>(imgDirEntry)->entries();
+ for(TQStringList::ConstIterator it = images.begin(); it != images.end(); ++it) {
const KArchiveEntry* file = static_cast<const KArchiveDirectory*>(imgDirEntry)->entry(*it);
if(file && file->isFile()) {
ImageFactory::addImage(static_cast<const KArchiveFile*>(file)->data(),
@@ -949,38 +949,38 @@ bool TellicoImporter::loadAllImages(const KURL& url_) {
void TellicoImporter::addDefaultFilters() {
switch(m_coll->type()) {
case Data::Collection::Book:
- if(m_coll->hasField(QString::fromLatin1("read"))) {
+ if(m_coll->hasField(TQString::tqfromLatin1("read"))) {
FilterPtr f = new Filter(Filter::MatchAny);
f->setName(i18n("Unread Books"));
- f->append(new FilterRule(QString::fromLatin1("read"), QString::fromLatin1("true"), FilterRule::FuncNotContains));
+ f->append(new FilterRule(TQString::tqfromLatin1("read"), TQString::tqfromLatin1("true"), FilterRule::FuncNotContains));
m_coll->addFilter(f);
m_modified = true;
}
break;
case Data::Collection::Video:
- if(m_coll->hasField(QString::fromLatin1("year"))) {
+ if(m_coll->hasField(TQString::tqfromLatin1("year"))) {
FilterPtr f = new Filter(Filter::MatchAny);
f->setName(i18n("Old Movies"));
// old movies from before 1960
- f->append(new FilterRule(QString::fromLatin1("year"), QString::fromLatin1("19[012345]\\d"), FilterRule::FuncRegExp));
+ f->append(new FilterRule(TQString::tqfromLatin1("year"), TQString::tqfromLatin1("19[012345]\\d"), FilterRule::FuncRegExp));
m_coll->addFilter(f);
m_modified = true;
}
- if(m_coll->hasField(QString::fromLatin1("widescreen"))) {
+ if(m_coll->hasField(TQString::tqfromLatin1("widescreen"))) {
FilterPtr f = new Filter(Filter::MatchAny);
f->setName(i18n("Widescreen"));
- f->append(new FilterRule(QString::fromLatin1("widescreen"), QString::fromLatin1("true"), FilterRule::FuncContains));
+ f->append(new FilterRule(TQString::tqfromLatin1("widescreen"), TQString::tqfromLatin1("true"), FilterRule::FuncContains));
m_coll->addFilter(f);
m_modified = true;
}
break;
case Data::Collection::Album:
- if(m_coll->hasField(QString::fromLatin1("year"))) {
+ if(m_coll->hasField(TQString::tqfromLatin1("year"))) {
FilterPtr f = new Filter(Filter::MatchAny);
f->setName(i18n("80's Music"));
- f->append(new FilterRule(QString::fromLatin1("year"), QString::fromLatin1("198\\d"),FilterRule::FuncRegExp));
+ f->append(new FilterRule(TQString::tqfromLatin1("year"), TQString::tqfromLatin1("198\\d"),FilterRule::FuncRegExp));
m_coll->addFilter(f);
m_modified = true;
}
@@ -989,22 +989,22 @@ void TellicoImporter::addDefaultFilters() {
default:
break;
}
- if(m_coll->hasField(QString::fromLatin1("rating"))) {
+ if(m_coll->hasField(TQString::tqfromLatin1("rating"))) {
FilterPtr filter = new Filter(Filter::MatchAny);
filter->setName(i18n("Favorites"));
// check all the numbers, and use top 20% or so
- Data::FieldPtr field = m_coll->fieldByName(QString::fromLatin1("rating"));
+ Data::FieldPtr field = m_coll->fieldByName(TQString::tqfromLatin1("rating"));
bool ok;
- uint min = Tellico::toUInt(field->property(QString::fromLatin1("minimum")), &ok);
+ uint min = Tellico::toUInt(field->property(TQString::tqfromLatin1("minimum")), &ok);
if(!ok) {
min = 1;
}
- uint max = Tellico::toUInt(field->property(QString::fromLatin1("maximum")), &ok);
+ uint max = Tellico::toUInt(field->property(TQString::tqfromLatin1("maximum")), &ok);
if(!ok) {
min = 5;
}
- for(uint i = QMAX(min, static_cast<uint>(0.8*(max-min+1))); i <= max; ++i) {
- filter->append(new FilterRule(QString::fromLatin1("rating"), QString::number(i), FilterRule::FuncContains));
+ for(uint i = TQMAX(min, static_cast<uint>(0.8*(max-min+1))); i <= max; ++i) {
+ filter->append(new FilterRule(TQString::tqfromLatin1("rating"), TQString::number(i), FilterRule::FuncContains));
}
if(!filter->isEmpty()) {
m_coll->addFilter(filter);
diff --git a/src/translators/tellicoimporter.h b/src/translators/tellicoimporter.h
index d4c6e13..a794c8a 100644
--- a/src/translators/tellicoimporter.h
+++ b/src/translators/tellicoimporter.h
@@ -14,7 +14,7 @@
#ifndef TELLICO_IMPORTER_H
#define TELLICO_IMPORTER_H
-class QBuffer;
+class TQBuffer;
class KZip;
class KArchiveDirectory;
@@ -22,7 +22,7 @@ class KArchiveDirectory;
#include "../datavectors.h"
#include "../stringset.h"
-class QDomElement;
+class TQDomElement;
namespace Tellico {
namespace Import {
@@ -34,6 +34,7 @@ namespace Tellico {
*/
class TellicoImporter : public DataImporter {
Q_OBJECT
+ TQ_OBJECT
public:
enum Format { Unknown, Error, XML, Zip, Cancel };
@@ -47,7 +48,7 @@ public:
*
* @param text The text
*/
- TellicoImporter(const QString& text);
+ TellicoImporter(const TQString& text);
virtual ~TellicoImporter();
/**
@@ -61,7 +62,7 @@ public:
Format format() const { return m_format; }
bool hasImages() const { return m_hasImages; }
- bool loadImage(const QString& id_);
+ bool loadImage(const TQString& id_);
static bool loadAllImages(const KURL& url);
@@ -71,26 +72,26 @@ public slots:
private:
static bool versionConversion(uint from, uint to);
- void loadXMLData(const QByteArray& data, bool loadImages);
+ void loadXMLData(const TQByteArray& data, bool loadImages);
void loadZipData();
- void readField(uint syntaxVersion, const QDomElement& elem);
- void readEntry(uint syntaxVersion, const QDomElement& elem);
- void readImage(const QDomElement& elem, bool loadImage);
- void readFilter(const QDomElement& elem);
- void readBorrower(const QDomElement& elem);
+ void readField(uint syntaxVersion, const TQDomElement& elem);
+ void readEntry(uint syntaxVersion, const TQDomElement& elem);
+ void readImage(const TQDomElement& elem, bool loadImage);
+ void readFilter(const TQDomElement& elem);
+ void readBorrower(const TQDomElement& elem);
void addDefaultFilters();
Data::CollPtr m_coll;
bool m_loadAllImages;
- QString m_namespace;
+ TQString m_namespace;
Format m_format;
bool m_modified : 1;
bool m_cancelled : 1;
bool m_hasImages : 1;
StringSet m_images;
- QBuffer* m_buffer;
+ TQBuffer* m_buffer;
KZip* m_zip;
const KArchiveDirectory* m_imgDir;
};
diff --git a/src/translators/tellicoxmlexporter.cpp b/src/translators/tellicoxmlexporter.cpp
index 6335ed1..397366b 100644
--- a/src/translators/tellicoxmlexporter.cpp
+++ b/src/translators/tellicoxmlexporter.cpp
@@ -33,12 +33,12 @@
#include <kglobal.h>
#include <kcalendarsystem.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qcheckbox.h>
-#include <qwhatsthis.h>
-#include <qdom.h>
-#include <qtextcodec.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqcheckbox.h>
+#include <tqwhatsthis.h>
+#include <tqdom.h>
+#include <tqtextcodec.h>
using Tellico::Export::TellicoXMLExporter;
@@ -52,16 +52,16 @@ TellicoXMLExporter::TellicoXMLExporter(Data::CollPtr coll) : Exporter(coll),
setOptions(options() | Export::ExportImages | Export::ExportImageSize); // not included by default
}
-QString TellicoXMLExporter::formatString() const {
+TQString TellicoXMLExporter::formatString() const {
return i18n("XML");
}
-QString TellicoXMLExporter::fileFilter() const {
- return i18n("*.xml|XML Files (*.xml)") + QChar('\n') + i18n("*|All Files");
+TQString TellicoXMLExporter::fileFilter() const {
+ return i18n("*.xml|XML Files (*.xml)") + TQChar('\n') + i18n("*|All Files");
}
bool TellicoXMLExporter::exec() {
- QDomDocument doc = exportXML();
+ TQDomDocument doc = exportXML();
if(doc.isNull()) {
return false;
}
@@ -70,37 +70,37 @@ bool TellicoXMLExporter::exec() {
options() & Export::ExportForce);
}
-QDomDocument TellicoXMLExporter::exportXML() const {
+TQDomDocument TellicoXMLExporter::exportXML() const {
// don't be hard on people with older versions. The only difference with DTD 10 was adding
// a board game collection, so use 9 still unless it's a board game
int exportVersion = (XML::syntaxVersion == 10 && collection()->type() != Data::Collection::BoardGame)
? 9
: XML::syntaxVersion;
- QDomImplementation impl;
- QDomDocumentType doctype = impl.createDocumentType(QString::fromLatin1("tellico"),
+ TQDomImplementation impl;
+ TQDomDocumentType doctype = impl.createDocumentType(TQString::tqfromLatin1("tellico"),
XML::pubTellico(exportVersion),
XML::dtdTellico(exportVersion));
//default namespace
- const QString& ns = XML::nsTellico;
+ const TQString& ns = XML::nsTellico;
- QDomDocument dom = impl.createDocument(ns, QString::fromLatin1("tellico"), doctype);
+ TQDomDocument dom = impl.createDocument(ns, TQString::tqfromLatin1("tellico"), doctype);
// root tellico element
- QDomElement root = dom.documentElement();
+ TQDomElement root = dom.documentElement();
- QString encodeStr = QString::fromLatin1("version=\"1.0\" encoding=\"");
+ TQString encodeStr = TQString::tqfromLatin1("version=\"1.0\" encoding=\"");
if(options() & Export::ExportUTF8) {
- encodeStr += QString::fromLatin1("UTF-8");
+ encodeStr += TQString::tqfromLatin1("UTF-8");
} else {
- encodeStr += QString::fromLatin1(QTextCodec::codecForLocale()->mimeName());
+ encodeStr += TQString::tqfromLatin1(TQTextCodec::codecForLocale()->mimeName());
}
- encodeStr += QChar('"');
+ encodeStr += TQChar('"');
// createDocument creates a root node, insert the processing instruction before it
- dom.insertBefore(dom.createProcessingInstruction(QString::fromLatin1("xml"), encodeStr), root);
+ dom.insertBefore(dom.createProcessingInstruction(TQString::tqfromLatin1("xml"), encodeStr), root);
- root.setAttribute(QString::fromLatin1("syntaxVersion"), exportVersion);
+ root.setAttribute(TQString::tqfromLatin1("syntaxVersion"), exportVersion);
exportCollectionXML(dom, root, options() & Export::ExportFormatted);
@@ -110,22 +110,22 @@ QDomDocument TellicoXMLExporter::exportXML() const {
return dom;
}
-QString TellicoXMLExporter::exportXMLString() const {
+TQString TellicoXMLExporter::exportXMLString() const {
return exportXML().toString();
}
-void TellicoXMLExporter::exportCollectionXML(QDomDocument& dom_, QDomElement& parent_, bool format_) const {
+void TellicoXMLExporter::exportCollectionXML(TQDomDocument& dom_, TQDomElement& tqparent_, bool format_) const {
Data::CollPtr coll = collection();
if(!coll) {
kdWarning() << "TellicoXMLExporter::exportCollectionXML() - no collection pointer!" << endl;
return;
}
- QDomElement collElem = dom_.createElement(QString::fromLatin1("collection"));
- collElem.setAttribute(QString::fromLatin1("type"), coll->type());
- collElem.setAttribute(QString::fromLatin1("title"), coll->title());
+ TQDomElement collElem = dom_.createElement(TQString::tqfromLatin1("collection"));
+ collElem.setAttribute(TQString::tqfromLatin1("type"), coll->type());
+ collElem.setAttribute(TQString::tqfromLatin1("title"), coll->title());
- QDomElement fieldsElem = dom_.createElement(QString::fromLatin1("fields"));
+ TQDomElement fieldsElem = dom_.createElement(TQString::tqfromLatin1("fields"));
collElem.appendChild(fieldsElem);
Data::FieldVec fields = coll->fields();
@@ -136,16 +136,16 @@ void TellicoXMLExporter::exportCollectionXML(QDomDocument& dom_, QDomElement& pa
if(coll->type() == Data::Collection::Bibtex) {
const Data::BibtexCollection* c = static_cast<const Data::BibtexCollection*>(coll.data());
if(!c->preamble().isEmpty()) {
- QDomElement preElem = dom_.createElement(QString::fromLatin1("bibtex-preamble"));
+ TQDomElement preElem = dom_.createElement(TQString::tqfromLatin1("bibtex-preamble"));
preElem.appendChild(dom_.createTextNode(c->preamble()));
collElem.appendChild(preElem);
}
- QDomElement macrosElem = dom_.createElement(QString::fromLatin1("macros"));
+ TQDomElement macrosElem = dom_.createElement(TQString::tqfromLatin1("macros"));
for(StringMap::ConstIterator macroIt = c->macroList().constBegin(); macroIt != c->macroList().constEnd(); ++macroIt) {
if(!macroIt.data().isEmpty()) {
- QDomElement macroElem = dom_.createElement(QString::fromLatin1("macro"));
- macroElem.setAttribute(QString::fromLatin1("name"), macroIt.key());
+ TQDomElement macroElem = dom_.createElement(TQString::tqfromLatin1("macro"));
+ macroElem.setAttribute(TQString::tqfromLatin1("name"), macroIt.key());
macroElem.appendChild(dom_.createTextNode(macroIt.data()));
macrosElem.appendChild(macroElem);
}
@@ -161,10 +161,10 @@ void TellicoXMLExporter::exportCollectionXML(QDomDocument& dom_, QDomElement& pa
}
if(!m_images.isEmpty() && (options() & Export::ExportImages)) {
- QDomElement imgsElem = dom_.createElement(QString::fromLatin1("images"));
+ TQDomElement imgsElem = dom_.createElement(TQString::tqfromLatin1("images"));
collElem.appendChild(imgsElem);
- const QStringList imageIds = m_images.toList();
- for(QStringList::ConstIterator it = imageIds.begin(); it != imageIds.end(); ++it) {
+ const TQStringList imageIds = m_images.toList();
+ for(TQStringList::ConstIterator it = imageIds.begin(); it != imageIds.end(); ++it) {
exportImageXML(dom_, imgsElem, *it);
}
}
@@ -173,74 +173,74 @@ void TellicoXMLExporter::exportCollectionXML(QDomDocument& dom_, QDomElement& pa
exportGroupXML(dom_, collElem);
}
- parent_.appendChild(collElem);
+ tqparent_.appendChild(collElem);
// the borrowers and filters are in the tellico object, not the collection
if(options() & Export::ExportComplete) {
- QDomElement bElem = dom_.createElement(QString::fromLatin1("borrowers"));
+ TQDomElement bElem = dom_.createElement(TQString::tqfromLatin1("borrowers"));
Data::BorrowerVec borrowers = coll->borrowers();
for(Data::BorrowerVec::Iterator bIt = borrowers.begin(); bIt != borrowers.end(); ++bIt) {
exportBorrowerXML(dom_, bElem, bIt);
}
if(bElem.hasChildNodes()) {
- parent_.appendChild(bElem);
+ tqparent_.appendChild(bElem);
}
- QDomElement fElem = dom_.createElement(QString::fromLatin1("filters"));
+ TQDomElement fElem = dom_.createElement(TQString::tqfromLatin1("filters"));
FilterVec filters = coll->filters();
for(FilterVec::Iterator fIt = filters.begin(); fIt != filters.end(); ++fIt) {
exportFilterXML(dom_, fElem, fIt);
}
if(fElem.hasChildNodes()) {
- parent_.appendChild(fElem);
+ tqparent_.appendChild(fElem);
}
}
}
-void TellicoXMLExporter::exportFieldXML(QDomDocument& dom_, QDomElement& parent_, Data::FieldPtr field_) const {
- QDomElement elem = dom_.createElement(QString::fromLatin1("field"));
+void TellicoXMLExporter::exportFieldXML(TQDomDocument& dom_, TQDomElement& tqparent_, Data::FieldPtr field_) const {
+ TQDomElement elem = dom_.createElement(TQString::tqfromLatin1("field"));
- elem.setAttribute(QString::fromLatin1("name"), field_->name());
- elem.setAttribute(QString::fromLatin1("title"), field_->title());
- elem.setAttribute(QString::fromLatin1("category"), field_->category());
- elem.setAttribute(QString::fromLatin1("type"), field_->type());
- elem.setAttribute(QString::fromLatin1("flags"), field_->flags());
- elem.setAttribute(QString::fromLatin1("format"), field_->formatFlag());
+ elem.setAttribute(TQString::tqfromLatin1("name"), field_->name());
+ elem.setAttribute(TQString::tqfromLatin1("title"), field_->title());
+ elem.setAttribute(TQString::tqfromLatin1("category"), field_->category());
+ elem.setAttribute(TQString::tqfromLatin1("type"), field_->type());
+ elem.setAttribute(TQString::tqfromLatin1("flags"), field_->flags());
+ elem.setAttribute(TQString::tqfromLatin1("format"), field_->formatFlag());
if(field_->type() == Data::Field::Choice) {
- elem.setAttribute(QString::fromLatin1("allowed"), field_->allowed().join(QString::fromLatin1(";")));
+ elem.setAttribute(TQString::tqfromLatin1("allowed"), field_->allowed().join(TQString::tqfromLatin1(";")));
}
// only save description if it's not equal to title, which is the default
// title is never empty, so this indirectly checks for empty descriptions
if(field_->description() != field_->title()) {
- elem.setAttribute(QString::fromLatin1("description"), field_->description());
+ elem.setAttribute(TQString::tqfromLatin1("description"), field_->description());
}
for(StringMap::ConstIterator it = field_->propertyList().begin(); it != field_->propertyList().end(); ++it) {
if(it.data().isEmpty()) {
continue;
}
- QDomElement e = dom_.createElement(QString::fromLatin1("prop"));
- e.setAttribute(QString::fromLatin1("name"), it.key());
+ TQDomElement e = dom_.createElement(TQString::tqfromLatin1("prop"));
+ e.setAttribute(TQString::tqfromLatin1("name"), it.key());
e.appendChild(dom_.createTextNode(it.data()));
elem.appendChild(e);
}
- parent_.appendChild(elem);
+ tqparent_.appendChild(elem);
}
-void TellicoXMLExporter::exportEntryXML(QDomDocument& dom_, QDomElement& parent_, Data::EntryPtr entry_, bool format_) const {
- QDomElement entryElem = dom_.createElement(QString::fromLatin1("entry"));
- entryElem.setAttribute(QString::fromLatin1("id"), entry_->id());
+void TellicoXMLExporter::exportEntryXML(TQDomDocument& dom_, TQDomElement& tqparent_, Data::EntryPtr entry_, bool format_) const {
+ TQDomElement entryElem = dom_.createElement(TQString::tqfromLatin1("entry"));
+ entryElem.setAttribute(TQString::tqfromLatin1("id"), entry_->id());
// iterate through every field for the entry
Data::FieldVec fields = entry_->collection()->fields();
for(Data::FieldVec::Iterator fIt = fields.begin(); fIt != fields.end(); ++fIt) {
- QString fieldName = fIt->name();
+ TQString fieldName = fIt->name();
// Date fields are special, don't format in export
- QString fieldValue = (format_ && fIt->type() != Data::Field::Date) ? entry_->formattedField(fieldName)
+ TQString fieldValue = (format_ && fIt->type() != Data::Field::Date) ? entry_->formattedField(fieldName)
: entry_->field(fieldName);
if(options() & ExportClean) {
BibtexHandler::cleanText(fieldValue);
@@ -262,30 +262,30 @@ void TellicoXMLExporter::exportEntryXML(QDomDocument& dom_, QDomElement& parent_
// if multiple versions are allowed, split them into separate elements
if(fIt->flags() & Data::Field::AllowMultiple) {
- // parent element if field contains multiple values, child of entryElem
+ // tqparent element if field contains multiple values, child of entryElem
// who cares about grammar, just add an 's' to the name
- QDomElement parElem = dom_.createElement(fieldName + 's');
+ TQDomElement parElem = dom_.createElement(fieldName + 's');
entryElem.appendChild(parElem);
// the space after the semi-colon is enforced when the field is set for the entry
- QStringList fields = QStringList::split(QString::fromLatin1("; "), fieldValue, true);
- for(QStringList::ConstIterator it = fields.begin(); it != fields.end(); ++it) {
+ TQStringList fields = TQStringList::split(TQString::tqfromLatin1("; "), fieldValue, true);
+ for(TQStringList::ConstIterator it = fields.begin(); it != fields.end(); ++it) {
// element for field value, child of either entryElem or ParentElem
- QDomElement fieldElem = dom_.createElement(fieldName);
+ TQDomElement fieldElem = dom_.createElement(fieldName);
// special case for multi-column tables
int ncols = 0;
if(fIt->type() == Data::Field::Table) {
bool ok;
- ncols = Tellico::toUInt(fIt->property(QString::fromLatin1("columns")), &ok);
+ ncols = Tellico::toUInt(fIt->property(TQString::tqfromLatin1("columns")), &ok);
if(!ok) {
ncols = 1;
}
}
if(ncols > 1) {
for(int col = 0; col < ncols; ++col) {
- QDomElement elem;
- elem = dom_.createElement(QString::fromLatin1("column"));
- elem.appendChild(dom_.createTextNode((*it).section(QString::fromLatin1("::"), col, col)));
+ TQDomElement elem;
+ elem = dom_.createElement(TQString::tqfromLatin1("column"));
+ elem.appendChild(dom_.createTextNode((*it).section(TQString::tqfromLatin1("::"), col, col)));
fieldElem.appendChild(elem);
}
} else {
@@ -294,29 +294,29 @@ void TellicoXMLExporter::exportEntryXML(QDomDocument& dom_, QDomElement& parent_
parElem.appendChild(fieldElem);
}
} else {
- QDomElement fieldElem = dom_.createElement(fieldName);
+ TQDomElement fieldElem = dom_.createElement(fieldName);
entryElem.appendChild(fieldElem);
// Date fields get special treatment
if(fIt->type() == Data::Field::Date) {
- fieldElem.setAttribute(QString::fromLatin1("calendar"), KGlobal::locale()->calendar()->calendarName());
- QStringList s = QStringList::split('-', fieldValue, true);
+ fieldElem.setAttribute(TQString::tqfromLatin1("calendar"), KGlobal::locale()->calendar()->calendarName());
+ TQStringList s = TQStringList::split('-', fieldValue, true);
if(s.count() > 0 && !s[0].isEmpty()) {
- QDomElement e = dom_.createElement(QString::fromLatin1("year"));
+ TQDomElement e = dom_.createElement(TQString::tqfromLatin1("year"));
fieldElem.appendChild(e);
e.appendChild(dom_.createTextNode(s[0]));
}
if(s.count() > 1 && !s[1].isEmpty()) {
- QDomElement e = dom_.createElement(QString::fromLatin1("month"));
+ TQDomElement e = dom_.createElement(TQString::tqfromLatin1("month"));
fieldElem.appendChild(e);
e.appendChild(dom_.createTextNode(s[1]));
}
if(s.count() > 2 && !s[2].isEmpty()) {
- QDomElement e = dom_.createElement(QString::fromLatin1("day"));
+ TQDomElement e = dom_.createElement(TQString::tqfromLatin1("day"));
fieldElem.appendChild(e);
e.appendChild(dom_.createTextNode(s[2]));
}
} else if(fIt->type() == Data::Field::URL &&
- fIt->property(QString::fromLatin1("relative")) == Latin1Literal("true") &&
+ fIt->property(TQString::tqfromLatin1("relative")) == Latin1Literal("true") &&
!url().isEmpty()) {
// if a relative URL and url() is not empty, change the value!
KURL old_url(Kernel::self()->URL(), fieldValue);
@@ -333,105 +333,105 @@ void TellicoXMLExporter::exportEntryXML(QDomDocument& dom_, QDomElement& parent_
}
} // end field loop
- parent_.appendChild(entryElem);
+ tqparent_.appendChild(entryElem);
}
-void TellicoXMLExporter::exportImageXML(QDomDocument& dom_, QDomElement& parent_, const QString& id_) const {
+void TellicoXMLExporter::exportImageXML(TQDomDocument& dom_, TQDomElement& tqparent_, const TQString& id_) const {
if(id_.isEmpty()) {
myDebug() << "TellicoXMLExporter::exportImageXML() - empty image!" << endl;
return;
}
// myLog() << "TellicoXMLExporter::exportImageXML() - id = " << id_ << endl;
- QDomElement imgElem = dom_.createElement(QString::fromLatin1("image"));
+ TQDomElement imgElem = dom_.createElement(TQString::tqfromLatin1("image"));
if(m_includeImages) {
const Data::Image& img = ImageFactory::imageById(id_);
if(img.isNull()) {
myDebug() << "TellicoXMLExporter::exportImageXML() - null image - " << id_ << endl;
return;
}
- imgElem.setAttribute(QString::fromLatin1("format"), img.format());
- imgElem.setAttribute(QString::fromLatin1("id"), img.id());
- imgElem.setAttribute(QString::fromLatin1("width"), img.width());
- imgElem.setAttribute(QString::fromLatin1("height"), img.height());
+ imgElem.setAttribute(TQString::tqfromLatin1("format"), img.format().data());
+ imgElem.setAttribute(TQString::tqfromLatin1("id"), img.id());
+ imgElem.setAttribute(TQString::tqfromLatin1("width"), img.width());
+ imgElem.setAttribute(TQString::tqfromLatin1("height"), img.height());
if(img.linkOnly()) {
- imgElem.setAttribute(QString::fromLatin1("link"), QString::fromLatin1("true"));
+ imgElem.setAttribute(TQString::tqfromLatin1("link"), TQString::tqfromLatin1("true"));
}
- QCString imgText = KCodecs::base64Encode(img.byteArray());
- imgElem.appendChild(dom_.createTextNode(QString::fromLatin1(imgText)));
+ TQCString imgText = KCodecs::base64Encode(img.byteArray());
+ imgElem.appendChild(dom_.createTextNode(TQString::tqfromLatin1(imgText)));
} else {
const Data::ImageInfo& info = ImageFactory::imageInfo(id_);
if(info.isNull()) {
return;
}
- imgElem.setAttribute(QString::fromLatin1("format"), info.format);
- imgElem.setAttribute(QString::fromLatin1("id"), info.id);
+ imgElem.setAttribute(TQString::tqfromLatin1("format"), info.format.data());
+ imgElem.setAttribute(TQString::tqfromLatin1("id"), info.id);
// only load the images to read the size if necessary
const bool loadImageIfNecessary = options() & Export::ExportImageSize;
- imgElem.setAttribute(QString::fromLatin1("width"), info.width(loadImageIfNecessary));
- imgElem.setAttribute(QString::fromLatin1("height"), info.height(loadImageIfNecessary));
+ imgElem.setAttribute(TQString::tqfromLatin1("width"), info.width(loadImageIfNecessary));
+ imgElem.setAttribute(TQString::tqfromLatin1("height"), info.height(loadImageIfNecessary));
if(info.linkOnly) {
- imgElem.setAttribute(QString::fromLatin1("link"), QString::fromLatin1("true"));
+ imgElem.setAttribute(TQString::tqfromLatin1("link"), TQString::tqfromLatin1("true"));
}
}
- parent_.appendChild(imgElem);
+ tqparent_.appendChild(imgElem);
}
-void TellicoXMLExporter::exportGroupXML(QDomDocument& dom_, QDomElement& parent_) const {
- Data::EntryVec vec = entries(); // need a copy for ::contains();
+void TellicoXMLExporter::exportGroupXML(TQDomDocument& dom_, TQDomElement& tqparent_) const {
+ Data::EntryVec vec = entries(); // need a copy for ::tqcontains();
bool exportAll = collection()->entries().count() == vec.count();
- // iterate over each group, which are the first children
+ // iterate over each group, which are the first tqchildren
for(GroupIterator gIt = Controller::self()->groupIterator(); gIt.group(); ++gIt) {
if(gIt.group()->isEmpty()) {
continue;
}
- QDomElement groupElem = dom_.createElement(QString::fromLatin1("group"));
- groupElem.setAttribute(QString::fromLatin1("title"), gIt.group()->groupName());
+ TQDomElement groupElem = dom_.createElement(TQString::tqfromLatin1("group"));
+ groupElem.setAttribute(TQString::tqfromLatin1("title"), gIt.group()->groupName());
// now iterate over all entry items in the group
Data::EntryVec sorted = Data::Document::self()->sortEntries(*gIt.group());
for(Data::EntryVec::Iterator eIt = sorted.begin(); eIt != sorted.end(); ++eIt) {
- if(!exportAll && !vec.contains(eIt)) {
+ if(!exportAll && !vec.tqcontains(eIt)) {
continue;
}
- QDomElement entryRefElem = dom_.createElement(QString::fromLatin1("entryRef"));
- entryRefElem.setAttribute(QString::fromLatin1("id"), eIt->id());
+ TQDomElement entryRefElem = dom_.createElement(TQString::tqfromLatin1("entryRef"));
+ entryRefElem.setAttribute(TQString::tqfromLatin1("id"), eIt->id());
groupElem.appendChild(entryRefElem);
}
if(groupElem.hasChildNodes()) {
- parent_.appendChild(groupElem);
+ tqparent_.appendChild(groupElem);
}
}
}
-void TellicoXMLExporter::exportFilterXML(QDomDocument& dom_, QDomElement& parent_, FilterPtr filter_) const {
- QDomElement filterElem = dom_.createElement(QString::fromLatin1("filter"));
- filterElem.setAttribute(QString::fromLatin1("name"), filter_->name());
+void TellicoXMLExporter::exportFilterXML(TQDomDocument& dom_, TQDomElement& tqparent_, FilterPtr filter_) const {
+ TQDomElement filterElem = dom_.createElement(TQString::tqfromLatin1("filter"));
+ filterElem.setAttribute(TQString::tqfromLatin1("name"), filter_->name());
- QString match = (filter_->op() == Filter::MatchAll) ? QString::fromLatin1("all") : QString::fromLatin1("any");
- filterElem.setAttribute(QString::fromLatin1("match"), match);
+ TQString match = (filter_->op() == Filter::MatchAll) ? TQString::tqfromLatin1("all") : TQString::tqfromLatin1("any");
+ filterElem.setAttribute(TQString::tqfromLatin1("match"), match);
- for(QPtrListIterator<FilterRule> it(*filter_); it.current(); ++it) {
- QDomElement ruleElem = dom_.createElement(QString::fromLatin1("rule"));
- ruleElem.setAttribute(QString::fromLatin1("field"), it.current()->fieldName());
- ruleElem.setAttribute(QString::fromLatin1("pattern"), it.current()->pattern());
+ for(TQPtrListIterator<FilterRule> it(*filter_); it.current(); ++it) {
+ TQDomElement ruleElem = dom_.createElement(TQString::tqfromLatin1("rule"));
+ ruleElem.setAttribute(TQString::tqfromLatin1("field"), it.current()->fieldName());
+ ruleElem.setAttribute(TQString::tqfromLatin1("pattern"), it.current()->pattern());
switch(it.current()->function()) {
case FilterRule::FuncContains:
- ruleElem.setAttribute(QString::fromLatin1("function"), QString::fromLatin1("contains"));
+ ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("tqcontains"));
break;
case FilterRule::FuncNotContains:
- ruleElem.setAttribute(QString::fromLatin1("function"), QString::fromLatin1("notcontains"));
+ ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("nottqcontains"));
break;
case FilterRule::FuncEquals:
- ruleElem.setAttribute(QString::fromLatin1("function"), QString::fromLatin1("equals"));
+ ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("equals"));
break;
case FilterRule::FuncNotEquals:
- ruleElem.setAttribute(QString::fromLatin1("function"), QString::fromLatin1("notequals"));
+ ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("notequals"));
break;
case FilterRule::FuncRegExp:
- ruleElem.setAttribute(QString::fromLatin1("function"), QString::fromLatin1("regexp"));
+ ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("regexp"));
break;
case FilterRule::FuncNotRegExp:
- ruleElem.setAttribute(QString::fromLatin1("function"), QString::fromLatin1("notregexp"));
+ ruleElem.setAttribute(TQString::tqfromLatin1("function"), TQString::tqfromLatin1("notregexp"));
break;
default:
kdWarning() << "TellicoXMLExporter::exportFilterXML() - no matching rule function!" << endl;
@@ -439,66 +439,66 @@ void TellicoXMLExporter::exportFilterXML(QDomDocument& dom_, QDomElement& parent
filterElem.appendChild(ruleElem);
}
- parent_.appendChild(filterElem);
+ tqparent_.appendChild(filterElem);
}
-void TellicoXMLExporter::exportBorrowerXML(QDomDocument& dom_, QDomElement& parent_,
+void TellicoXMLExporter::exportBorrowerXML(TQDomDocument& dom_, TQDomElement& tqparent_,
Data::BorrowerPtr borrower_) const {
if(borrower_->isEmpty()) {
return;
}
- QDomElement bElem = dom_.createElement(QString::fromLatin1("borrower"));
- parent_.appendChild(bElem);
+ TQDomElement bElem = dom_.createElement(TQString::tqfromLatin1("borrower"));
+ tqparent_.appendChild(bElem);
- bElem.setAttribute(QString::fromLatin1("name"), borrower_->name());
- bElem.setAttribute(QString::fromLatin1("uid"), borrower_->uid());
+ bElem.setAttribute(TQString::tqfromLatin1("name"), borrower_->name());
+ bElem.setAttribute(TQString::tqfromLatin1("uid"), borrower_->uid());
const Data::LoanVec& loans = borrower_->loans();
for(Data::LoanVec::ConstIterator it = loans.constBegin(); it != loans.constEnd(); ++it) {
- QDomElement lElem = dom_.createElement(QString::fromLatin1("loan"));
+ TQDomElement lElem = dom_.createElement(TQString::tqfromLatin1("loan"));
bElem.appendChild(lElem);
- lElem.setAttribute(QString::fromLatin1("uid"), it->uid());
- lElem.setAttribute(QString::fromLatin1("entryRef"), it->entry()->id());
- lElem.setAttribute(QString::fromLatin1("loanDate"), it->loanDate().toString(Qt::ISODate));
- lElem.setAttribute(QString::fromLatin1("dueDate"), it->dueDate().toString(Qt::ISODate));
+ lElem.setAttribute(TQString::tqfromLatin1("uid"), it->uid());
+ lElem.setAttribute(TQString::tqfromLatin1("entryRef"), it->entry()->id());
+ lElem.setAttribute(TQString::tqfromLatin1("loanDate"), it->loanDate().toString(Qt::ISODate));
+ lElem.setAttribute(TQString::tqfromLatin1("dueDate"), it->dueDate().toString(Qt::ISODate));
if(it->inCalendar()) {
- lElem.setAttribute(QString::fromLatin1("calendar"), QString::fromLatin1("true"));
+ lElem.setAttribute(TQString::tqfromLatin1("calendar"), TQString::tqfromLatin1("true"));
}
lElem.appendChild(dom_.createTextNode(it->note()));
}
}
-QWidget* TellicoXMLExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
- if(m_widget && m_widget->parent() == parent_) {
+TQWidget* TellicoXMLExporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) {
+ if(m_widget && TQT_BASE_OBJECT(m_widget->tqparent()) == TQT_BASE_OBJECT(tqparent_)) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* box = new QGroupBox(1, Qt::Horizontal, i18n("Tellico XML Options"), m_widget);
+ TQGroupBox* box = new TQGroupBox(1, Qt::Horizontal, i18n("Tellico XML Options"), m_widget);
l->addWidget(box);
- m_checkIncludeImages = new QCheckBox(i18n("Include images in XML document"), box);
+ m_checkIncludeImages = new TQCheckBox(i18n("Include images in XML document"), box);
m_checkIncludeImages->setChecked(m_includeImages);
- QWhatsThis::add(m_checkIncludeImages, i18n("If checked, the images in the document will be included "
+ TQWhatsThis::add(m_checkIncludeImages, i18n("If checked, the images in the document will be included "
"in the XML stream as base64 encoded elements."));
return m_widget;
}
void TellicoXMLExporter::readOptions(KConfig* config_) {
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
m_includeImages = group.readBoolEntry("Include Images", m_includeImages);
}
void TellicoXMLExporter::saveOptions(KConfig* config_) {
m_includeImages = m_checkIncludeImages->isChecked();
- KConfigGroup group(config_, QString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ KConfigGroup group(config_, TQString::tqfromLatin1("ExportOptions - %1").tqarg(formatString()));
group.writeEntry("Include Images", m_includeImages);
}
diff --git a/src/translators/tellicoxmlexporter.h b/src/translators/tellicoxmlexporter.h
index 705c2dc..1fe4f43 100644
--- a/src/translators/tellicoxmlexporter.h
+++ b/src/translators/tellicoxmlexporter.h
@@ -18,9 +18,9 @@ namespace Tellico {
class Filter;
}
-class QDomDocument;
-class QDomElement;
-class QCheckBox;
+class TQDomDocument;
+class TQDomElement;
+class TQCheckBox;
#include "exporter.h"
#include "../stringset.h"
@@ -33,22 +33,23 @@ namespace Tellico {
*/
class TellicoXMLExporter : public Exporter {
Q_OBJECT
+ TQ_OBJECT
public:
TellicoXMLExporter();
TellicoXMLExporter(Data::CollPtr coll);
virtual bool exec();
- virtual QString formatString() const;
- virtual QString fileFilter() const;
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const;
- QDomDocument exportXML() const;
- QString exportXMLString() const;
+ TQDomDocument exportXML() const;
+ TQString exportXMLString() const;
void setIncludeImages(bool b) { m_includeImages = b; }
void setIncludeGroups(bool b) { m_includeGroups = b; }
- virtual QWidget* widget(QWidget*, const char*);
+ virtual TQWidget* widget(TQWidget*, const char*);
virtual void readOptions(KConfig* cfg);
virtual void saveOptions(KConfig* cfg);
@@ -58,21 +59,21 @@ public:
static const unsigned syntaxVersion;
private:
- void exportCollectionXML(QDomDocument& doc, QDomElement& parent, bool format) const;
- void exportFieldXML(QDomDocument& doc, QDomElement& parent, Data::FieldPtr field) const;
- void exportEntryXML(QDomDocument& doc, QDomElement& parent, Data::EntryPtr entry, bool format) const;
- void exportImageXML(QDomDocument& doc, QDomElement& parent, const QString& imageID) const;
- void exportGroupXML(QDomDocument& doc, QDomElement& parent) const;
- void exportFilterXML(QDomDocument& doc, QDomElement& parent, FilterPtr filter) const;
- void exportBorrowerXML(QDomDocument& doc, QDomElement& parent, Data::BorrowerPtr borrower) const;
+ void exportCollectionXML(TQDomDocument& doc, TQDomElement& tqparent, bool format) const;
+ void exportFieldXML(TQDomDocument& doc, TQDomElement& tqparent, Data::FieldPtr field) const;
+ void exportEntryXML(TQDomDocument& doc, TQDomElement& tqparent, Data::EntryPtr entry, bool format) const;
+ void exportImageXML(TQDomDocument& doc, TQDomElement& tqparent, const TQString& imageID) const;
+ void exportGroupXML(TQDomDocument& doc, TQDomElement& tqparent) const;
+ void exportFilterXML(TQDomDocument& doc, TQDomElement& tqparent, FilterPtr filter) const;
+ void exportBorrowerXML(TQDomDocument& doc, TQDomElement& tqparent, Data::BorrowerPtr borrower) const;
// keep track of which images were written, since some entries could have same image
mutable StringSet m_images;
bool m_includeImages : 1;
bool m_includeGroups : 1;
- QWidget* m_widget;
- QCheckBox* m_checkIncludeImages;
+ TQWidget* m_widget;
+ TQCheckBox* m_checkIncludeImages;
};
} // end namespace
diff --git a/src/translators/tellicozipexporter.cpp b/src/translators/tellicozipexporter.cpp
index 42e0e70..582003f 100644
--- a/src/translators/tellicozipexporter.cpp
+++ b/src/translators/tellicozipexporter.cpp
@@ -26,17 +26,17 @@
#include <kzip.h>
#include <kapplication.h>
-#include <qdom.h>
-#include <qbuffer.h>
+#include <tqdom.h>
+#include <tqbuffer.h>
using Tellico::Export::TellicoZipExporter;
-QString TellicoZipExporter::formatString() const {
+TQString TellicoZipExporter::formatString() const {
return i18n("Tellico Zip File");
}
-QString TellicoZipExporter::fileFilter() const {
- return i18n("*.tc *.bc|Tellico Files (*.tc)") + QChar('\n') + i18n("*|All Files");
+TQString TellicoZipExporter::fileFilter() const {
+ return i18n("*.tc *.bc|Tellico Files (*.tc)") + TQChar('\n') + i18n("*|All Files");
}
bool TellicoZipExporter::exec() {
@@ -47,9 +47,9 @@ bool TellicoZipExporter::exec() {
}
// TODO: maybe need label?
- ProgressItem& item = ProgressManager::self()->newProgressItem(this, QString::null, true);
+ ProgressItem& item = ProgressManager::self()->newProgressItem(this, TQString(), true);
item.setTotalSteps(100);
- connect(&item, SIGNAL(signalCancelled(ProgressItem*)), SLOT(slotCancel()));
+ connect(&item, TQT_SIGNAL(signalCancelled(ProgressItem*)), TQT_SLOT(slotCancel()));
ProgressItem::Done done(this);
TellicoXMLExporter exp;
@@ -61,33 +61,33 @@ bool TellicoZipExporter::exec() {
opt &= ~Export::ExportProgress; // don't show progress for xml export
exp.setOptions(opt);
exp.setIncludeImages(false); // do not include the images themselves in XML
- QCString xml = exp.exportXML().toCString(); // encoded in utf-8
+ TQCString xml = exp.exportXML().toCString(); // encoded in utf-8
ProgressManager::self()->setProgress(this, 5);
- QByteArray data;
- QBuffer buf(data);
+ TQByteArray data;
+ TQBuffer buf(data);
if(m_cancelled) {
return true; // intentionally cancelled
}
- KZip zip(&buf);
+ KZip zip(TQT_TQIODEVICE(&buf));
zip.open(IO_WriteOnly);
- zip.writeFile(QString::fromLatin1("tellico.xml"), QString::null, QString::null, xml.length(), xml);
+ zip.writeFile(TQString::tqfromLatin1("tellico.xml"), TQString(), TQString(), xml.length(), xml);
if(m_includeImages) {
ProgressManager::self()->setProgress(this, 10);
// gonna be lazy and just increment progress every 3 images
// it might be less, might be more
uint j = 0;
- const QString imagesDir = QString::fromLatin1("images/");
+ const TQString imagesDir = TQString::tqfromLatin1("images/");
StringSet imageSet;
Data::FieldVec imageFields = coll->imageFields();
// already took 10%, only 90% left
- const uint stepSize = QMAX(1, (coll->entryCount() * imageFields.count()) / 90);
+ const uint stepSize = TQMAX(1, (coll->entryCount() * imageFields.count()) / 90);
for(Data::EntryVec::ConstIterator it = entries().begin(); it != entries().end() && !m_cancelled; ++it) {
for(Data::FieldVec::Iterator fIt = imageFields.begin(); fIt != imageFields.end(); ++fIt, ++j) {
- const QString id = it->field(fIt);
+ const TQString id = it->field(fIt);
if(id.isEmpty() || imageSet.has(id)) {
continue;
}
@@ -103,12 +103,12 @@ bool TellicoZipExporter::exec() {
kdWarning() << "...for the entry titled " << it->title() << endl;
continue;
}
- QByteArray ba = img.byteArray();
+ TQByteArray ba = img.byteArray();
// myDebug() << "TellicoZipExporter::data() - adding image id = " << it->field(fIt) << endl;
- zip.writeFile(imagesDir + id, QString::null, QString::null, ba.size(), ba);
+ zip.writeFile(imagesDir + id, TQString(), TQString(), ba.size(), ba);
imageSet.add(id);
if(j%stepSize == 0) {
- ProgressManager::self()->setProgress(this, QMIN(10+j/stepSize, 99));
+ ProgressManager::self()->setProgress(this, TQMIN(10+j/stepSize, 99));
kapp->processEvents();
}
}
diff --git a/src/translators/tellicozipexporter.h b/src/translators/tellicozipexporter.h
index da167d5..2e62c1d 100644
--- a/src/translators/tellicozipexporter.h
+++ b/src/translators/tellicozipexporter.h
@@ -24,16 +24,17 @@ namespace Tellico {
*/
class TellicoZipExporter : public Exporter {
Q_OBJECT
+ TQ_OBJECT
public:
TellicoZipExporter() : Exporter(), m_includeImages(true), m_cancelled(false) {}
virtual bool exec();
- virtual QString formatString() const;
- virtual QString fileFilter() const;
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const;
// no options
- virtual QWidget* widget(QWidget*, const char*) { return 0; }
+ virtual TQWidget* widget(TQWidget*, const char*) { return 0; }
void setIncludeImages(bool b) { m_includeImages = b; }
diff --git a/src/translators/textimporter.cpp b/src/translators/textimporter.cpp
index 3130a0f..341a874 100644
--- a/src/translators/textimporter.cpp
+++ b/src/translators/textimporter.cpp
@@ -23,7 +23,7 @@ TextImporter::TextImporter(const KURL& url_, bool useUTF8_)
}
}
-TextImporter::TextImporter(const QString& text_) : Import::Importer(text_) {
+TextImporter::TextImporter(const TQString& text_) : Import::Importer(text_) {
}
#include "textimporter.moc"
diff --git a/src/translators/textimporter.h b/src/translators/textimporter.h
index c4500e5..4f68b90 100644
--- a/src/translators/textimporter.h
+++ b/src/translators/textimporter.h
@@ -26,6 +26,7 @@ namespace Tellico {
*/
class TextImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -34,7 +35,7 @@ public:
* @param url The file to be imported
*/
TextImporter(const KURL& url, bool useUTF8_=false);
- TextImporter(const QString& text);
+ TextImporter(const TQString& text);
};
} // end namespace
diff --git a/src/translators/xmlimporter.cpp b/src/translators/xmlimporter.cpp
index ce345c4..99cf002 100644
--- a/src/translators/xmlimporter.cpp
+++ b/src/translators/xmlimporter.cpp
@@ -25,42 +25,42 @@ XMLImporter::XMLImporter(const KURL& url_) : Import::Importer(url_) {
}
}
-XMLImporter::XMLImporter(const QString& text_) : Import::Importer(text_) {
+XMLImporter::XMLImporter(const TQString& text_) : Import::Importer(text_) {
if(text_.isEmpty()) {
return;
}
setText(text_);
}
-XMLImporter::XMLImporter(const QByteArray& data_) : Import::Importer(KURL()) {
+XMLImporter::XMLImporter(const TQByteArray& data_) : Import::Importer(KURL()) {
if(data_.isEmpty()) {
return;
}
- QString errorMsg;
+ TQString errorMsg;
int errorLine, errorColumn;
if(!m_dom.setContent(data_, true, &errorMsg, &errorLine, &errorColumn)) {
- QString str = i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn);
- str += QString::fromLatin1("\n");
- str += i18n("The error message from Qt is:");
- str += QString::fromLatin1("\n\t") + errorMsg;
+ TQString str = i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn);
+ str += TQString::tqfromLatin1("\n");
+ str += i18n("The error message from TQt is:");
+ str += TQString::tqfromLatin1("\n\t") + errorMsg;
setStatusMessage(str);
return;
}
}
-XMLImporter::XMLImporter(const QDomDocument& dom_) : Import::Importer(KURL()), m_dom(dom_) {
+XMLImporter::XMLImporter(const TQDomDocument& dom_) : Import::Importer(KURL()), m_dom(dom_) {
}
-void XMLImporter::setText(const QString& text_) {
+void XMLImporter::setText(const TQString& text_) {
Importer::setText(text_);
- QString errorMsg;
+ TQString errorMsg;
int errorLine, errorColumn;
if(!m_dom.setContent(text_, true, &errorMsg, &errorLine, &errorColumn)) {
- QString str = i18n("There is an XML parsing error in line %1, column %2.").arg(errorLine).arg(errorColumn);
- str += QString::fromLatin1("\n");
- str += i18n("The error message from Qt is:");
- str += QString::fromLatin1("\n\t") + errorMsg;
+ TQString str = i18n("There is an XML parsing error in line %1, column %2.").tqarg(errorLine).tqarg(errorColumn);
+ str += TQString::tqfromLatin1("\n");
+ str += i18n("The error message from TQt is:");
+ str += TQString::tqfromLatin1("\n\t") + errorMsg;
setStatusMessage(str);
}
}
diff --git a/src/translators/xmlimporter.h b/src/translators/xmlimporter.h
index 743a1c1..e544a17 100644
--- a/src/translators/xmlimporter.h
+++ b/src/translators/xmlimporter.h
@@ -16,7 +16,7 @@
#include "importer.h"
-#include <qdom.h>
+#include <tqdom.h>
namespace Tellico {
namespace Import {
@@ -28,6 +28,7 @@ namespace Tellico {
*/
class XMLImporter : public Importer {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -41,16 +42,16 @@ public:
*
* @param text The text
*/
- XMLImporter(const QString& text);
+ XMLImporter(const TQString& text);
/**
* Imports xml text from a byte array.
*
* @param data The Data
*/
- XMLImporter(const QByteArray& data);
- XMLImporter(const QDomDocument& dom);
+ XMLImporter(const TQByteArray& data);
+ XMLImporter(const TQDomDocument& dom);
- virtual void setText(const QString& text);
+ virtual void setText(const TQString& text);
/**
* This class gets used as a utility XML loader. This should never get called,
@@ -63,10 +64,10 @@ public:
*
* @return The file contents
*/
- const QDomDocument& domDocument() const { return m_dom; }
+ const TQDomDocument& domDocument() const { return m_dom; }
private:
- QDomDocument m_dom;
+ TQDomDocument m_dom;
};
} // end namespace
diff --git a/src/translators/xsltexporter.cpp b/src/translators/xsltexporter.cpp
index 54ca8aa..09636f2 100644
--- a/src/translators/xsltexporter.cpp
+++ b/src/translators/xsltexporter.cpp
@@ -19,12 +19,12 @@
#include <klocale.h>
#include <kurlrequester.h>
-#include <qlabel.h>
-#include <qgroupbox.h>
-#include <qlayout.h>
-#include <qhbox.h>
-#include <qdom.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqgroupbox.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqdom.h>
+#include <tqwhatsthis.h>
using Tellico::Export::XSLTExporter;
@@ -33,11 +33,11 @@ XSLTExporter::XSLTExporter() : Export::Exporter(),
m_URLRequester(0) {
}
-QString XSLTExporter::formatString() const {
+TQString XSLTExporter::formatString() const {
return i18n("XSLT");
}
-QString XSLTExporter::fileFilter() const {
+TQString XSLTExporter::fileFilter() const {
return i18n("*|All Files");
}
@@ -45,7 +45,7 @@ QString XSLTExporter::fileFilter() const {
bool XSLTExporter::exec() {
KURL u = m_URLRequester->url();
if(u.isEmpty() || !u.isValid()) {
- return QString::null;
+ return TQString();
}
// XSLTHandler handler(FileHandler::readXMLFile(url));
XSLTHandler handler(u);
@@ -53,27 +53,27 @@ bool XSLTExporter::exec() {
TellicoXMLExporter exporter;
exporter.setEntries(entries());
exporter.setOptions(options());
- QDomDocument dom = exporter.exportXML();
+ TQDomDocument dom = exporter.exportXML();
return FileHandler::writeTextURL(url(), handler.applyStylesheet(dom.toString()),
options() & ExportUTF8, options() & Export::ExportForce);
}
-QWidget* XSLTExporter::widget(QWidget* parent_, const char* name_/*=0*/) {
- if(m_widget && m_widget->parent() == parent_) {
+TQWidget* XSLTExporter::widget(TQWidget* tqparent_, const char* name_/*=0*/) {
+ if(m_widget && TQT_BASE_OBJECT(m_widget->tqparent()) == TQT_BASE_OBJECT(tqparent_)) {
return m_widget;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* group = new QGroupBox(1, Qt::Horizontal, i18n("XSLT Options"), m_widget);
+ TQGroupBox* group = new TQGroupBox(1, Qt::Horizontal, i18n("XSLT Options"), m_widget);
l->addWidget(group);
- QHBox* box = new QHBox(group);
+ TQHBox* box = new TQHBox(group);
box->setSpacing(4);
- (void) new QLabel(i18n("XSLT file:"), box);
+ (void) new TQLabel(i18n("XSLT file:"), box);
m_URLRequester = new KURLRequester(box);
- QWhatsThis::add(m_URLRequester, i18n("Choose the XSLT file used to transform the Tellico XML data."));
+ TQWhatsThis::add(m_URLRequester, i18n("Choose the XSLT file used to transform the Tellico XML data."));
l->addStretch(1);
return m_widget;
diff --git a/src/translators/xsltexporter.h b/src/translators/xsltexporter.h
index ae353d2..2a626f2 100644
--- a/src/translators/xsltexporter.h
+++ b/src/translators/xsltexporter.h
@@ -29,13 +29,13 @@ public:
XSLTExporter();
virtual bool exec();
- virtual QString formatString() const;
- virtual QString fileFilter() const;
+ virtual TQString formatString() const;
+ virtual TQString fileFilter() const;
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
private:
- QWidget* m_widget;
+ TQWidget* m_widget;
KURLRequester* m_URLRequester;
};
diff --git a/src/translators/xslthandler.cpp b/src/translators/xslthandler.cpp
index e25eef5..bdbe8f2 100644
--- a/src/translators/xslthandler.cpp
+++ b/src/translators/xslthandler.cpp
@@ -16,8 +16,8 @@
#include "../tellico_debug.h"
#include "../tellico_utils.h"
-#include <qdom.h>
-#include <qtextcodec.h>
+#include <tqdom.h>
+#include <tqtextcodec.h>
#include <kurl.h>
@@ -35,22 +35,22 @@ static const int xml_options = XML_PARSE_NOENT | XML_PARSE_NONET | XML_PARSE_NOC
static const int xslt_options = xml_options;
/* some functions to pass to the XSLT libs */
-static int writeToQString(void* context, const char* buffer, int len) {
- QString* t = static_cast<QString*>(context);
- *t += QString::fromUtf8(buffer, len);
+static int writeToTQString(void* context, const char* buffer, int len) {
+ TQString* t = static_cast<TQString*>(context);
+ *t += TQString::fromUtf8(buffer, len);
return len;
}
-static void closeQString(void* context) {
- QString* t = static_cast<QString*>(context);
- *t += QString::fromLatin1("\n");
+static void closeTQString(void* context) {
+ TQString* t = static_cast<TQString*>(context);
+ *t += TQString::tqfromLatin1("\n");
}
using Tellico::XSLTHandler;
-XSLTHandler::XMLOutputBuffer::XMLOutputBuffer() : m_res(QString::null) {
- m_buf = xmlOutputBufferCreateIO((xmlOutputWriteCallback)writeToQString,
- (xmlOutputCloseCallback)closeQString,
+XSLTHandler::XMLOutputBuffer::XMLOutputBuffer() : m_res(TQString()) {
+ m_buf = xmlOutputBufferCreateIO((xmlOutputWriteCallback)writeToTQString,
+ (xmlOutputCloseCallback)closeTQString,
&m_res, 0);
if(m_buf) {
m_buf->written = 0;
@@ -68,12 +68,12 @@ XSLTHandler::XMLOutputBuffer::~XMLOutputBuffer() {
int XSLTHandler::s_initCount = 0;
-XSLTHandler::XSLTHandler(const QCString& xsltFile_) :
+XSLTHandler::XSLTHandler(const TQCString& xsltFile_) :
m_stylesheet(0),
m_docIn(0),
m_docOut(0) {
init();
- QString file = KURL::encode_string(QString::fromLocal8Bit(xsltFile_));
+ TQString file = KURL::encode_string(TQString::fromLocal8Bit(xsltFile_));
if(!file.isEmpty()) {
xmlDocPtr xsltDoc = xmlReadFile(file.utf8(), NULL, xslt_options);
m_stylesheet = xsltParseStylesheetDoc(xsltDoc);
@@ -97,12 +97,12 @@ XSLTHandler::XSLTHandler(const KURL& xsltURL_) :
}
}
-XSLTHandler::XSLTHandler(const QDomDocument& xsltDoc_, const QCString& xsltFile_, bool translate_) :
+XSLTHandler::XSLTHandler(const TQDomDocument& xsltDoc_, const TQCString& xsltFile_, bool translate_) :
m_stylesheet(0),
m_docIn(0),
m_docOut(0) {
init();
- QString file = KURL::encode_string(QString::fromLocal8Bit(xsltFile_));
+ TQString file = KURL::encode_string(TQString::fromLocal8Bit(xsltFile_));
if(!xsltDoc_.isNull() && !file.isEmpty()) {
setXSLTDoc(xsltDoc_, file.utf8(), translate_);
}
@@ -143,16 +143,16 @@ void XSLTHandler::init() {
m_params.clear();
}
-void XSLTHandler::setXSLTDoc(const QDomDocument& dom_, const QCString& xsltFile_, bool translate_) {
+void XSLTHandler::setXSLTDoc(const TQDomDocument& dom_, const TQCString& xsltFile_, bool translate_) {
bool utf8 = true; // XML defaults to utf-8
// need to find out if utf-8 or not
- const QDomNodeList childs = dom_.childNodes();
+ const TQDomNodeList childs = dom_.childNodes();
for(uint j = 0; j < childs.count(); ++j) {
if(childs.item(j).isProcessingInstruction()) {
- QDomProcessingInstruction pi = childs.item(j).toProcessingInstruction();
- if(pi.data().lower().contains(QString::fromLatin1("encoding"))) {
- if(!pi.data().lower().contains(QString::fromLatin1("utf-8"))) {
+ TQDomProcessingInstruction pi = childs.item(j).toProcessingInstruction();
+ if(pi.data().lower().tqcontains(TQString::tqfromLatin1("encoding"))) {
+ if(!pi.data().lower().tqcontains(TQString::tqfromLatin1("utf-8"))) {
utf8 = false;
// } else {
// myDebug() << "XSLTHandler::setXSLTDoc() - PI = " << pi.data() << endl;
@@ -162,7 +162,7 @@ void XSLTHandler::setXSLTDoc(const QDomDocument& dom_, const QCString& xsltFile_
}
}
- QString s;
+ TQString s;
if(translate_) {
s = Tellico::i18nReplace(dom_.toString(0 /* indent */));
} else {
@@ -186,29 +186,29 @@ void XSLTHandler::setXSLTDoc(const QDomDocument& dom_, const QCString& xsltFile_
// xmlFreeDoc(xsltDoc); // this causes a crash for some reason
}
-void XSLTHandler::addStringParam(const QCString& name_, const QCString& value_) {
- QCString value = value_;
- value.replace('\'', "&apos;");
- addParam(name_, QCString("'") + value + QCString("'"));
+void XSLTHandler::addStringParam(const TQCString& name_, const TQCString& value_) {
+ TQCString value = value_;
+ value.tqreplace('\'', "&apos;");
+ addParam(name_, TQCString("'") + value + TQCString("'"));
}
-void XSLTHandler::addParam(const QCString& name_, const QCString& value_) {
+void XSLTHandler::addParam(const TQCString& name_, const TQCString& value_) {
m_params.insert(name_, value_);
// myDebug() << "XSLTHandler::addParam() - " << name_ << ":" << value_ << endl;
}
-void XSLTHandler::removeParam(const QCString& name_) {
+void XSLTHandler::removeParam(const TQCString& name_) {
m_params.remove(name_);
}
-const QCString& XSLTHandler::param(const QCString& name_) {
+const TQCString& XSLTHandler::param(const TQCString& name_) {
return m_params[name_];
}
-QString XSLTHandler::applyStylesheet(const QString& text_) {
+TQString XSLTHandler::applyStylesheet(const TQString& text_) {
if(!m_stylesheet) {
myDebug() << "XSLTHandler::applyStylesheet() - null stylesheet pointer!" << endl;
- return QString::null;
+ return TQString();
}
m_docIn = xmlReadDoc(reinterpret_cast<xmlChar*>(text_.utf8().data()), NULL, NULL, xml_options);
@@ -216,16 +216,16 @@ QString XSLTHandler::applyStylesheet(const QString& text_) {
return process();
}
-QString XSLTHandler::process() {
+TQString XSLTHandler::process() {
if(!m_docIn) {
myDebug() << "XSLTHandler::process() - error parsing input string!" << endl;
- return QString::null;
+ return TQString();
}
- QMemArray<const char*> params(2*m_params.count() + 1);
+ TQMemArray<const char*> params(2*m_params.count() + 1);
params[0] = NULL;
- QMap<QCString, QCString>::ConstIterator it = m_params.constBegin();
- QMap<QCString, QCString>::ConstIterator end = m_params.constEnd();
+ TQMap<TQCString, TQCString>::ConstIterator it = m_params.constBegin();
+ TQMap<TQCString, TQCString>::ConstIterator end = m_params.constEnd();
for(uint i = 0; it != end; ++it) {
params[i ] = qstrdup(it.key());
params[i+1] = qstrdup(it.data());
@@ -239,7 +239,7 @@ QString XSLTHandler::process() {
}
if(!m_docOut) {
myDebug() << "XSLTHandler::applyStylesheet() - error applying stylesheet!" << endl;
- return QString::null;
+ return TQString();
}
XMLOutputBuffer output;
@@ -253,13 +253,13 @@ QString XSLTHandler::process() {
}
//static
-QDomDocument& XSLTHandler::setLocaleEncoding(QDomDocument& dom_) {
- const QDomNodeList childs = dom_.documentElement().childNodes();
+TQDomDocument& XSLTHandler::setLocaleEncoding(TQDomDocument& dom_) {
+ const TQDomNodeList childs = dom_.documentElement().childNodes();
for(unsigned j = 0; j < childs.count(); ++j) {
if(childs.item(j).isElement() && childs.item(j).nodeName() == Latin1Literal("xsl:output")) {
- QDomElement e = childs.item(j).toElement();
- const QString encoding = QString::fromLatin1(QTextCodec::codecForLocale()->name());
- e.setAttribute(QString::fromLatin1("encoding"), encoding);
+ TQDomElement e = childs.item(j).toElement();
+ const TQString encoding = TQString::tqfromLatin1(TQTextCodec::codecForLocale()->name());
+ e.setAttribute(TQString::tqfromLatin1("encoding"), encoding);
break;
}
}
diff --git a/src/translators/xslthandler.h b/src/translators/xslthandler.h
index f51b47c..a7f4a76 100644
--- a/src/translators/xslthandler.h
+++ b/src/translators/xslthandler.h
@@ -14,7 +14,7 @@
#ifndef XSLTHANDLER_H
#define XSLTHANDLER_H
-#include <qmap.h>
+#include <tqmap.h>
extern "C" {
// for xmlDocPtr
@@ -24,7 +24,7 @@ extern "C" {
}
class KURL;
-class QDomDocument;
+class TQDomDocument;
namespace Tellico {
@@ -43,16 +43,16 @@ public:
~XMLOutputBuffer();
bool isValid() const { return (m_buf != 0); }
xmlOutputBuffer* buffer() const { return m_buf; }
- QString result() const { return m_res; }
+ TQString result() const { return m_res; }
private:
xmlOutputBuffer* m_buf;
- QString m_res;
+ TQString m_res;
};
/**
* @param xsltFile The XSLT file
*/
- XSLTHandler(const QCString& xsltFile);
+ XSLTHandler(const TQCString& xsltFile);
/**
* @param xsltURL The XSLT URL
*/
@@ -61,7 +61,7 @@ public:
* @param xsltDoc The XSLT DOM document
* @param xsltFile The XSLT file, should be a url?
*/
- XSLTHandler(const QDomDocument& xsltDoc, const QCString& xsltFile, bool translate=false);
+ XSLTHandler(const TQDomDocument& xsltDoc, const TQCString& xsltFile, bool translate=false);
/**
*/
~XSLTHandler();
@@ -73,17 +73,17 @@ public:
* @param dom The XSLT DOM document
* @param xsltFile The XSLT file, should be a url?
*/
- void setXSLTDoc(const QDomDocument& dom, const QCString& xsltFile, bool translate=false);
+ void setXSLTDoc(const TQDomDocument& dom, const TQCString& xsltFile, bool translate=false);
/**
* Adds a param
*/
- void addParam(const QCString& name, const QCString& value);
+ void addParam(const TQCString& name, const TQCString& value);
/**
* Adds a string param
*/
- void addStringParam(const QCString& name, const QCString& value);
- void removeParam(const QCString& name);
- const QCString& param(const QCString& name);
+ void addStringParam(const TQCString& name, const TQCString& value);
+ void removeParam(const TQCString& name);
+ const TQCString& param(const TQCString& name);
/**
* Processes text through the XSLT transformation.
*
@@ -91,19 +91,19 @@ public:
* @param encodedUTF8 Whether the text is encoded in utf-8 or not
* @return The transformed text
*/
- QString applyStylesheet(const QString& text);
+ TQString applyStylesheet(const TQString& text);
- static QDomDocument& setLocaleEncoding(QDomDocument& dom);
+ static TQDomDocument& setLocaleEncoding(TQDomDocument& dom);
private:
void init();
- QString process();
+ TQString process();
xsltStylesheetPtr m_stylesheet;
xmlDocPtr m_docIn;
xmlDocPtr m_docOut;
- QMap<QCString, QCString> m_params;
+ TQMap<TQCString, TQCString> m_params;
static int s_initCount;
};
diff --git a/src/translators/xsltimporter.cpp b/src/translators/xsltimporter.cpp
index 67f1fd2..62f7255 100644
--- a/src/translators/xsltimporter.cpp
+++ b/src/translators/xsltimporter.cpp
@@ -20,10 +20,10 @@
#include <klocale.h>
#include <kurlrequester.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
+#include <tqhbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
#include <memory>
@@ -39,9 +39,9 @@ static bool isUTF8(const KURL& url_) {
}
ref->open();
- QTextStream stream(ref->file());
- QString line = stream.readLine().lower();
- return line.find(QString::fromLatin1("utf-8")) > 0;
+ TQTextStream stream(ref->file());
+ TQString line = stream.readLine().lower();
+ return line.tqfind(TQString::tqfromLatin1("utf-8")) > 0;
}
}
@@ -77,7 +77,7 @@ Tellico::Data::CollPtr XSLTImporter::collection() {
return 0;
}
// kdDebug() << text() << endl;
- QString str = handler.applyStylesheet(text());
+ TQString str = handler.applyStylesheet(text());
// kdDebug() << str << endl;
Import::TellicoImporter imp(str);
@@ -86,22 +86,22 @@ Tellico::Data::CollPtr XSLTImporter::collection() {
return m_coll;
}
-QWidget* XSLTImporter::widget(QWidget* parent_, const char* name_) {
+TQWidget* XSLTImporter::widget(TQWidget* tqparent_, const char* name_) {
// if the url has already been set, then there's no widget
if(!m_xsltURL.isEmpty()) {
return 0;
}
- m_widget = new QWidget(parent_, name_);
- QVBoxLayout* l = new QVBoxLayout(m_widget);
+ m_widget = new TQWidget(tqparent_, name_);
+ TQVBoxLayout* l = new TQVBoxLayout(m_widget);
- QGroupBox* box = new QGroupBox(1, Qt::Vertical, i18n("XSLT Options"), m_widget);
+ TQGroupBox* box = new TQGroupBox(1, Qt::Vertical, i18n("XSLT Options"), m_widget);
l->addWidget(box);
- (void) new QLabel(i18n("XSLT file:"), box);
+ (void) new TQLabel(i18n("XSLT file:"), box);
m_URLRequester = new KURLRequester(box);
- QString filter = i18n("*.xsl|XSL Files (*.xsl)") + QChar('\n');
+ TQString filter = i18n("*.xsl|XSL Files (*.xsl)") + TQChar('\n');
filter += i18n("*|All Files");
m_URLRequester->setFilter(filter);
diff --git a/src/translators/xsltimporter.h b/src/translators/xsltimporter.h
index 578b552..16aa6d2 100644
--- a/src/translators/xsltimporter.h
+++ b/src/translators/xsltimporter.h
@@ -29,6 +29,7 @@ namespace Tellico {
*/
class XSLTImporter : public TextImporter {
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -40,13 +41,13 @@ public:
virtual Data::CollPtr collection();
/**
*/
- virtual QWidget* widget(QWidget* parent, const char* name=0);
+ virtual TQWidget* widget(TQWidget* tqparent, const char* name=0);
void setXSLTURL(const KURL& url) { m_xsltURL = url; }
private:
Data::CollPtr m_coll;
- QWidget* m_widget;
+ TQWidget* m_widget;
KURLRequester* m_URLRequester;
KURL m_xsltURL;
};
diff --git a/src/upcvalidator.cpp b/src/upcvalidator.cpp
index 2d5b7a2..4e51179 100644
--- a/src/upcvalidator.cpp
+++ b/src/upcvalidator.cpp
@@ -18,11 +18,11 @@
using Tellico::UPCValidator;
-UPCValidator::UPCValidator(QObject* parent_, const char* name_/*=0*/)
- : QValidator(parent_, name_), m_checkISBN(false) {
+UPCValidator::UPCValidator(TQObject* tqparent_, const char* name_/*=0*/)
+ : TQValidator(tqparent_, name_), m_checkISBN(false) {
}
-QValidator::State UPCValidator::validate(QString& input_, int& pos_) const {
+TQValidator::State UPCValidator::validate(TQString& input_, int& pos_) const {
// check if it's a cuecat first
State catState = decodeCat(input_);
if(catState == Acceptable) {
@@ -31,8 +31,8 @@ QValidator::State UPCValidator::validate(QString& input_, int& pos_) const {
}
// no spaces allowed
- if(input_.contains(' ')) {
- return QValidator::Invalid;
+ if(input_.tqcontains(' ')) {
+ return TQValidator::Invalid;
}
// no real checking, just if starts with 978, use isbnvalidator
@@ -42,14 +42,14 @@ QValidator::State UPCValidator::validate(QString& input_, int& pos_) const {
}
if(!m_checkISBN || (!m_isbn && len < 13)) {
- return QValidator::Intermediate;
+ return TQValidator::Intermediate;
}
// once it gets converted to an ISBN, remember that, and use it for later
- if(input_.startsWith(QString::fromLatin1("978")) || input_.startsWith(QString::fromLatin1("979"))) {
+ if(input_.startsWith(TQString::tqfromLatin1("978")) || input_.startsWith(TQString::tqfromLatin1("979"))) {
ISBNValidator val(0);
- QValidator::State s = val.validate(input_, pos_);
- if(s == QValidator::Acceptable) {
+ TQValidator::State s = val.validate(input_, pos_);
+ if(s == TQValidator::Acceptable) {
m_isbn = true;
// bad hack
UPCValidator* that = const_cast<UPCValidator*>(this);
@@ -58,16 +58,16 @@ QValidator::State UPCValidator::validate(QString& input_, int& pos_) const {
return s;
}
- return QValidator::Intermediate;
+ return TQValidator::Intermediate;
}
-void UPCValidator::fixup(QString& input_) const {
+void UPCValidator::fixup(TQString& input_) const {
if(input_.isEmpty()) {
return;
}
input_ = input_.stripWhiteSpace();
- int pos = input_.find(' ');
+ int pos = input_.tqfind(' ');
if(pos > -1) {
input_ = input_.left(pos);
}
@@ -77,12 +77,12 @@ void UPCValidator::fixup(QString& input_) const {
}
const uint len = input_.length();
- if(len > 12 && (input_.startsWith(QString::fromLatin1("978")) || input_.startsWith(QString::fromLatin1("979")))) {
- QString s = input_;
+ if(len > 12 && (input_.startsWith(TQString::tqfromLatin1("978")) || input_.startsWith(TQString::tqfromLatin1("979")))) {
+ TQString s = input_;
ISBNValidator val(0);
int p = 0;
int state = val.validate(s, p);
- if(state == QValidator::Acceptable) {
+ if(state == TQValidator::Acceptable) {
// bad hack
UPCValidator* that = const_cast<UPCValidator*>(this);
that->signalISBN();
@@ -91,14 +91,14 @@ void UPCValidator::fixup(QString& input_) const {
}
}
-QValidator::State UPCValidator::decodeCat(QString& input_) const {
+TQValidator::State UPCValidator::decodeCat(TQString& input_) const {
if(input_.length() < 3) {
return Intermediate;
}
- if(!input_.startsWith(QString::fromLatin1(".C3"))) { // all cuecat codes start with .C3
+ if(!input_.startsWith(TQString::tqfromLatin1(".C3"))) { // all cuecat codes start with .C3
return Invalid;
}
- const int periods = input_.contains('.');
+ const int periods = input_.tqcontains('.');
if(periods < 4) {
return Intermediate; // not enough yet
} else if(periods > 4) {
@@ -106,24 +106,24 @@ QValidator::State UPCValidator::decodeCat(QString& input_) const {
}
// ok, let's have a go, take the third token
- QString code = QStringList::split('.', input_)[2];
+ TQString code = TQStringList::split('.', input_)[2];
while(code.length() % 4 > 0) {
code += '=';
}
for(uint i = 0; i < code.length(); ++i) {
if(code[i] >= 'A' && code[i] <= 'Z') {
- code.replace(i, 1, code[i].lower());
+ code.tqreplace(i, 1, code[i].lower());
} else if(code[i] >= 'a' && code[i] <= 'z') {
- code.replace(i, 1, code[i].upper());
+ code.tqreplace(i, 1, code[i].upper());
}
}
- code = QString::fromLatin1(KCodecs::base64Decode(code.latin1()));
+ code = TQString::tqfromLatin1(KCodecs::base64Decode(TQCString(code.latin1())));
for(uint i = 0; i < code.length(); ++i) {
char c = code[i].latin1() ^ 'C';
- code.replace(i, 1, c);
+ code.tqreplace(i, 1, c);
}
input_ = code;
diff --git a/src/upcvalidator.h b/src/upcvalidator.h
index 73afa09..6239486 100644
--- a/src/upcvalidator.h
+++ b/src/upcvalidator.h
@@ -14,21 +14,22 @@
#ifndef UPCVALIDATOR_H
#define UPCVALIDATOR_H
-#include <qvalidator.h>
+#include <tqvalidator.h>
namespace Tellico {
/**
* @author Robby Stephenson
*/
-class UPCValidator : public QValidator {
+class UPCValidator : public TQValidator {
Q_OBJECT
+ TQ_OBJECT
public:
- UPCValidator(QObject* parent, const char* name=0);
+ UPCValidator(TQObject* tqparent, const char* name=0);
- virtual QValidator::State validate(QString& input, int& pos) const;
- virtual void fixup(QString& input) const;
+ virtual TQValidator::State validate(TQString& input, int& pos) const;
+ virtual void fixup(TQString& input) const;
void setCheckISBN(bool b) { m_checkISBN = b; }
@@ -36,7 +37,7 @@ signals:
void signalISBN();
private:
- State decodeCat(QString& str) const;
+ State decodeCat(TQString& str) const;
bool m_checkISBN : 1;
mutable bool m_isbn : 1;
diff --git a/src/viewstack.cpp b/src/viewstack.cpp
index 69d6ff8..529c262 100644
--- a/src/viewstack.cpp
+++ b/src/viewstack.cpp
@@ -20,15 +20,15 @@
#include <khtmlview.h>
#include <klocale.h>
-#include <qwhatsthis.h>
+#include <tqwhatsthis.h>
using Tellico::ViewStack;
-ViewStack::ViewStack(QWidget* parent_, const char* name_/*=0*/) : QWidgetStack(parent_, name_),
+ViewStack::ViewStack(TQWidget* tqparent_, const char* name_/*=0*/) : TQWidgetStack(tqparent_, name_),
m_entryView(new EntryView(this)), m_iconView(new EntryIconView(this)) {
- QWhatsThis::add(m_entryView->view(), i18n("<qt>The <i>Entry View</i> shows a formatted view of the entry's "
+ TQWhatsThis::add(m_entryView->view(), i18n("<qt>The <i>Entry View</i> shows a formatted view of the entry's "
"contents.</qt>"));
- QWhatsThis::add(m_iconView, i18n("<qt>The <i>Icon View</i> shows each entry in the collection or group using "
+ TQWhatsThis::add(m_iconView, i18n("<qt>The <i>Icon View</i> shows each entry in the collection or group using "
"an icon, which may be an image in the entry.</qt>"));
}
diff --git a/src/viewstack.h b/src/viewstack.h
index 73fa814..0a73e01 100644
--- a/src/viewstack.h
+++ b/src/viewstack.h
@@ -16,7 +16,7 @@
#include "datavectors.h"
-#include <qwidgetstack.h>
+#include <tqwidgetstack.h>
namespace Tellico {
class EntryView;
@@ -25,11 +25,12 @@ namespace Tellico {
/**
* @author Robby Stephenson
*/
-class ViewStack : public QWidgetStack {
+class ViewStack : public TQWidgetStack {
Q_OBJECT
+ TQ_OBJECT
public:
- ViewStack(QWidget* parent, const char* name = 0);
+ ViewStack(TQWidget* tqparent, const char* name = 0);
EntryView* entryView() const { return m_entryView; }
EntryIconView* iconView() const { return m_iconView; }
diff --git a/src/xmphandler.cpp b/src/xmphandler.cpp
index de5d5d6..9841596 100644
--- a/src/xmphandler.cpp
+++ b/src/xmphandler.cpp
@@ -15,8 +15,8 @@
#include "tellico_debug.h"
#include <config.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#ifdef HAVE_EXEMPI
#include <exempi/xmp.h>
#endif
@@ -55,10 +55,10 @@ void XMPHandler::init() {
#endif
}
-QString XMPHandler::extractXMP(const QString& file) {
- QString result;
+TQString XMPHandler::extractXMP(const TQString& file) {
+ TQString result;
#ifdef HAVE_EXEMPI
- XmpFilePtr xmpfile = xmp_files_open_new(QFile::encodeName(file), XMP_OPEN_READ);
+ XmpFilePtr xmpfile = xmp_files_open_new(TQFile::encodeName(file), XMP_OPEN_READ);
if(!xmpfile) {
myDebug() << "XMPHandler::parse() - unable to open " << file << endl;
return result;
@@ -67,14 +67,14 @@ QString XMPHandler::extractXMP(const QString& file) {
if(xmp) {
XmpStringPtr buffer = xmp_string_new();
xmp_serialize(xmp, buffer, 0, 0);
- result = QString::fromUtf8(xmp_string_cstr(buffer));
+ result = TQString::fromUtf8(xmp_string_cstr(buffer));
xmp_string_free(buffer);
// myDebug() << result << endl;
#if 0
kdWarning() << "XMPHandler::parse() - turn me off!" << endl;
- QFile f1(QString::fromLatin1("/tmp/xmp.xml"));
+ TQFile f1(TQString::tqfromLatin1("/tmp/xmp.xml"));
if(f1.open(IO_WriteOnly)) {
- QTextStream t(&f1);
+ TQTextStream t(&f1);
t << result;
}
f1.close();
diff --git a/src/xmphandler.h b/src/xmphandler.h
index 07c0631..87c0631 100644
--- a/src/xmphandler.h
+++ b/src/xmphandler.h
@@ -14,7 +14,7 @@
#ifndef TELLICO_XMPHANDLER_H
#define TELLICO_XMPHANDLER_H
-class QString;
+class TQString;
namespace Tellico {
@@ -23,7 +23,7 @@ public:
XMPHandler();
~XMPHandler();
- QString extractXMP(const QString& file);
+ TQString extractXMP(const TQString& file);
static bool isXMPEnabled();