From 48d4a26399959121f33d2bc3bfe51c7827b654fc Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 14 Jun 2011 16:45:05 +0000 Subject: TQt4 port kdevelop This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../interfaces/kdevdocumentationplugin.cpp | 58 +++++++++++----------- .../interfaces/kdevdocumentationplugin.h | 28 ++++++----- 2 files changed, 44 insertions(+), 42 deletions(-) (limited to 'parts/documentation/interfaces') diff --git a/parts/documentation/interfaces/kdevdocumentationplugin.cpp b/parts/documentation/interfaces/kdevdocumentationplugin.cpp index 3364f71a..22c375d2 100644 --- a/parts/documentation/interfaces/kdevdocumentationplugin.cpp +++ b/parts/documentation/interfaces/kdevdocumentationplugin.cpp @@ -33,30 +33,30 @@ //class DocumentationItem -DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListView *parent, +DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListView *tqparent, const TQString &name) - :KListViewItem(parent, name), m_type(type) + :KListViewItem(tqparent, name), m_type(type) { init(); } -DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListViewItem *parent, +DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListViewItem *tqparent, const TQString &name) - :KListViewItem(parent, name), m_type(type) + :KListViewItem(tqparent, name), m_type(type) { init(); } -DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListView *parent, +DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListView *tqparent, KListViewItem *after, const TQString &name) - :KListViewItem(parent, after, name), m_type(type) + :KListViewItem(tqparent, after, name), m_type(type) { init(); } -DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListViewItem * parent, +DocumentationItem::DocumentationItem(DocumentationItem::Type type, KListViewItem * tqparent, KListViewItem * after, const TQString & name ) - :KListViewItem(parent, after, name), m_type(type) + :KListViewItem(tqparent, after, name), m_type(type) { init(); } @@ -90,8 +90,8 @@ void DocumentationItem::init( ) DocumentationCatalogItem::DocumentationCatalogItem(DocumentationPlugin* plugin, - KListView *parent, const TQString &name) - :DocumentationItem(DocumentationItem::Catalog, parent, name), m_plugin(plugin), + KListView *tqparent, const TQString &name) + :DocumentationItem(DocumentationItem::Catalog, tqparent, name), m_plugin(plugin), isLoaded(false), isActivated(false), m_isProjectDocumentationItem(false) { setExpandable(true); @@ -99,8 +99,8 @@ DocumentationCatalogItem::DocumentationCatalogItem(DocumentationPlugin* plugin, } DocumentationCatalogItem::DocumentationCatalogItem(DocumentationPlugin* plugin, - DocumentationItem *parent, const TQString &name) - :DocumentationItem(DocumentationItem::Catalog, parent, name), m_plugin(plugin), + DocumentationItem *tqparent, const TQString &name) + :DocumentationItem(DocumentationItem::Catalog, tqparent, name), m_plugin(plugin), isLoaded(false), isActivated(false), m_isProjectDocumentationItem(false) { setExpandable(true); @@ -172,7 +172,7 @@ IndexItem::List IndexItem::urls() const TQValueList itemProtos = m_listbox->items[text()]; for (TQValueList::const_iterator it = itemProtos.begin(); it != itemProtos.end(); ++it) - urlList.append(qMakePair((*it)->description(), (*it)->url())); + urlList.append(tqMakePair((*it)->description(), (*it)->url())); return urlList; } @@ -181,9 +181,9 @@ IndexItem::List IndexItem::urls() const //class ConfigurationItem -ConfigurationItem::ConfigurationItem(TQListView *parent, DocumentationPlugin * plugin, const TQString &title, const TQString &url, +ConfigurationItem::ConfigurationItem(TQListView *tqparent, DocumentationPlugin * plugin, const TQString &title, const TQString &url, bool indexPossible, bool fullTextSearchPossible) - :TQCheckListItem(parent, "", TQCheckListItem::CheckBox), m_title(title), m_url(url), + :TQCheckListItem(tqparent, "", TQCheckListItem::CheckBox), m_title(title), m_url(url), m_origTitle(title), m_contents(true), m_index(false), m_fullTextSearch(false), m_indexPossible(indexPossible), m_fullTextSearchPossible(fullTextSearchPossible), m_docPlugin( plugin ) @@ -209,7 +209,7 @@ void ConfigurationItem::paintCell(TQPainter *p, const TQColorGroup &cg, int colu p->fillRect(0, 0, width, height(), cg.brush(crole)); TQFontMetrics fm(lv->fontMetrics()); - int boxsize = lv->style().pixelMetric(TQStyle::PM_CheckListButtonSize, lv); + int boxsize = lv->tqstyle().tqpixelMetric(TQStyle::PM_CheckListButtonSize, lv); int marg = lv->itemMargin(); int styleflags = TQStyle::Style_Default; @@ -229,7 +229,7 @@ void ConfigurationItem::paintCell(TQPainter *p, const TQColorGroup &cg, int colu y = (fm.height() + 2 + marg - boxsize) / 2; TQStyleOption opt(this); - lv->style().drawPrimitive(TQStyle::PE_CheckListIndicator, p, + lv->tqstyle().tqdrawPrimitive(TQStyle::PE_CheckListIndicator, p, TQRect(x, y, boxsize, fm.height() + 2 + marg), cg, styleflags, opt); return; @@ -240,7 +240,7 @@ void ConfigurationItem::paintCell(TQPainter *p, const TQColorGroup &cg, int colu int ConfigurationItem::width(const TQFontMetrics &fm, const TQListView *lv, int c) const { if ((c == 0) || (c == 1) || (c == 2)) - return lv->style().pixelMetric(TQStyle::PM_CheckListButtonSize, lv) + 4; + return lv->tqstyle().tqpixelMetric(TQStyle::PM_CheckListButtonSize, lv) + 4; return TQListViewItem::width(fm, lv, c); } @@ -253,8 +253,8 @@ int ConfigurationItem::width(const TQFontMetrics &fm, const TQListView *lv, int //class DocumentationPlugin -DocumentationPlugin::DocumentationPlugin(KConfig *pluginConfig, TQObject *parent, const char *name) - :TQObject(parent, name), config(pluginConfig), m_indexCreated(false) +DocumentationPlugin::DocumentationPlugin(KConfig *pluginConfig, TQObject *tqparent, const char *name) + :TQObject(tqparent, name), config(pluginConfig), m_indexCreated(false) { } @@ -462,7 +462,7 @@ void DocumentationPlugin::reinit(KListView *contents, IndexBox *index, TQStringL for (TQStringList::const_iterator it = deletedConfigurationItems.constBegin(); it != deletedConfigurationItems.constEnd(); ++it) { - if (namedCatalogs.contains(*it)) + if (namedCatalogs.tqcontains(*it)) delete namedCatalogs[*it]; } deletedConfigurationItems.clear(); @@ -472,15 +472,15 @@ void DocumentationPlugin::reinit(KListView *contents, IndexBox *index, TQStringL it != entryMap.end(); ++it) { config->setGroup("Locations"); - if (restrictions.contains(it.key()) || (!catalogEnabled(it.key()))) + if (restrictions.tqcontains(it.key()) || (!catalogEnabled(it.key()))) { - if (namedCatalogs.contains(it.key())) + if (namedCatalogs.tqcontains(it.key())) delete namedCatalogs[it.key()]; } else { kdDebug() << "updating 1" << endl; - if (!namedCatalogs.contains(it.key())) //create catalog if it does not exist + if (!namedCatalogs.tqcontains(it.key())) //create catalog if it does not exist { DocumentationCatalogItem * item = createCatalog(contents, it.key(), config->readPathEntry(it.key())); loadIndex(index, item); @@ -493,7 +493,7 @@ void DocumentationPlugin::reinit(KListView *contents, IndexBox *index, TQStringL clearCatalogIndex(namedCatalogs[it.key()]); } else if ( (indexEnabled(namedCatalogs[it.key()])) //index is requested in configuration but does not yet exist - && (!indexes.contains(namedCatalogs[it.key()])) ) + && (!indexes.tqcontains(namedCatalogs[it.key()])) ) { kdDebug() << " index requested " << endl; loadIndex(index, namedCatalogs[it.key()]); @@ -512,7 +512,7 @@ void DocumentationPlugin::loadCatalogConfiguration(KListView *configurationView) for (TQMap::const_iterator it = entryMap.begin(); it != entryMap.end(); ++it) { - if (namedCatalogs.contains(it.key()) + if (namedCatalogs.tqcontains(it.key()) && namedCatalogs[it.key()]->isProjectDocumentationItem()) continue; @@ -613,8 +613,8 @@ void DocumentationPlugin::setCatalogEnabled(const TQString &name, bool e) //class IndexBox -IndexBox::IndexBox(TQWidget *parent, const char *name) - :KListBox(parent, name), m_dirty(false) +IndexBox::IndexBox(TQWidget *tqparent, const char *name) + :KListBox(tqparent, name), m_dirty(false) { } @@ -630,7 +630,7 @@ void IndexBox::removeIndexItem(IndexItemProto *item) if (items[text].count() == 0) { items.remove(text); - TQListBoxItem *item = findItem(text, Qt::CaseSensitive | Qt::ExactMatch); + TQListBoxItem *item = tqfindItem(text, TQt::CaseSensitive | TQt::ExactMatch); if (item) delete item; } diff --git a/parts/documentation/interfaces/kdevdocumentationplugin.h b/parts/documentation/interfaces/kdevdocumentationplugin.h index 0c1dcf0d..fc7af7e3 100644 --- a/parts/documentation/interfaces/kdevdocumentationplugin.h +++ b/parts/documentation/interfaces/kdevdocumentationplugin.h @@ -43,10 +43,10 @@ public: Document /** URL; + typedef TQPair URL; typedef TQValueList List; IndexItem(IndexBox *listbox, const TQString &text); @@ -136,7 +136,7 @@ private: /**Documentation index view.*/ class IndexBox: public KListBox{ public: - IndexBox(TQWidget *parent = 0, const char *name = 0); + IndexBox(TQWidget *tqparent = 0, const char *name = 0); virtual void addIndexItem(IndexItemProto *item); virtual void removeIndexItem(IndexItemProto *item); @@ -158,10 +158,10 @@ class TQFontMetrics; class DocumentationPlugin; /**Documentation configuration item.*/ -class ConfigurationItem: public QCheckListItem +class ConfigurationItem: public TQCheckListItem { public: - ConfigurationItem(TQListView *parent, DocumentationPlugin * plugin, const TQString &title, const TQString &url, + ConfigurationItem(TQListView *tqparent, DocumentationPlugin * plugin, const TQString &title, const TQString &url, bool indexPossible, bool fullTextSearchPossible); virtual TQString title() const { return m_title; } @@ -214,9 +214,10 @@ methods to load documentation catalogs and indexes for a documentation of that type. It also has methods to configure catalogs and provides a list of URL's for the full text search tool. */ -class DocumentationPlugin: public QObject +class DocumentationPlugin: public TQObject { Q_OBJECT + TQ_OBJECT public: /**Capability of documentation plugin.*/ enum Capability { Index=1 /** catalogLocatorProps() = 0; + virtual TQPair catalogLocatorProps() = 0; /**Returns a title of catalog defined by an url parameter.*/ virtual TQString catalogTitle(const TQString &url) = 0; @@ -389,6 +390,7 @@ Represents functionality to display project documentation catalog and index in d */ class ProjectDocumentationPlugin: public TQObject { Q_OBJECT + TQ_OBJECT public: ProjectDocumentationPlugin(DocumentationPlugin *docPlugin, DocumentationPlugin::ProjectDocType type); virtual ~ProjectDocumentationPlugin(); -- cgit v1.2.3