summaryrefslogtreecommitdiffstats
path: root/parts/documentation/tools/htdig/htdigindex.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/tools/htdig/htdigindex.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/tools/htdig/htdigindex.cpp')
-rw-r--r--parts/documentation/tools/htdig/htdigindex.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/parts/documentation/tools/htdig/htdigindex.cpp b/parts/documentation/tools/htdig/htdigindex.cpp
index 80161301..63e21888 100644
--- a/parts/documentation/tools/htdig/htdigindex.cpp
+++ b/parts/documentation/tools/htdig/htdigindex.cpp
@@ -16,13 +16,13 @@
#include <iostream>
-#include <qapplication.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qlayout.h>
-#include <qtextstream.h>
-#include <qtimer.h>
-#include <qlabel.h>
+#include <tqapplication.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqlayout.h>
+#include <tqtextstream.h>
+#include <tqtimer.h>
+#include <tqlabel.h>
#include <kaboutdata.h>
#include <kapplication.h>
@@ -39,14 +39,14 @@
#define INDEXER
-ProgressDialog::ProgressDialog(bool index, QWidget *parent, const char *name)
+ProgressDialog::ProgressDialog(bool index, TQWidget *parent, const char *name)
:KDialogBase(KDialogBase::Plain, i18n("Generating Search Index"), Cancel | Ok, Close,
parent, name, false)
{
proc = 0;
indexdir = kapp->dirs()->saveLocation("data", "kdevdocumentation/search");
- QDir d; d.mkdir(indexdir);
+ TQDir d; d.mkdir(indexdir);
KConfig config("kdevdocumentation", true);
config.setGroup("htdig");
@@ -58,39 +58,39 @@ ProgressDialog::ProgressDialog(bool index, QWidget *parent, const char *name)
d.mkdir( databaseDir );
showButtonOK( false );
- QGridLayout *grid = new QGridLayout(plainPage(), 5,3, spacingHint());
+ TQGridLayout *grid = new TQGridLayout(plainPage(), 5,3, spacingHint());
- QLabel *l = new QLabel(i18n("Scanning for files"), plainPage());
+ TQLabel *l = new TQLabel(i18n("Scanning for files"), plainPage());
grid->addMultiCellWidget(l, 0, 0, 1, 2);
- filesLabel = new QLabel(plainPage());
+ filesLabel = new TQLabel(plainPage());
grid->addWidget(filesLabel, 1, 2);
setFilesScanned(0);
- check1 = new QLabel(plainPage());
+ check1 = new TQLabel(plainPage());
grid->addWidget(check1, 0, 0);
- l = new QLabel(i18n("Extracting search terms"), plainPage());
+ l = new TQLabel(i18n("Extracting search terms"), plainPage());
grid->addMultiCellWidget(l, 2,2, 1,2);
bar = new KProgress(plainPage());
grid->addWidget(bar, 3,2);
- check2 = new QLabel(plainPage());
+ check2 = new TQLabel(plainPage());
grid->addWidget(check2, 2,0);
- l = new QLabel(i18n("Generating index..."), plainPage());
+ l = new TQLabel(i18n("Generating index..."), plainPage());
grid->addMultiCellWidget(l, 4,4, 1,2);
- check3 = new QLabel(plainPage());
+ check3 = new TQLabel(plainPage());
grid->addWidget(check3, 4,0);
setState(0);
setMinimumWidth(300);
- connect(this, SIGNAL(cancelClicked()), this, SLOT(cancelClicked()));
- connect(this, SIGNAL(okClicked()), this, SLOT(okClicked()));
- QTimer::singleShot(0, this, SLOT(slotDelayedStart()));
+ connect(this, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(cancelClicked()));
+ connect(this, TQT_SIGNAL(okClicked()), this, TQT_SLOT(okClicked()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedStart()));
}
ProgressDialog::~ProgressDialog()
@@ -137,8 +137,8 @@ void ProgressDialog::setFilesDigged(int n)
void ProgressDialog::setState(int n)
{
- QPixmap unchecked = QPixmap(locate("data", "kdevdocumentation/pics/unchecked.xpm"));
- QPixmap checked = QPixmap(locate("data", "kdevdocumentation/pics/checked.xpm"));
+ TQPixmap unchecked = TQPixmap(locate("data", "kdevdocumentation/pics/unchecked.xpm"));
+ TQPixmap checked = TQPixmap(locate("data", "kdevdocumentation/pics/checked.xpm"));
check1->setPixmap( n > 0 ? checked : unchecked);
check2->setPixmap( n > 1 ? checked : unchecked);
@@ -146,13 +146,13 @@ void ProgressDialog::setState(int n)
}
-void ProgressDialog::addDir(const QString &dir)
+void ProgressDialog::addDir(const TQString &dir)
{
kdDebug(9002) << "Add dir : " << dir << endl;
- QDir d(dir, "*.html", QDir::Name|QDir::IgnoreCase, QDir::Files | QDir::Readable);
- QStringList list = d.entryList();
+ TQDir d(dir, "*.html", TQDir::Name|TQDir::IgnoreCase, TQDir::Files | TQDir::Readable);
+ TQStringList list = d.entryList();
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it=list.begin(); it!=list.end(); ++it )
{
if( (*it).right( 12 ).lower( ) == "-source.html" )
@@ -162,8 +162,8 @@ void ProgressDialog::addDir(const QString &dir)
setFilesScanned(++filesScanned);
}
- QDir d2(dir, QString::null, QDir::Name|QDir::IgnoreCase, QDir::Dirs);
- QStringList dlist = d2.entryList();
+ TQDir d2(dir, TQString::null, TQDir::Name|TQDir::IgnoreCase, TQDir::Dirs);
+ TQStringList dlist = d2.entryList();
for ( it=dlist.begin(); it != dlist.end(); ++it )
{
@@ -182,21 +182,21 @@ void ProgressDialog::addDir(const QString &dir)
void ProgressDialog::scanDirectories()
{
- QString ftsLocationsFile = locateLocal("data", "kdevdocumentation/search/locations.txt");
+ TQString ftsLocationsFile = locateLocal("data", "kdevdocumentation/search/locations.txt");
- QFile f(ftsLocationsFile);
+ TQFile f(ftsLocationsFile);
if (!f.open(IO_ReadOnly))
return;
- QTextStream str(&f);
+ TQTextStream str(&f);
filesScanned = 0;
while (!str.eof())
{
- QString loc = str.readLine();
+ TQString loc = str.readLine();
if (loc.isEmpty())
continue;
- QFileInfo fi(loc);
+ TQFileInfo fi(loc);
if (fi.isDir())
addDir(loc);
else if (fi.isFile())
@@ -210,27 +210,27 @@ void ProgressDialog::scanDirectories()
bool ProgressDialog::createConfig()
{
// locate the common dir
- QString language = KGlobal::locale()->language();
+ TQString language = KGlobal::locale()->language();
if (language == "C")
language = "en";
- QString wrapper = locate("data", QString("kdevdocumentation/%1/wrapper.html").arg(language));
+ TQString wrapper = locate("data", TQString("kdevdocumentation/%1/wrapper.html").arg(language));
if (wrapper.isEmpty())
- wrapper = locate("data", QString("kdevdocumentation/en/wrapper.html"));
+ wrapper = locate("data", TQString("kdevdocumentation/en/wrapper.html"));
if (wrapper.isEmpty())
return false;
wrapper = wrapper.left(wrapper.length()-12);
// locate the image dir
- QString images = locate("data", "kdevdocumentation/pics/star.png");
+ TQString images = locate("data", "kdevdocumentation/pics/star.png");
if (images.isEmpty())
return false;
images = images.left(images.length()-8);
- QFile f(indexdir + "/htdig.conf");
+ TQFile f(indexdir + "/htdig.conf");
if (f.open(IO_WriteOnly))
{
- QTextStream ts(&f);
+ TQTextStream ts(&f);
ts << "database_dir:\t\t" << databaseDir << endl;
ts << "start_url:\t\t`" << indexdir << "/files`" << endl;
@@ -268,19 +268,19 @@ void ProgressDialog::startHtdigProcess(bool initial)
if (initial) {
*proc << "-i";
}
- connect(proc, SIGNAL(processExited(KProcess *)),
- this, SLOT(htdigExited(KProcess *)));
+ connect(proc, TQT_SIGNAL(processExited(KProcess *)),
+ this, TQT_SLOT(htdigExited(KProcess *)));
htdigRunning = true;
// write out file
- QFile f(indexdir+"/files");
+ TQFile f(indexdir+"/files");
if (!f.open(IO_WriteOnly)) {
kdDebug(9002) << "Could not open `files` for writing" << endl;
done(1);
return;
}
- QTextStream ts(&f);
+ TQTextStream ts(&f);
for (int i=0; i<CHUNK_SIZE; ++i, ++count) {
if (count >= filesToDig) {
procdone = true;
@@ -313,14 +313,14 @@ bool ProgressDialog::generateIndex()
setFilesToDig(filesToDig);
filesDigged = 0;
- // QDir d; d.mkdir(indexdir);
+ // TQDir d; d.mkdir(indexdir);
startHtdigProcess(true);
return true;
}
void ProgressDialog::htdigStdout(KProcess *, char *buffer, int len)
{
- QString line = QString(buffer).left(len);
+ TQString line = TQString(buffer).left(len);
int cnt=0, index=-1;
while ( (index = line.find("http://", index+1)) > 0)
@@ -387,8 +387,8 @@ void ProgressDialog::startHtmergeProcess()
kdDebug(9002) << "Running htmerge" << endl;
- connect(proc, SIGNAL(processExited(KProcess *)),
- this, SLOT(htmergeExited(KProcess *)));
+ connect(proc, TQT_SIGNAL(processExited(KProcess *)),
+ this, TQT_SLOT(htmergeExited(KProcess *)));
htmergeRunning = true;