From b0b8e55d2606e60d5bc59e7fbea1b839c01b3832 Mon Sep 17 00:00:00 2001 From: mlaurent Date: Mon, 1 Aug 2005 07:34:36 +0000 Subject: [PATCH] Fix some error git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/KDE/kdeaccessibility@441947 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmouth/phrasebook/phrasebook.cpp | 42 ++++---- kmouth/phrasebook/phrasebook.h | 18 ++-- kmouth/phrasebook/phrasebookdialog.cpp | 99 +++++++++--------- kmouth/phrasebook/phrasebookdialog.h | 32 +++--- kmouth/phrasebook/phrasebookparser.h | 2 +- kmouth/phrasebook/phrasetree.cpp | 114 +++++++++++---------- kmouth/phrasebook/phrasetree.h | 27 ++--- kmouth/wordcompletion/creationsourcedetailsui.ui.h | 2 +- kmouth/wordcompletion/creationsourceui.ui.h | 4 +- kmouth/wordcompletion/dictionarycreationwizard.cpp | 20 ++-- kmouth/wordcompletion/dictionarycreationwizard.h | 10 +- kmouth/wordcompletion/kdedocsourceui.ui.h | 2 +- kmouth/wordcompletion/klanguagebutton.cpp | 28 ++--- kmouth/wordcompletion/klanguagebutton.h | 6 +- kmouth/wordcompletion/wordcompletion.cpp | 9 +- kmouth/wordcompletion/wordcompletionui.ui.h | 2 +- kmouth/wordcompletion/wordcompletionwidget.cpp | 20 ++-- kmouth/wordcompletion/wordlist.cpp | 15 +-- kmouth/wordcompletion/wordlist.h | 4 +- 19 files changed, 249 insertions(+), 207 deletions(-) diff --git a/kmouth/phrasebook/phrasebook.cpp b/kmouth/phrasebook/phrasebook.cpp index 0ec8da32..34242dd4 100644 --- a/kmouth/phrasebook/phrasebook.cpp +++ b/kmouth/phrasebook/phrasebook.cpp @@ -20,7 +20,11 @@ #include #include #include -#include +#include +//Added by qt3to4: +#include +#include +#include #include #include @@ -147,12 +151,12 @@ bool PhraseBook::decode (QXmlInputSource &source) { return false; } -QCString encodeString (const QString str) { - QCString res = ""; +Q3CString encodeString (const QString str) { + Q3CString res = ""; for (int i = 0; i < (int)str.length(); i++) { QChar ch = str.at(i); ushort uc = ch.unicode(); - QCString number; number.setNum(uc); + Q3CString number; number.setNum(uc); if ((uc>127) || (uc<32) || (ch=='<') || (ch=='>') || (ch=='&') || (ch==';')) res = res + "&#" + number + ";"; else @@ -226,7 +230,7 @@ void PhraseBook::save (QTextStream &stream, bool asPhrasebook) { bool PhraseBook::save (const KURL &url, bool asPhrasebook) { if (url.isLocalFile()) { QFile file(url.path()); - if(!file.open(IO_WriteOnly)) + if(!file.open(QIODevice::WriteOnly)) return false; QTextStream stream(&file); @@ -348,7 +352,7 @@ bool PhraseBook::open (const KURL &url) { // Load each line of the plain text file as a new phrase QFile file(tempFile); - if (file.open(IO_ReadOnly)) { + if (file.open(QIODevice::ReadOnly)) { QTextStream stream(&file); while (!stream.atEnd()) { @@ -370,14 +374,14 @@ bool PhraseBook::open (const KURL &url) { return false; } -void PhraseBook::addToGUI (QPopupMenu *popup, KToolBar *toolbar, KActionCollection *phrases, +void PhraseBook::addToGUI (Q3PopupMenu *popup, KToolBar *toolbar, KActionCollection *phrases, QObject *receiver, const char *slot) const { if ((popup != 0) || (toolbar != 0)) { - QPtrStack stack; + Q3PtrStack stack; QWidget *parent = popup; int level = 0; - QValueListConstIterator it; + Q3ValueListConstIterator it; for (it = begin(); it != end(); ++it) { int newLevel = (*it).getLevel(); while (newLevel > level) { @@ -425,7 +429,7 @@ void PhraseBook::addToGUI (QPopupMenu *popup, KToolBar *toolbar, KActionCollecti void PhraseBook::insert (const QString &name, const PhraseBook &book) { *this += PhraseBookEntry(Phrase(name), 0, false); - QValueListConstIterator it; + Q3ValueListConstIterator it; for (it = book.begin(); it != book.end(); ++it) { *this += PhraseBookEntry ((*it).getPhrase(), (*it).getLevel()+1, (*it).isPhrase()); } @@ -434,13 +438,13 @@ void PhraseBook::insert (const QString &name, const PhraseBook &book) { // *************************************************************************** PhraseBookDrag::PhraseBookDrag (PhraseBook *book, QWidget *dragSource, const char *name) - : QDragObject (dragSource, name) + : Q3DragObject (dragSource, name) { setBook (book); } PhraseBookDrag::PhraseBookDrag (QWidget *dragSource, const char *name) - : QDragObject (dragSource, name) + : Q3DragObject (dragSource, name) { setBook (0); } @@ -478,7 +482,7 @@ const char *PhraseBookDrag::format (int i) const { } QByteArray PhraseBookDrag::encodedData (const char* mime) const { - QCString m(mime); + Q3CString m(mime); m = m.lower(); if (m.contains("xml-phrasebook")) return xmlphrasebook.encodedData(mime); @@ -489,17 +493,17 @@ QByteArray PhraseBookDrag::encodedData (const char* mime) const { } bool PhraseBookDrag::canDecode (const QMimeSource* e) { - return QTextDrag::canDecode(e); + return Q3TextDrag::canDecode(e); } bool PhraseBookDrag::decode (const QMimeSource *e, PhraseBook *book) { QString string; - QCString subtype1 = "x-xml-phrasebook"; - QCString subtype2 = "xml"; + QString subtype1 = "x-xml-phrasebook"; + QString subtype2 = "xml"; - if (!QTextDrag::decode(e, string, subtype1)) - if (!QTextDrag::decode(e, string, subtype2)) { - if (QTextDrag::decode(e, string)) { + if (!Q3TextDrag::decode(e, string, subtype1)) + if (!Q3TextDrag::decode(e, string, subtype2)) { + if (Q3TextDrag::decode(e, string)) { *book += PhraseBookEntry(Phrase(string, ""), 0, true); return true; } diff --git a/kmouth/phrasebook/phrasebook.h b/kmouth/phrasebook/phrasebook.h index 83cb3a9d..1718e2c6 100644 --- a/kmouth/phrasebook/phrasebook.h +++ b/kmouth/phrasebook/phrasebook.h @@ -19,8 +19,12 @@ #define PHRASEBOOK_H #include -#include +#include #include +//Added by qt3to4: +#include +#include +#include #include #include @@ -72,7 +76,7 @@ private: int level; }; -typedef QValueList PhraseBookEntryList; +typedef Q3ValueList PhraseBookEntryList; /** * The class PhraseBook implements a phrase book. It mainly stores a @@ -131,7 +135,7 @@ public: /** Adds the entries of the book to both the given popup menu and the given * toolbar. The corresponding actions will be inserted into phrases. */ - void addToGUI (QPopupMenu *popup, KToolBar *toolbar, + void addToGUI (Q3PopupMenu *popup, KToolBar *toolbar, KActionCollection *phrases, QObject *receiver, const char *slot) const; @@ -146,7 +150,7 @@ public: * The class PhraseBookDrag implements drag and drop support for phrase books. * @author Gunnar Schmi Dt */ -class PhraseBookDrag: public QDragObject { +class PhraseBookDrag: public Q3DragObject { Q_OBJECT public: PhraseBookDrag (PhraseBook *book, QWidget *dragSource = 0, const char *name = 0); @@ -163,9 +167,9 @@ public: private: bool isEmpty; - QTextDrag xmlphrasebook; - QTextDrag xml; - QTextDrag plain; + Q3TextDrag xmlphrasebook; + Q3TextDrag xml; + Q3TextDrag plain; }; class PhraseAction : public KAction { diff --git a/kmouth/phrasebook/phrasebookdialog.cpp b/kmouth/phrasebook/phrasebookdialog.cpp index cc79d2fc..7b4c3308 100644 --- a/kmouth/phrasebook/phrasebookdialog.cpp +++ b/kmouth/phrasebook/phrasebookdialog.cpp @@ -23,11 +23,16 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +//Added by qt3to4: +#include +#include +#include +#include // include files for KDE #include @@ -53,9 +58,9 @@ namespace PhraseBookPrivate { }; } -CheckBookItem::CheckBookItem (QListViewItem *parent, QListViewItem *last, +CheckBookItem::CheckBookItem (Q3ListViewItem *parent, Q3ListViewItem *last, const QString &text, const QString &name, const QString &filename) - : QCheckListItem (parent, text, QCheckListItem::CheckBox) + : Q3CheckListItem (parent, text, Q3CheckListItem::CheckBox) { moveItem (last); setText(PhraseBookPrivate::name, name); @@ -70,9 +75,9 @@ CheckBookItem::CheckBookItem (QListViewItem *parent, QListViewItem *last, ((CheckBookItem*)parent)->childChange (numberOfBooks, selectedBooks); } -CheckBookItem::CheckBookItem (QListView *parent, QListViewItem *last, +CheckBookItem::CheckBookItem (Q3ListView *parent, Q3ListViewItem *last, const QString &text, const QString &name, const QString &filename) - : QCheckListItem (parent, text, QCheckListItem::CheckBox) + : Q3CheckListItem (parent, text, Q3CheckListItem::CheckBox) { moveItem (last); setText(PhraseBookPrivate::name, name); @@ -90,7 +95,7 @@ CheckBookItem::~CheckBookItem () { } void CheckBookItem::activate() { - QListView *lv = listView(); + Q3ListView *lv = listView(); if ((lv != 0) && (!lv->isEnabled()) || (!isEnabled())) return; @@ -100,9 +105,9 @@ void CheckBookItem::activate() { } void CheckBookItem::stateChange (bool on) { - QListViewItem *item = firstChild(); + Q3ListViewItem *item = firstChild(); if (item == 0) { - QListViewItem *parent = this->parent(); + Q3ListViewItem *parent = this->parent(); if (parent != 0) { if (on) ((CheckBookItem*)parent)->childChange (0, 1); @@ -114,10 +119,10 @@ void CheckBookItem::stateChange (bool on) { } void CheckBookItem::propagateStateChange () { - QListViewItem *item = firstChild(); + Q3ListViewItem *item = firstChild(); while (item != 0) { - if (isOn() != ((QCheckListItem*)item)->isOn()) - ((QCheckListItem*)item)->setOn (isOn()); + if (isOn() != ((Q3CheckListItem*)item)->isOn()) + ((Q3CheckListItem*)item)->setOn (isOn()); else ((CheckBookItem*)item)->propagateStateChange (); item = item->nextSibling(); @@ -127,7 +132,7 @@ void CheckBookItem::propagateStateChange () { void CheckBookItem::childChange (int numberDiff, int selDiff) { numberOfBooks += numberDiff; selectedBooks += selDiff; - QListViewItem *parent = this->parent(); + Q3ListViewItem *parent = this->parent(); if (parent != 0) ((CheckBookItem*)parent)->childChange (numberDiff, selDiff); @@ -153,7 +158,7 @@ InitialPhraseBookWidget::InitialPhraseBookWidget (QWidget *parent, const char *n books->addColumn (i18n("Book")); books->setRootIsDecorated (true); books->setAllColumnsShowFocus (true); - books->setSelectionMode (QListView::Multi); + books->setSelectionMode (Q3ListView::Multi); mainLayout->add (books); initStandardPhraseBooks(); @@ -165,10 +170,11 @@ InitialPhraseBookWidget::~InitialPhraseBookWidget () { void InitialPhraseBookWidget::initStandardPhraseBooks() { StandardBookList bookPaths = PhraseBookDialog::standardPhraseBooks(); - QListViewItem *parent = 0; - QListViewItem *last = 0; - QStringList currentNamePath = ""; - QPtrStack stack; + Q3ListViewItem *parent = 0; + Q3ListViewItem *last = 0; + QStringList currentNamePath; + currentNamePath<<""; + Q3PtrStack stack; StandardBookList::iterator it; for (it = bookPaths.begin(); it != bookPaths.end(); ++it) { QString namePath = (*it).path; @@ -184,7 +190,7 @@ void InitialPhraseBookWidget::initStandardPhraseBooks() { } for (; it2 != dirs.end(); ++it2) { stack.push (parent); - QListViewItem *newParent; + Q3ListViewItem *newParent; if (parent == 0) newParent = new CheckBookItem (books, last, *it2, *it2, QString::null); else @@ -194,7 +200,7 @@ void InitialPhraseBookWidget::initStandardPhraseBooks() { } currentNamePath = dirs; - QListViewItem *book; + Q3ListViewItem *book; if (parent == 0) book = new CheckBookItem (books, last, (*it).name, (*it).name, (*it).filename); else @@ -205,13 +211,13 @@ void InitialPhraseBookWidget::initStandardPhraseBooks() { void InitialPhraseBookWidget::createBook () { PhraseBook book; - QListViewItem *item = books->firstChild(); + Q3ListViewItem *item = books->firstChild(); while (item != 0) { if (item->firstChild() != 0) { item = item->firstChild(); } else { - if (((QCheckListItem*)item)->isOn()) { + if (((Q3CheckListItem*)item)->isOn()) { PhraseBook localBook; localBook.open(KURL( item->text(PhraseBookPrivate::filename ))); book += localBook; @@ -239,9 +245,9 @@ ButtonBoxWidget::ButtonBoxWidget (QWidget *parent, const char *name) keyButton = new KKeyButton (keyButtonPlace, "key"); keyButtonPlaceLayout->addWidget (keyButton, 1,1); - QWhatsThis::add (keyButton, i18n("By clicking on this button you can select the keyboard shortcut associated with the selected phrase.")); + Q3WhatsThis::add (keyButton, i18n("By clicking on this button you can select the keyboard shortcut associated with the selected phrase.")); - group = new QButtonGroup (phrasebox); + group = new Q3ButtonGroup (phrasebox); group->hide(); group->setExclusive (true); group->insert (noKey); @@ -301,12 +307,12 @@ void PhraseBookDialog::initGUI () { treeView->addColumn (i18n("Shortcut")); treeView->setRootIsDecorated (true); treeView->setAllColumnsShowFocus (true); - treeView->setSelectionMode (QListView::Extended); - QWhatsThis::add (treeView, i18n("This list contains the current phrase book in a tree structure. You can select and modify individual phrases and sub phrase books")); + treeView->setSelectionMode (Q3ListView::Extended); + Q3WhatsThis::add (treeView, i18n("This list contains the current phrase book in a tree structure. You can select and modify individual phrases and sub phrase books")); connect (treeView, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); - connect (treeView, SIGNAL(contextMenuRequested (QListViewItem *, const QPoint &, int)), this, SLOT(contextMenuRequested (QListViewItem *, const QPoint &, int))); - connect (treeView, SIGNAL(dropped (QDropEvent *, QListViewItem *, QListViewItem *)), this, SLOT(slotDropped (QDropEvent *, QListViewItem *, QListViewItem *))); - connect (treeView, SIGNAL(moved (QListViewItem *, QListViewItem *, QListViewItem *)), this, SLOT(slotMoved (QListViewItem *, QListViewItem *, QListViewItem *))); + connect (treeView, SIGNAL(contextMenuRequested (Q3ListViewItem *, const QPoint &, int)), this, SLOT(contextMenuRequested (Q3ListViewItem *, const QPoint &, int))); + connect (treeView, SIGNAL(dropped (QDropEvent *, Q3ListViewItem *, Q3ListViewItem *)), this, SLOT(slotDropped (QDropEvent *, Q3ListViewItem *, Q3ListViewItem *))); + connect (treeView, SIGNAL(moved (Q3ListViewItem *, Q3ListViewItem *, Q3ListViewItem *)), this, SLOT(slotMoved (Q3ListViewItem *, Q3ListViewItem *, Q3ListViewItem *))); mainLayout->addWidget (treeView); buttonBox = new ButtonBoxWidget (page, "buttonbox"); @@ -383,7 +389,7 @@ QString PhraseBookDialog::displayPath (QString filename) { QFileInfo file(filename); QString path = file.dirPath(); QString dispPath = ""; - uint position = path.find("/kmouth/books/")+QString("/kmouth/books/").length(); + int position = path.find("/kmouth/books/")+QString("/kmouth/books/").length(); while (path.length() > position) { file.setFile(path); @@ -435,8 +441,9 @@ void PhraseBookDialog::initStandardPhraseBooks () { StandardBookList bookPaths = standardPhraseBooks(); KActionMenu *parent = fileImportStandardBook; - QStringList currentNamePath = "x"; - QPtrStack stack; + QStringList currentNamePath; + currentNamePath<< "x"; + Q3PtrStack stack; StandardBookList::iterator it; for (it = bookPaths.begin(); it != bookPaths.end(); ++it) { KURL url; @@ -469,14 +476,14 @@ void PhraseBookDialog::initStandardPhraseBooks () { } } -PhraseTreeItem *selectedItem (QListView *treeView) { +PhraseTreeItem *selectedItem (Q3ListView *treeView) { PhraseTreeItem *currentItem = (PhraseTreeItem *)treeView->currentItem(); if ((currentItem == 0) || (!currentItem->isSelected())) return 0; - QListViewItemIterator it(treeView); + Q3ListViewItemIterator it(treeView); while (it.current()) { - QListViewItem *item = it.current(); + Q3ListViewItem *item = it.current(); if (item->isSelected() && (item != currentItem)) return 0; ++it; @@ -615,8 +622,8 @@ void PhraseBookDialog::setShortcut( const KShortcut& cut ) { } } -QListViewItem *PhraseBookDialog::addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book) { - QListViewItem *newItem = treeView->addBook(parent, after, book); +Q3ListViewItem *PhraseBookDialog::addBook (Q3ListViewItem *parent, Q3ListViewItem *after, PhraseBook *book) { + Q3ListViewItem *newItem = treeView->addBook(parent, after, book); if (newItem != 0) { treeView->clearSelection(); treeView->ensureItemVisible(newItem); @@ -627,7 +634,7 @@ QListViewItem *PhraseBookDialog::addBook (QListViewItem *parent, QListViewItem * return newItem; } -QListViewItem *PhraseBookDialog::addBook (QListViewItem *item, PhraseBook *book) { +Q3ListViewItem *PhraseBookDialog::addBook (Q3ListViewItem *item, PhraseBook *book) { if (item == 0) return addBook(0, 0, book); else if (((PhraseTreeItem *)item)->isPhrase() || !item->isOpen()) @@ -639,14 +646,14 @@ QListViewItem *PhraseBookDialog::addBook (QListViewItem *item, PhraseBook *book) return addBook(item, 0, book); } -void PhraseBookDialog::contextMenuRequested(QListViewItem *, const QPoint &pos, int) { +void PhraseBookDialog::contextMenuRequested(Q3ListViewItem *, const QPoint &pos, int) { QString name; if (treeView->hasSelectedItems()) name = "phrasebook_popup_sel"; else name = "phrasebook_popup_nosel"; - QPopupMenu *popup = (QPopupMenu *)factory()->container(name,this); + Q3PopupMenu *popup = (Q3PopupMenu *)factory()->container(name,this); if (popup != 0) { popup->popup(pos, 0); } @@ -677,14 +684,14 @@ void PhraseBookDialog::slotPaste () { } } -void PhraseBookDialog::slotDropped (QDropEvent *e, QListViewItem *parent, QListViewItem *after) { +void PhraseBookDialog::slotDropped (QDropEvent *e, Q3ListViewItem *parent, Q3ListViewItem *after) { PhraseBook book; if (PhraseBookDrag::decode(e, &book)) { addBook(parent, after, &book); } } -void PhraseBookDialog::slotMoved (QListViewItem *item, QListViewItem *, QListViewItem *) { +void PhraseBookDialog::slotMoved (Q3ListViewItem *item, Q3ListViewItem *, Q3ListViewItem *) { treeView->ensureItemVisible(item); treeView->setSelected (item, true); phrasebookChanged = true; @@ -695,7 +702,7 @@ void PhraseBookDialog::slotAddPhrasebook () { Phrase phrase(i18n("(New Phrase Book)"), ""); book += PhraseBookEntry(phrase, 0, false); - QListViewItem *item = addBook (treeView->currentItem(), &book); + Q3ListViewItem *item = addBook (treeView->currentItem(), &book); item->setOpen (true); buttonBox->lineEdit->selectAll(); buttonBox->lineEdit->setFocus(); diff --git a/kmouth/phrasebook/phrasebookdialog.h b/kmouth/phrasebook/phrasebookdialog.h index 774387f8..08db6c68 100644 --- a/kmouth/phrasebook/phrasebookdialog.h +++ b/kmouth/phrasebook/phrasebookdialog.h @@ -18,11 +18,15 @@ #ifndef PHRASEBOOKDIALOG_H #define PHRASEBOOKDIALOG_H -#include +#include #include -#include +#include #include -#include +#include +//Added by qt3to4: +#include +#include +#include #include #include #include @@ -30,7 +34,7 @@ #include "phrasebook.h" #include "buttonboxui.h" -class QListViewItem; +class Q3ListViewItem; class PhraseTreeItem; class PhraseTree; class QStringList; @@ -42,17 +46,17 @@ struct StandardBook { QString path; QString filename; }; -typedef QValueList StandardBookList; +typedef Q3ValueList StandardBookList; /**The class PhraseTreeItem is an ListViewItem for either a phrase or a phrase book. *@author Gunnar Schmi Dt */ -class CheckBookItem : public QCheckListItem { +class CheckBookItem : public Q3CheckListItem { public: - CheckBookItem (QListViewItem *parent, QListViewItem *last, + CheckBookItem (Q3ListViewItem *parent, Q3ListViewItem *last, const QString &text, const QString &name, const QString &filename); - CheckBookItem (QListView *parent, QListViewItem *last, + CheckBookItem (Q3ListView *parent, Q3ListViewItem *last, const QString &text, const QString &name, const QString &filename); ~CheckBookItem(); @@ -127,7 +131,7 @@ public: ~ButtonBoxWidget (); KKeyButton *keyButton; - QButtonGroup *group; + Q3ButtonGroup *group; protected: QGridLayout *keyButtonPlaceLayout; @@ -168,7 +172,7 @@ public slots: void capturedShortcut (const KShortcut& cut); void selectionChanged (); - void contextMenuRequested(QListViewItem *, const QPoint &pos, int); + void contextMenuRequested(Q3ListViewItem *, const QPoint &pos, int); void slotRemove (); void slotCut (); @@ -184,8 +188,8 @@ public slots: void slotExportPhrasebook (); void slotPrint (); - void slotDropped (QDropEvent *e, QListViewItem *parent, QListViewItem *after); - void slotMoved (QListViewItem *item, QListViewItem *, QListViewItem *); + void slotDropped (QDropEvent *e, Q3ListViewItem *parent, Q3ListViewItem *after); + void slotMoved (Q3ListViewItem *item, Q3ListViewItem *, Q3ListViewItem *); signals: void phrasebookConfirmed (PhraseBook &book); @@ -199,8 +203,8 @@ private: /** initializes the list of standard phrase books */ void initStandardPhraseBooks (); - QListViewItem *addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book); - QListViewItem *addBook (QListViewItem *item, PhraseBook *book); + Q3ListViewItem *addBook (Q3ListViewItem *parent, Q3ListViewItem *after, PhraseBook *book); + Q3ListViewItem *addBook (Q3ListViewItem *item, PhraseBook *book); void setShortcut (const KShortcut &cut); diff --git a/kmouth/phrasebook/phrasebookparser.h b/kmouth/phrasebook/phrasebookparser.h index a6e436a4..3cee8ac2 100644 --- a/kmouth/phrasebook/phrasebookparser.h +++ b/kmouth/phrasebook/phrasebookparser.h @@ -19,7 +19,7 @@ #define PHRASEBOOKPARSER_H #include -#include +#include #include "phrasebook.h" /** diff --git a/kmouth/phrasebook/phrasetree.cpp b/kmouth/phrasebook/phrasetree.cpp index 57d4f5e3..0d71ce17 100644 --- a/kmouth/phrasebook/phrasetree.cpp +++ b/kmouth/phrasebook/phrasetree.cpp @@ -27,8 +27,12 @@ #include "phrasetree.h" #include "phrasebookdialog.h" #include "phrasebook.h" +//Added by qt3to4: +#include +#include +#include -PhraseTreeItem::PhraseTreeItem (QListView *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon) +PhraseTreeItem::PhraseTreeItem (Q3ListView *parent, Q3ListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon) : KListViewItem (parent, after, phrase) { isPhraseValue = true; @@ -38,7 +42,7 @@ PhraseTreeItem::PhraseTreeItem (QListView *parent, QListViewItem *after, QString setExpandable (false); } -PhraseTreeItem::PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon) +PhraseTreeItem::PhraseTreeItem (Q3ListViewItem *parent, Q3ListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon) : KListViewItem (parent, after, phrase) { isPhraseValue = true; @@ -47,14 +51,14 @@ PhraseTreeItem::PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QSt setPixmap(0, icon); setExpandable (false); } -PhraseTreeItem::PhraseTreeItem (QListView *parent, QListViewItem *after, QString name, QPixmap icon) +PhraseTreeItem::PhraseTreeItem (Q3ListView *parent, Q3ListViewItem *after, QString name, QPixmap icon) : KListViewItem (parent, after, name) { isPhraseValue = false; setPixmap(0, icon); setExpandable (true); } -PhraseTreeItem::PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString name, QPixmap icon) +PhraseTreeItem::PhraseTreeItem (Q3ListViewItem *parent, Q3ListViewItem *after, QString name, QPixmap icon) : KListViewItem (parent, after, name) { isPhraseValue = false; @@ -81,17 +85,17 @@ PhraseTree::PhraseTree (QWidget *parent, const char *name) phrasebook_closed = KGlobal::iconLoader()->loadIcon("phrasebook_closed", KIcon::Small); phrase = KGlobal::iconLoader()->loadIcon("phrase", KIcon::Small); - connect (this, SIGNAL(expanded (QListViewItem *)), this, SLOT(itemExpanded (QListViewItem *))); - connect (this, SIGNAL(collapsed (QListViewItem *)), this, SLOT(itemCollapsed (QListViewItem *))); + connect (this, SIGNAL(expanded (Q3ListViewItem *)), this, SLOT(itemExpanded (Q3ListViewItem *))); + connect (this, SIGNAL(collapsed (Q3ListViewItem *)), this, SLOT(itemCollapsed (Q3ListViewItem *))); } PhraseTree::~PhraseTree (){ } namespace PhraseTreePrivate { - QListViewItem *prevSibling (QListViewItem *item) { - QListViewItem *parent = item->parent(); - QListViewItem *above = item->itemAbove(); + Q3ListViewItem *prevSibling (Q3ListViewItem *item) { + Q3ListViewItem *parent = item->parent(); + Q3ListViewItem *above = item->itemAbove(); if (above == parent) return 0; @@ -102,15 +106,15 @@ namespace PhraseTreePrivate { return above; } - bool findAbovePosition (QListViewItem *item, - QListViewItem **newParent, - QListViewItem **newAbove) + bool findAbovePosition (Q3ListViewItem *item, + Q3ListViewItem **newParent, + Q3ListViewItem **newAbove) { if (item == 0) return false; - QListViewItem *parent = item->parent(); - QListViewItem *above = item->itemAbove(); + Q3ListViewItem *parent = item->parent(); + Q3ListViewItem *above = item->itemAbove(); if (above == 0) return false; @@ -133,15 +137,15 @@ namespace PhraseTreePrivate { } } - bool findBelowPosition (QListViewItem *item, - QListViewItem **newParent, - QListViewItem **newAbove) + bool findBelowPosition (Q3ListViewItem *item, + Q3ListViewItem **newParent, + Q3ListViewItem **newAbove) { if (item == 0) return false; - QListViewItem *parent = item->parent(); - QListViewItem *below = item->nextSibling(); + Q3ListViewItem *parent = item->parent(); + Q3ListViewItem *below = item->nextSibling(); if (parent == 0 && below == 0) return false; @@ -162,14 +166,14 @@ namespace PhraseTreePrivate { } } - bool findRightPosition (QListViewItem *item, - QListViewItem **newParent, - QListViewItem **newAbove) + bool findRightPosition (Q3ListViewItem *item, + Q3ListViewItem **newParent, + Q3ListViewItem **newAbove) { if (item == 0) return false; - QListViewItem *above = prevSibling (item); + Q3ListViewItem *above = prevSibling (item); if (above == 0) return false; @@ -188,14 +192,14 @@ namespace PhraseTreePrivate { } } - bool findLeftPosition (QListViewItem *item, - QListViewItem **newParent, - QListViewItem **newAbove) + bool findLeftPosition (Q3ListViewItem *item, + Q3ListViewItem **newParent, + Q3ListViewItem **newAbove) { if (item == 0) return false; - QListViewItem *parent = item->parent(); + Q3ListViewItem *parent = item->parent(); if (parent == 0) return false; @@ -207,9 +211,9 @@ namespace PhraseTreePrivate { } } -void PhraseTree::moveItem (QListViewItem *item, - QListViewItem *parent, - QListViewItem *above) +void PhraseTree::moveItem (Q3ListViewItem *item, + Q3ListViewItem *parent, + Q3ListViewItem *above) { if (item != 0) { if (item->parent() == 0) @@ -227,7 +231,7 @@ void PhraseTree::moveItem (QListViewItem *item, } bool PhraseTree::hasSelectedItems() { - QListViewItem *i = firstChild(); + Q3ListViewItem *i = firstChild(); if ( !i ) return false; int level = 0; @@ -254,10 +258,10 @@ bool PhraseTree::hasSelectedItems() { } void PhraseTree::deleteSelectedItems() { - QListViewItem *i = firstChild(); + Q3ListViewItem *i = firstChild(); if ( !i ) return; - QListViewItem *deleteItem = 0; + Q3ListViewItem *deleteItem = 0; do { if (i->isSelected()) deleteItem = i; @@ -283,10 +287,10 @@ void PhraseTree::deleteSelectedItems() { void PhraseTree::keyPressEvent (QKeyEvent *e) { if ((e->state() & Qt::KeyButtonMask) == Qt::AltButton) { if (e->key() == Qt::Key_Up) { - QListViewItem *item = currentItem(); + Q3ListViewItem *item = currentItem(); if ((item != 0) && (item->isSelected())) { - QListViewItem *parent; - QListViewItem *above; + Q3ListViewItem *parent; + Q3ListViewItem *above; if (PhraseTreePrivate::findAbovePosition (item, &parent, &above)) { moveItem(item, parent, above); @@ -298,10 +302,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) { return; } else if (e->key() == Qt::Key_Down) { - QListViewItem *item = currentItem(); + Q3ListViewItem *item = currentItem(); if ((item != 0) && (item->isSelected())) { - QListViewItem *parent; - QListViewItem *above; + Q3ListViewItem *parent; + Q3ListViewItem *above; if (PhraseTreePrivate::findBelowPosition (item, &parent, &above)) { moveItem(item, parent, above); @@ -313,10 +317,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) { return; } else if (e->key() == Qt::Key_Left) { - QListViewItem *item = currentItem(); + Q3ListViewItem *item = currentItem(); if ((item != 0) && (item->isSelected())) { - QListViewItem *parent; - QListViewItem *above; + Q3ListViewItem *parent; + Q3ListViewItem *above; if (PhraseTreePrivate::findLeftPosition (item, &parent, &above)) { moveItem(item, parent, above); @@ -328,10 +332,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) { return; } else if (e->key() == Qt::Key_Right) { - QListViewItem *item = currentItem(); + Q3ListViewItem *item = currentItem(); if ((item != 0) && (item->isSelected())) { - QListViewItem *parent; - QListViewItem *above; + Q3ListViewItem *parent; + Q3ListViewItem *above; if (PhraseTreePrivate::findRightPosition (item, &parent, &above)) { moveItem(item, parent, above); @@ -346,7 +350,7 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) { KListView::keyPressEvent(e); } -PhraseTreeItem *PhraseTree::insertPhrase (QListViewItem *parent, QListViewItem *after, QString phrase, QString shortcut) { +PhraseTreeItem *PhraseTree::insertPhrase (Q3ListViewItem *parent, Q3ListViewItem *after, QString phrase, QString shortcut) { KShortcut cut = KShortcut(shortcut); if (isKeyPresent (cut, 0, false)) cut = KShortcut(QString::null); @@ -357,15 +361,15 @@ PhraseTreeItem *PhraseTree::insertPhrase (QListViewItem *parent, QListViewItem * return new PhraseTreeItem (parent, after, phrase, cut, this->phrase); } -PhraseTreeItem *PhraseTree::insertBook (QListViewItem *parent, QListViewItem *after, QString name) { +PhraseTreeItem *PhraseTree::insertBook (Q3ListViewItem *parent, Q3ListViewItem *after, QString name) { if (parent == 0) return new PhraseTreeItem (this, after, name, phrasebook_closed); else return new PhraseTreeItem (parent, after, name, phrasebook_closed); } -QListViewItem *PhraseTree::addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book) { - QListViewItem *last = after; +Q3ListViewItem *PhraseTree::addBook (Q3ListViewItem *parent, Q3ListViewItem *after, PhraseBook *book) { + Q3ListViewItem *last = after; int level = 0; PhraseBookEntryList::iterator it; for (it = book->begin(); it != book->end(); ++it) { @@ -403,7 +407,7 @@ QListViewItem *PhraseTree::addBook (QListViewItem *parent, QListViewItem *after, } void PhraseTree::fillBook (PhraseBook *book, bool respectSelection) { - QListViewItem *i = firstChild(); + Q3ListViewItem *i = firstChild(); int level = 0; if ( !i ) return; @@ -432,11 +436,11 @@ void PhraseTree::fillBook (PhraseBook *book, bool respectSelection) { while (i != 0); } -QDragObject *PhraseTree::dragObject () { +Q3DragObject *PhraseTree::dragObject () { return dragObject (true); } -QDragObject *PhraseTree::dragObject (bool isDependent) { +Q3DragObject *PhraseTree::dragObject (bool isDependent) { PhraseBook book; fillBook (&book, true); if (isDependent) @@ -510,7 +514,7 @@ bool PhraseTree::isGlobalKeyPresent (const KShortcut& cut, bool warnUser) { } bool PhraseTree::isPhraseKeyPresent (const KShortcut& cut, PhraseTreeItem* cutItem, bool warnUser) { - for (QListViewItemIterator it(this); it.current(); ++it) { + for (Q3ListViewItemIterator it(this); it.current(); ++it) { PhraseTreeItem* item = dynamic_cast(it.current()); if ((item != 0) && (item != cutItem)) { int iSeq = keyConflict (cut, item->cut()); @@ -539,13 +543,13 @@ bool PhraseTree::isKeyPresent (const KShortcut& cut, PhraseTreeItem* cutItem, bo return false; } -void PhraseTree::itemExpanded (QListViewItem *item) { +void PhraseTree::itemExpanded (Q3ListViewItem *item) { PhraseTreeItem *i = (PhraseTreeItem *)item; if (!i->isPhrase()) i->setPixmap(0, phrasebook_open); } -void PhraseTree::itemCollapsed (QListViewItem *item) { +void PhraseTree::itemCollapsed (Q3ListViewItem *item) { PhraseTreeItem *i = (PhraseTreeItem *)item; if (!i->isPhrase()) i->setPixmap(0, phrasebook_closed); diff --git a/kmouth/phrasebook/phrasetree.h b/kmouth/phrasebook/phrasetree.h index bd0e1f5a..5af3c231 100644 --- a/kmouth/phrasebook/phrasetree.h +++ b/kmouth/phrasebook/phrasetree.h @@ -19,6 +19,9 @@ #define PHRASETREE_H #include +//Added by qt3to4: +#include +#include #include #include @@ -33,13 +36,13 @@ class PhraseTreeItem : public KListViewItem { friend class PhraseTree; private: /** Creates a phrase item within a sub phrase book */ - PhraseTreeItem (QListView *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon); + PhraseTreeItem (Q3ListView *parent, Q3ListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon); /** Creates a phrase item at the top level */ - PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon); + PhraseTreeItem (Q3ListViewItem *parent, Q3ListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon); /** Creates a phrase book item within a sub phrase book */ - PhraseTreeItem (QListView *parent, QListViewItem *after, QString name, QPixmap icon); + PhraseTreeItem (Q3ListView *parent, Q3ListViewItem *after, QString name, QPixmap icon); /** Creates a phrase book item at the top level */ - PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString name, QPixmap icon); + PhraseTreeItem (Q3ListViewItem *parent, Q3ListViewItem *after, QString name, QPixmap icon); public: bool isPhrase(); @@ -66,16 +69,16 @@ public: void keyPressEvent (QKeyEvent *e); - PhraseTreeItem *insertPhrase (QListViewItem *parent, QListViewItem *after, QString phrase, QString shortcut); - PhraseTreeItem *insertBook (QListViewItem *parent, QListViewItem *after, QString name); + PhraseTreeItem *insertPhrase (Q3ListViewItem *parent, Q3ListViewItem *after, QString phrase, QString shortcut); + PhraseTreeItem *insertBook (Q3ListViewItem *parent, Q3ListViewItem *after, QString name); - QListViewItem *addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book); + Q3ListViewItem *addBook (Q3ListViewItem *parent, Q3ListViewItem *after, PhraseBook *book); void fillBook (PhraseBook *book, bool respectSelection); - QDragObject *dragObject (); - QDragObject *dragObject (bool isDependent); + Q3DragObject *dragObject (); + Q3DragObject *dragObject (bool isDependent); - void moveItem (QListViewItem *item, QListViewItem *parent, QListViewItem *above); + void moveItem (Q3ListViewItem *item, Q3ListViewItem *parent, Q3ListViewItem *above); bool hasSelectedItems(); void deleteSelectedItems(); @@ -93,8 +96,8 @@ public: bool isKeyPresent (const KShortcut& cut, PhraseTreeItem* cutItem, bool warnUser); public slots: - void itemExpanded (QListViewItem *item); - void itemCollapsed (QListViewItem *item); + void itemExpanded (Q3ListViewItem *item); + void itemCollapsed (Q3ListViewItem *item); signals: void shortcutRequest (PhraseShortcutRequest *request); diff --git a/kmouth/wordcompletion/creationsourcedetailsui.ui.h b/kmouth/wordcompletion/creationsourcedetailsui.ui.h index 956f0217..80485aa6 100644 --- a/kmouth/wordcompletion/creationsourcedetailsui.ui.h +++ b/kmouth/wordcompletion/creationsourcedetailsui.ui.h @@ -12,7 +12,7 @@ void CreationSourceDetailsUI::init() { languageButton = new KLanguageButton (this, "languageButton"); CreationSourceDetailsUILayout->addWidget (languageButton, 2, 1); languageLabel->setBuddy (languageButton); - QWhatsThis::add (languageButton, i18n("With this combo box you decide which language should be associated with the new dictionary.")); + languageButton->setWhatsThis( i18n("With this combo box you decide which language should be associated with the new dictionary.")); loadLanguageList(languageButton); languageButton->insertLanguage("??", i18n("Other"), QString::fromLatin1("l10n/"), QString::null); diff --git a/kmouth/wordcompletion/creationsourceui.ui.h b/kmouth/wordcompletion/creationsourceui.ui.h index d78a439a..82dc7ba8 100644 --- a/kmouth/wordcompletion/creationsourceui.ui.h +++ b/kmouth/wordcompletion/creationsourceui.ui.h @@ -9,11 +9,11 @@ void CreationSourceUI::init() { - group1 = new QButtonGroup (0); + group1 = new Q3ButtonGroup (0); group1->insert (createButton); group1->insert (mergeButton); group1->insert (emptyButton); - group2 = new QButtonGroup (0); + group2 = new Q3ButtonGroup (0); group2->insert (kdeDocButton); group2->insert (fileButton); group2->insert (directoryButton); diff --git a/kmouth/wordcompletion/dictionarycreationwizard.cpp b/kmouth/wordcompletion/dictionarycreationwizard.cpp index a0711ce5..9a902546 100644 --- a/kmouth/wordcompletion/dictionarycreationwizard.cpp +++ b/kmouth/wordcompletion/dictionarycreationwizard.cpp @@ -22,7 +22,11 @@ #include #include #include -#include + +//Added by qt3to4: +#include +#include +#include #include #include @@ -61,9 +65,9 @@ DictionaryCreationWizard::DictionaryCreationWizard (QWidget *parent, const char dirWidget= new CreationSourceDetailsUI (this, "directory source page"); addPage (dirWidget, i18n("Source of New Dictionary (2)")); dirWidget->urlLabel->setText (i18n("&Directory:")); - QWhatsThis::add (dirWidget->urlLabel, i18n("With this input field you specify which directory you want to load for creating the new dictionary.")); + dirWidget->urlLabel->setWhatsThis( i18n("With this input field you specify which directory you want to load for creating the new dictionary.")); dirWidget->url->setMode(KFile::Directory); - QWhatsThis::add (dirWidget->url, i18n("With this input field you specify which directory you want to load for creating the new dictionary.")); + dirWidget->url->setWhatsThis( i18n("With this input field you specify which directory you want to load for creating the new dictionary.")); buildCodecCombo (dirWidget->encodingCombo); kdeDocWidget= new KDEDocSourceUI (this, "KDE documentation source page"); @@ -90,7 +94,7 @@ DictionaryCreationWizard::~DictionaryCreationWizard () { } void DictionaryCreationWizard::buildCodecList () { - codecList = new QPtrList; + codecList = new Q3PtrList; QTextCodec *codec; int i; for (i = 0; (codec = QTextCodec::codecForIndex(i)); i++) @@ -277,14 +281,14 @@ QString DictionaryCreationWizard::language() { MergeWidget::MergeWidget(KWizard *parent, const char *name, QStringList dictionaryNames, QStringList dictionaryFiles, QStringList dictionaryLanguages) -: QScrollView (parent, name) { +: Q3ScrollView (parent, name) { dictionaries.setAutoDelete (false); weights.setAutoDelete (false); QWidget *contents = new QWidget(viewport()); addChild(contents); QGridLayout *layout = new QGridLayout (contents); - setResizePolicy (QScrollView::AutoOneFit); + setResizePolicy (Q3ScrollView::AutoOneFit); layout->setColStretch (0, 0); layout->setColStretch (1, 1); @@ -315,7 +319,7 @@ MergeWidget::~MergeWidget() { QMap MergeWidget::mergeParameters () { QMap files; - QDictIterator it(dictionaries); + Q3DictIterator it(dictionaries); for (; it.current(); ++it) { if (it.current()->isChecked()) { QString name = it.currentKey(); @@ -328,7 +332,7 @@ QMap MergeWidget::mergeParameters () { } QString MergeWidget::language () { - QDictIterator it(dictionaries); + Q3DictIterator it(dictionaries); for (; it.current(); ++it) { if (it.current()->isChecked()) { return languages [it.currentKey()]; diff --git a/kmouth/wordcompletion/dictionarycreationwizard.h b/kmouth/wordcompletion/dictionarycreationwizard.h index 18928e12..2a8bc27d 100644 --- a/kmouth/wordcompletion/dictionarycreationwizard.h +++ b/kmouth/wordcompletion/dictionarycreationwizard.h @@ -20,7 +20,7 @@ #ifndef DICTIONARYCREATIONWIZARD_H #define DICTIONARYCREATIONWIZARD_H -#include +#include #include #include @@ -66,7 +66,7 @@ private: KDEDocSourceUI *kdeDocWidget; MergeWidget *mergeWidget; - QPtrList *codecList; + Q3PtrList *codecList; }; /** @@ -74,7 +74,7 @@ private: * KDE documentation. * @author Gunnar Schmi Dt */ -class MergeWidget : public QScrollView { +class MergeWidget : public Q3ScrollView { Q_OBJECT public: MergeWidget(KWizard *parent, const char *name, @@ -87,8 +87,8 @@ public: QString language (); private: - QDict dictionaries; - QDict weights; + Q3Dict dictionaries; + Q3Dict weights; QMap languages; }; diff --git a/kmouth/wordcompletion/kdedocsourceui.ui.h b/kmouth/wordcompletion/kdedocsourceui.ui.h index 4c42b324..ae2efdb2 100644 --- a/kmouth/wordcompletion/kdedocsourceui.ui.h +++ b/kmouth/wordcompletion/kdedocsourceui.ui.h @@ -11,7 +11,7 @@ void KDEDocSourceUI::init() { languageButton = new KLanguageButton (this, "languageButton"); KDEDocSourceUILayout->addWidget (languageButton, 0, 1); languageLabel->setBuddy (languageButton); - QWhatsThis::add (languageButton, i18n("With this combo box you select which of the installed languages is used for creating the new dictionary. KMouth will only parse documentation files of this language.")); + languageButton->setWhatsThis( i18n("With this combo box you select which of the installed languages is used for creating the new dictionary. KMouth will only parse documentation files of this language.")); loadLanguageList(languageButton); diff --git a/kmouth/wordcompletion/klanguagebutton.cpp b/kmouth/wordcompletion/klanguagebutton.cpp index 8a55bebc..e9d1c708 100644 --- a/kmouth/wordcompletion/klanguagebutton.cpp +++ b/kmouth/wordcompletion/klanguagebutton.cpp @@ -23,7 +23,9 @@ */ #define INCLUDE_MENUITEM_DEF -#include +#include +//Added by qt3to4: +#include #include #include "klanguagebutton.h" @@ -31,7 +33,7 @@ #include -static inline void checkInsertPos( QPopupMenu *popup, const QString & str, +static inline void checkInsertPos( Q3PopupMenu *popup, const QString & str, int &index ) { if ( index == -2 ) @@ -57,12 +59,12 @@ static inline void checkInsertPos( QPopupMenu *popup, const QString & str, index = a; // it doesn't really matter ... a == b here. } -static inline QPopupMenu * checkInsertIndex( QPopupMenu *popup, +static inline Q3PopupMenu * checkInsertIndex( Q3PopupMenu *popup, const QStringList *tags, const QString &submenu ) { int pos = tags->findIndex( submenu ); - QPopupMenu *pi = 0; + Q3PopupMenu *pi = 0; if ( pos != -1 ) { QMenuItem *p = popup->findItem( pos ); @@ -90,10 +92,10 @@ KLanguageButton::KLanguageButton( QWidget * parent, const char *name ) clear(); } -void KLanguageButton::insertItem( const QIconSet& icon, const QString &text, +void KLanguageButton::insertItem( const QIcon& icon, const QString &text, const QString &tag, const QString &submenu, int index ) { - QPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu ); + Q3PopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu ); checkInsertPos( pi, text, index ); pi->insertItem( icon, text, count(), index ); m_tags->append( tag ); @@ -102,7 +104,7 @@ void KLanguageButton::insertItem( const QIconSet& icon, const QString &text, void KLanguageButton::insertItem( const QString &text, const QString &tag, const QString &submenu, int index ) { - QPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu ); + Q3PopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu ); checkInsertPos( pi, text, index ); pi->insertItem( text, count(), index ); m_tags->append( tag ); @@ -110,7 +112,7 @@ void KLanguageButton::insertItem( const QString &text, const QString &tag, void KLanguageButton::insertSeparator( const QString &submenu, int index ) { - QPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu ); + Q3PopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu ); pi->insertSeparator( index ); m_tags->append( QString::null ); } @@ -118,8 +120,8 @@ void KLanguageButton::insertSeparator( const QString &submenu, int index ) void KLanguageButton::insertSubmenu( const QString &text, const QString &tag, const QString &submenu, int index ) { - QPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu ); - QPopupMenu *p = new QPopupMenu( pi ); + Q3PopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu ); + Q3PopupMenu *p = new Q3PopupMenu( pi ); checkInsertPos( pi, text, index ); pi->insertItem( text, p, count(), index ); m_tags->append( tag ); @@ -165,7 +167,7 @@ void KLanguageButton::clear() delete m_oldPopup; m_oldPopup = m_popup; - m_popup = new QPopupMenu( this ); + m_popup = new Q3PopupMenu( this ); setPopup( m_popup ); @@ -175,7 +177,7 @@ void KLanguageButton::clear() SIGNAL( highlighted( int ) ) ); setText( QString::null ); - setIconSet( QIconSet() ); + setIconSet( QIcon() ); } /*void KLanguageButton::changeLanguage( const QString& name, int i ) @@ -219,7 +221,7 @@ void KLanguageButton::setCurrentItem( int i ) m_current = i; setText( m_popup->text( m_current ) ); - QIconSet *icon = m_popup->iconSet( m_current ); + QIcon *icon = m_popup->iconSet( m_current ); if( icon ) setIconSet( *icon ); else diff --git a/kmouth/wordcompletion/klanguagebutton.h b/kmouth/wordcompletion/klanguagebutton.h index ee1d58f8..af8c79c9 100644 --- a/kmouth/wordcompletion/klanguagebutton.h +++ b/kmouth/wordcompletion/klanguagebutton.h @@ -28,6 +28,8 @@ #define __KLANGBUTTON_H__ #include "kpushbutton.h" +//Added by qt3to4: +#include /* * Extended QPushButton that shows a menu with submenu for language selection. @@ -45,7 +47,7 @@ public: KLanguageButton(QWidget *parent=0, const char *name=0); ~KLanguageButton(); - void insertItem( const QIconSet& icon, const QString &text, + void insertItem( const QIcon& icon, const QString &text, const QString &tag, const QString &submenu = QString::null, int index = -1 ); void insertItem( const QString &text, const QString &tag, @@ -86,7 +88,7 @@ private slots: private: // work space for the new class QStringList *m_tags; - QPopupMenu *m_popup, *m_oldPopup; + Q3PopupMenu *m_popup, *m_oldPopup; int m_current; }; diff --git a/kmouth/wordcompletion/wordcompletion.cpp b/kmouth/wordcompletion/wordcompletion.cpp index d4ae6515..f20683b1 100644 --- a/kmouth/wordcompletion/wordcompletion.cpp +++ b/kmouth/wordcompletion/wordcompletion.cpp @@ -1,5 +1,8 @@ #include #include +//Added by qt3to4: +#include +#include #include #include @@ -39,7 +42,7 @@ WordCompletion::~WordCompletion() { } typedef QPair Match; -typedef QValueList MatchList; +typedef Q3ValueList MatchList; QString WordCompletion::makeCompletion(const QString &text) { if (d->lastText != text) { @@ -146,7 +149,7 @@ bool WordCompletion::setWordList(const QString &wordlist) { QString filename = d->dictDetails[d->current].filename; QString dictionaryFile = KApplication::kApplication()->dirs()->findResource("appdata", filename); QFile file(dictionaryFile); - if (file.exists() && file.open(IO_ReadOnly)) { + if (file.exists() && file.open(QIODevice::ReadOnly)) { QTextStream stream(&file); stream.setEncoding (QTextStream::UnicodeUTF8); if (!stream.atEnd()) { @@ -199,7 +202,7 @@ void WordCompletion::save () { QFile file(dictionaryFile); if (!file.exists()) return; - if (!file.open(IO_WriteOnly)) + if (!file.open(QIODevice::WriteOnly)) return; QTextStream stream(&file); diff --git a/kmouth/wordcompletion/wordcompletionui.ui.h b/kmouth/wordcompletion/wordcompletionui.ui.h index 96878dac..4c30d18d 100644 --- a/kmouth/wordcompletion/wordcompletionui.ui.h +++ b/kmouth/wordcompletion/wordcompletionui.ui.h @@ -12,7 +12,7 @@ void WordCompletionUI::init() { languageButton = new KLanguageButton (selectedDictionaryDetails, "languageButton"); selectedDictionaryDetailsLayout->addWidget (languageButton, 1, 1); languageLabel->setBuddy (languageButton); - QWhatsThis::add (languageButton, i18n("With this combo box you select the language associated with the selected dictionary.")); + languageButton->setWhatsThis( i18n("With this combo box you select the language associated with the selected dictionary.")); loadLanguageList(languageButton); languageButton->insertLanguage("??", i18n("Other"), QString::fromLatin1("l10n/"), QString::null); diff --git a/kmouth/wordcompletion/wordcompletionwidget.cpp b/kmouth/wordcompletion/wordcompletionwidget.cpp index e5eab23b..1a2be189 100644 --- a/kmouth/wordcompletion/wordcompletionwidget.cpp +++ b/kmouth/wordcompletion/wordcompletionwidget.cpp @@ -39,17 +39,17 @@ class DictionaryListItem : public KListViewItem { public: - DictionaryListItem (QListView *parent, QString filename, QString name, QString language, QString languageCode) + DictionaryListItem (Q3ListView *parent, QString filename, QString name, QString language, QString languageCode) : KListViewItem (parent, name) { setFilename (filename); setLanguage (language, languageCode); }; - DictionaryListItem (QListView *parent, QString filename, QString name, QString languageCode) + DictionaryListItem (Q3ListView *parent, QString filename, QString name, QString languageCode) : KListViewItem (parent, name) { setFilename (filename); setLanguage (languageCode); }; - DictionaryListItem (QListView *parent, QListViewItem *after, QString filename, QString name, QString languageCode) + DictionaryListItem (Q3ListView *parent, Q3ListViewItem *after, QString filename, QString name, QString languageCode) : KListViewItem (parent, after, name) { setFilename (filename); setLanguage (languageCode); @@ -155,7 +155,7 @@ void WordCompletionWidget::save() { config->deleteGroup (*it); int number = 0; - QListViewItemIterator it(dictionaryList); + Q3ListViewItemIterator it(dictionaryList); while (it.current()) { DictionaryListItem *item = dynamic_cast(it.current()); if (item != 0) { @@ -184,7 +184,7 @@ void WordCompletionWidget::addDictionary() { QStringList dictionaryNames; QStringList dictionaryFiles; QStringList dictionaryLanguages; - QListViewItemIterator it(dictionaryList); + Q3ListViewItemIterator it(dictionaryList); while (it.current()) { DictionaryListItem *item = dynamic_cast(it.current()); if (item != 0) { @@ -219,10 +219,10 @@ void WordCompletionWidget::deleteDictionary() { } void WordCompletionWidget::moveUp() { - QListViewItem *item = dictionaryList->selectedItem (); + Q3ListViewItem *item = dictionaryList->selectedItem (); if (item != 0) { - QListViewItem *above = item->itemAbove(); + Q3ListViewItem *above = item->itemAbove(); if (above != 0) { above->moveItem (item); @@ -231,10 +231,10 @@ void WordCompletionWidget::moveUp() { } void WordCompletionWidget::moveDown() { - QListViewItem *item = dictionaryList->selectedItem (); + Q3ListViewItem *item = dictionaryList->selectedItem (); if (item != 0) { - QListViewItem *next = item->itemBelow(); + Q3ListViewItem *next = item->itemBelow(); if (next != 0) { item->moveItem (next); @@ -296,7 +296,7 @@ void WordCompletionWidget::selectionChanged() { } void WordCompletionWidget::nameChanged (const QString &text) { - QListViewItem *item = dictionaryList->selectedItem (); + Q3ListViewItem *item = dictionaryList->selectedItem (); if (item != 0) { QString old = item->text(0); diff --git a/kmouth/wordcompletion/wordlist.cpp b/kmouth/wordcompletion/wordlist.cpp index 67f05d82..54f5402b 100644 --- a/kmouth/wordcompletion/wordlist.cpp +++ b/kmouth/wordcompletion/wordlist.cpp @@ -19,6 +19,9 @@ #include #include +//Added by qt3to4: +#include +#include #include #include @@ -118,7 +121,7 @@ KProgressDialog *progressDialog() { bool saveWordList (WordMap map, QString filename) { QFile file(filename); - if(!file.open(IO_WriteOnly)) + if(!file.open(QIODevice::WriteOnly)) return false; QTextStream stream(&file); @@ -171,7 +174,7 @@ void addWordsFromFile (WordMap &map, QString filename, QTextStream::Encoding enc addWords(map, parser.getList()); else { QFile wpdfile(filename); - if (wpdfile.open(IO_ReadOnly)) { + if (wpdfile.open(QIODevice::ReadOnly)) { QTextStream stream(&wpdfile); stream.setEncoding (QTextStream::UnicodeUTF8); @@ -196,7 +199,7 @@ void addWordsFromFile (WordMap &map, QString filename, QTextStream::Encoding enc } else { // Count the words in an ordinary text file QFile file(filename); - if (file.open(IO_ReadOnly)) { + if (file.open(QIODevice::ReadOnly)) { QTextStream stream(&file); if (codec != 0) stream.setCodec (codec); @@ -350,7 +353,7 @@ struct AffEntry { QString add; QStringList condition; }; -typedef QValueList AffList; +typedef Q3ValueList AffList; typedef QMap AffMap; /** Loads an *.aff file (part of OpenOffice.org dictionaries) @@ -359,7 +362,7 @@ void loadAffFile(const QString &filename, AffMap &prefixes, AffMap &suffixes) { bool cross = false; QFile afile(filename); - if (afile.open(IO_ReadOnly)) { + if (afile.open(QIODevice::ReadOnly)) { QTextStream stream(&afile); while (!stream.atEnd()) { QString s = stream.readLine(); @@ -510,7 +513,7 @@ WordMap spellCheck (WordMap map, QString dictionary, KProgressDialog *pdlg) { int percent = 0; QFile dfile(dictionary); - if (dfile.open(IO_ReadOnly)) { + if (dfile.open(QIODevice::ReadOnly)) { QTextStream stream(&dfile); if (!stream.atEnd()) { diff --git a/kmouth/wordcompletion/wordlist.h b/kmouth/wordcompletion/wordlist.h index d2f85ac0..75656200 100644 --- a/kmouth/wordcompletion/wordlist.h +++ b/kmouth/wordcompletion/wordlist.h @@ -21,10 +21,12 @@ #define WORDLIST_H #include -#include +#include #include #include #include +//Added by qt3to4: +#include class QTextCodec; class KProgressDialog; -- 2.11.4.GIT