summaryrefslogtreecommitdiffstats
path: root/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
commitd6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch)
treed109539636691d7b03036ca1c0ed29dbae6577cf /parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp
parent3331a47a9cad24795c7440ee8107143ce444ef34 (diff)
downloadtdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz
tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp')
-rw-r--r--parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp120
1 files changed, 60 insertions, 60 deletions
diff --git a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp
index a4480cbf..6dd73707 100644
--- a/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp
+++ b/parts/documentation/plugins/kdevtoc/dockdevtocplugin.cpp
@@ -21,10 +21,10 @@
#include <unistd.h>
-#include <qdom.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qdialog.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqdialog.h>
#include <kurl.h>
#include <kaboutdata.h>
@@ -42,20 +42,20 @@
class TOCDocumentationCatalogItem: public DocumentationCatalogItem
{
public:
- TOCDocumentationCatalogItem(const QString &tocFile, DocumentationPlugin* plugin,
- KListView *parent, const QString &name)
+ TOCDocumentationCatalogItem(const TQString &tocFile, DocumentationPlugin* plugin,
+ KListView *parent, const TQString &name)
:DocumentationCatalogItem(plugin, parent, name), m_tocFile(tocFile)
{
}
- TOCDocumentationCatalogItem(const QString &tocFile, DocumentationPlugin* plugin,
- DocumentationItem *parent, const QString &name)
+ TOCDocumentationCatalogItem(const TQString &tocFile, DocumentationPlugin* plugin,
+ DocumentationItem *parent, const TQString &name)
:DocumentationCatalogItem(plugin, parent, name), m_tocFile(tocFile)
{
}
- QString tocFile() const { return m_tocFile; }
+ TQString tocFile() const { return m_tocFile; }
private:
- QString m_tocFile;
+ TQString m_tocFile;
};
@@ -63,8 +63,8 @@ static const KDevPluginInfo data("dockdevtocplugin");
typedef KDevGenericFactory<DocKDevTOCPlugin> DocKDevTOCPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libdockdevtocplugin, DocKDevTOCPluginFactory(data) )
-DocKDevTOCPlugin::DocKDevTOCPlugin(QObject* parent, const char* name,
- const QStringList /*args*/)
+DocKDevTOCPlugin::DocKDevTOCPlugin(TQObject* parent, const char* name,
+ const TQStringList /*args*/)
:DocumentationPlugin(DocKDevTOCPluginFactory::instance()->config(), parent, name)
{
setCapabilities(Index);
@@ -75,45 +75,45 @@ DocKDevTOCPlugin::~DocKDevTOCPlugin()
{
}
-QString DocKDevTOCPlugin::pluginName() const
+TQString DocKDevTOCPlugin::pluginName() const
{
return i18n("KDevelopTOC Documentation Collection");
}
-DocumentationCatalogItem* DocKDevTOCPlugin::createCatalog(KListView* contents, const QString& title, const QString& url)
+DocumentationCatalogItem* DocKDevTOCPlugin::createCatalog(KListView* contents, const TQString& title, const TQString& url)
{
return new TOCDocumentationCatalogItem(url, this, contents, title);
}
-QPair<KFile::Mode, QString> DocKDevTOCPlugin::catalogLocatorProps()
+QPair<KFile::Mode, TQString> DocKDevTOCPlugin::catalogLocatorProps()
{
- return QPair<KFile::Mode, QString>(KFile::File, "*.toc");
+ return QPair<KFile::Mode, TQString>(KFile::File, "*.toc");
}
-QString DocKDevTOCPlugin::catalogTitle(const QString& url)
+TQString DocKDevTOCPlugin::catalogTitle(const TQString& url)
{
- QFileInfo fi(url);
+ TQFileInfo fi(url);
if (!fi.exists())
- return QString::null;
+ return TQString::null;
- QFile f(url);
+ TQFile f(url);
if (!f.open(IO_ReadOnly))
- return QString::null;
+ return TQString::null;
- QDomDocument doc;
+ TQDomDocument doc;
if (!doc.setContent(&f) || (doc.doctype().name() != "kdeveloptoc"))
- return QString::null;
+ return TQString::null;
f.close();
- QDomElement titleEl = doc.documentElement().namedItem("title").toElement();
+ TQDomElement titleEl = doc.documentElement().namedItem("title").toElement();
return titleEl.firstChild().toText().data();
}
-QStringList DocKDevTOCPlugin::fullTextSearchLocations()
+TQStringList DocKDevTOCPlugin::fullTextSearchLocations()
{
- return QStringList();
+ return TQStringList();
}
bool DocKDevTOCPlugin::needRefreshIndex(DocumentationCatalogItem* /*item*/)
@@ -123,9 +123,9 @@ bool DocKDevTOCPlugin::needRefreshIndex(DocumentationCatalogItem* /*item*/)
void DocKDevTOCPlugin::autoSetupPlugin()
{
- QStringList tocsDir = DocKDevTOCPluginFactory::instance()->dirs()->findAllResources("data", "kdevdocumentation/tocs/*.toc");
+ TQStringList tocsDir = DocKDevTOCPluginFactory::instance()->dirs()->findAllResources("data", "kdevdocumentation/tocs/*.toc");
- for (QStringList::const_iterator it = tocsDir.begin(); it != tocsDir.end(); ++it)
+ for (TQStringList::const_iterator it = tocsDir.begin(); it != tocsDir.end(); ++it)
{
config->setGroup("Locations");
config->writePathEntry(catalogTitle(*it), *it);
@@ -138,15 +138,15 @@ void DocKDevTOCPlugin::createIndex(IndexBox* index, DocumentationCatalogItem* it
if (!tocItem)
return;
- QFileInfo fi(tocItem->tocFile());
+ TQFileInfo fi(tocItem->tocFile());
- QFile f(tocItem->tocFile());
+ TQFile f(tocItem->tocFile());
if (!f.open(IO_ReadOnly))
{
kdDebug(9002) << "Could not read" << tocItem->tocFile() << endl;
return;
}
- QDomDocument doc;
+ TQDomDocument doc;
if (!doc.setContent(&f) || doc.doctype().name() != "kdeveloptoc")
{
kdDebug(9002) << "Not a valid kdeveloptoc file: " << tocItem->tocFile() << endl;
@@ -154,21 +154,21 @@ void DocKDevTOCPlugin::createIndex(IndexBox* index, DocumentationCatalogItem* it
}
f.close();
- QDomElement docEl = doc.documentElement();
- QDomElement baseEl = docEl.namedItem("base").toElement();
+ TQDomElement docEl = doc.documentElement();
+ TQDomElement baseEl = docEl.namedItem("base").toElement();
- QString base;
+ TQString base;
if (!baseEl.isNull())
- base = baseEl.attribute("href", QString::null);
+ base = baseEl.attribute("href", TQString::null);
- QDomElement indexEl = docEl.namedItem("index").toElement();
- QDomElement childEl = indexEl.firstChild().toElement();
+ TQDomElement indexEl = docEl.namedItem("index").toElement();
+ TQDomElement childEl = indexEl.firstChild().toElement();
while (!childEl.isNull())
{
if (childEl.tagName() == "entry")
{
- QString name = childEl.attribute("name");
- QString url = childEl.attribute("url");
+ TQString name = childEl.attribute("name");
+ TQString url = childEl.attribute("url");
IndexItemProto *ii = new IndexItemProto(this, item, index, name, item->text(0));
ii->addURL(KURL(constructURL(base, url)));
@@ -183,15 +183,15 @@ void DocKDevTOCPlugin::createTOC(DocumentationCatalogItem* item)
if (!tocItem)
return;
- QFileInfo fi(tocItem->tocFile());
+ TQFileInfo fi(tocItem->tocFile());
- QFile f(tocItem->tocFile());
+ TQFile f(tocItem->tocFile());
if (!f.open(IO_ReadOnly))
{
kdDebug(9002) << "Could not read" << tocItem->tocFile() << endl;
return;
}
- QDomDocument doc;
+ TQDomDocument doc;
if (!doc.setContent(&f) || doc.doctype().name() != "kdeveloptoc")
{
kdDebug(9002) << "Not a valid kdeveloptoc file: " << tocItem->tocFile() << endl;
@@ -199,30 +199,30 @@ void DocKDevTOCPlugin::createTOC(DocumentationCatalogItem* item)
}
f.close();
- QDomElement docEl = doc.documentElement();
- QDomElement baseEl = docEl.namedItem("base").toElement();
+ TQDomElement docEl = doc.documentElement();
+ TQDomElement baseEl = docEl.namedItem("base").toElement();
- QString base;
+ TQString base;
if (!baseEl.isNull())
- base = baseEl.attribute("href", QString::null);
+ base = baseEl.attribute("href", TQString::null);
- QDomElement childEl = docEl.lastChild().toElement();
+ TQDomElement childEl = docEl.lastChild().toElement();
addTocSect(tocItem, childEl, base, 1);
}
-void DocKDevTOCPlugin::addTocSect(DocumentationItem *parent, QDomElement childEl, const QString &base, uint level)
+void DocKDevTOCPlugin::addTocSect(DocumentationItem *parent, TQDomElement childEl, const TQString &base, uint level)
{
while (!childEl.isNull())
{
- if (childEl.tagName() == QString("tocsect%1").arg(level))
+ if (childEl.tagName() == TQString("tocsect%1").arg(level))
{
- QString name = childEl.attribute("name");
- QString url = childEl.attribute("url");
+ TQString name = childEl.attribute("name");
+ TQString url = childEl.attribute("url");
DocumentationItem *item = new DocumentationItem(level == 1 ? DocumentationItem::Book : DocumentationItem::Document, parent, name);
item->setURL(KURL(constructURL(base, url)));
- QDomElement grandchildEl = childEl.lastChild().toElement();
+ TQDomElement grandchildEl = childEl.lastChild().toElement();
addTocSect(item, grandchildEl, base, level+1);
}
childEl = childEl.previousSibling().toElement();
@@ -235,15 +235,15 @@ void DocKDevTOCPlugin::setCatalogURL(DocumentationCatalogItem* item)
if (!tocItem)
return;
- QFileInfo fi(tocItem->tocFile());
+ TQFileInfo fi(tocItem->tocFile());
- QFile f(tocItem->tocFile());
+ TQFile f(tocItem->tocFile());
if (!f.open(IO_ReadOnly))
{
kdDebug(9002) << "Could not read" << tocItem->tocFile() << endl;
return;
}
- QDomDocument doc;
+ TQDomDocument doc;
if (!doc.setContent(&f) || doc.doctype().name() != "kdeveloptoc")
{
kdDebug(9002) << "Not a valid kdeveloptoc file: " << tocItem->tocFile() << endl;
@@ -251,20 +251,20 @@ void DocKDevTOCPlugin::setCatalogURL(DocumentationCatalogItem* item)
}
f.close();
- QDomElement docEl = doc.documentElement();
- QDomElement baseEl = docEl.namedItem("base").toElement();
+ TQDomElement docEl = doc.documentElement();
+ TQDomElement baseEl = docEl.namedItem("base").toElement();
if (item->url().isEmpty())
{
if (baseEl.isNull())
item->setURL(KURL());
else
- item->setURL(KURL(constructURL(baseEl.attribute("href", QString::null),
- baseEl.attribute("url", QString::null))));
+ item->setURL(KURL(constructURL(baseEl.attribute("href", TQString::null),
+ baseEl.attribute("url", TQString::null))));
}
}
-QString DocKDevTOCPlugin::constructURL(const QString &base, const QString &url)
+TQString DocKDevTOCPlugin::constructURL(const TQString &base, const TQString &url)
{
if (base.isEmpty() && !url.isEmpty())
return url;