summaryrefslogtreecommitdiffstats
path: root/lib/util
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/blockingkprocess.cpp46
-rw-r--r--lib/util/blockingkprocess.h12
-rw-r--r--lib/util/configwidgetproxy.cpp24
-rw-r--r--lib/util/configwidgetproxy.h28
-rw-r--r--lib/util/domutil.cpp156
-rw-r--r--lib/util/domutil.h82
-rw-r--r--lib/util/execcommand.cpp34
-rw-r--r--lib/util/execcommand.h20
-rw-r--r--lib/util/filetemplate.cpp96
-rw-r--r--lib/util/filetemplate.h18
-rw-r--r--lib/util/kdeveditorutil.cpp20
-rw-r--r--lib/util/kdeveditorutil.h8
-rw-r--r--lib/util/kdevjobtimer.cpp10
-rw-r--r--lib/util/kdevjobtimer.h6
-rw-r--r--lib/util/kdevshellwidget.cpp26
-rw-r--r--lib/util/kdevshellwidget.h20
-rw-r--r--lib/util/kscriptactionmanager.cpp60
-rw-r--r--lib/util/kscriptactionmanager.h52
-rw-r--r--lib/util/rurl.cpp78
-rw-r--r--lib/util/rurl.h58
-rw-r--r--lib/util/settings.cpp18
-rw-r--r--lib/util/settings.h4
-rw-r--r--lib/util/urlutil.cpp110
-rw-r--r--lib/util/urlutil.h50
24 files changed, 518 insertions, 518 deletions
diff --git a/lib/util/blockingkprocess.cpp b/lib/util/blockingkprocess.cpp
index f0d6e6c3..9c9d9130 100644
--- a/lib/util/blockingkprocess.cpp
+++ b/lib/util/blockingkprocess.cpp
@@ -11,10 +11,10 @@
#include "blockingkprocess.h"
-#include <qapplication.h>
-#include <qtimer.h>
+#include <tqapplication.h>
+#include <tqtimer.h>
-BlockingKProcess::BlockingKProcess(QObject *parent, const char *name)
+BlockingKProcess::BlockingKProcess(TQObject *parent, const char *name)
: KProcess(parent, name)
{
m_stdOut = "";
@@ -22,12 +22,12 @@ BlockingKProcess::BlockingKProcess(QObject *parent, const char *name)
m_timeoutValue = 60;
m_timer = 0L;
- connect(this, SIGNAL(receivedStdout(KProcess *, char *, int)),
- this, SLOT(slotReceivedStdOut(KProcess *, char *, int)));
- connect(this, SIGNAL(receivedStderr(KProcess *, char *, int)),
- this, SLOT(slotReceivedStdErr(KProcess *, char *, int)));
- connect(this, SIGNAL(processExited(KProcess *)),
- this, SLOT(slotProcessExited(KProcess *)));
+ connect(this, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),
+ this, TQT_SLOT(slotReceivedStdOut(KProcess *, char *, int)));
+ connect(this, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)),
+ this, TQT_SLOT(slotReceivedStdErr(KProcess *, char *, int)));
+ connect(this, TQT_SIGNAL(processExited(KProcess *)),
+ this, TQT_SLOT(slotProcessExited(KProcess *)));
}
BlockingKProcess::BlockingKProcess()
@@ -37,12 +37,12 @@ BlockingKProcess::BlockingKProcess()
m_stdErr = "";
m_timeoutValue = 60;
m_timer = 0L;
- connect(this, SIGNAL(receivedStdout(KProcess *, char *, int)),
- this, SLOT(slotReceivedStdOut(KProcess *, char *, int)));
- connect(this, SIGNAL(receivedStderr(KProcess *, char *, int)),
- this, SLOT(slotReceivedStdErr(KProcess *, char *, int)));
- connect(this, SIGNAL(processExited(KProcess *)),
- this, SLOT(slotProcessExited(KProcess *)));
+ connect(this, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)),
+ this, TQT_SLOT(slotReceivedStdOut(KProcess *, char *, int)));
+ connect(this, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)),
+ this, TQT_SLOT(slotReceivedStdErr(KProcess *, char *, int)));
+ connect(this, TQT_SIGNAL(processExited(KProcess *)),
+ this, TQT_SLOT(slotProcessExited(KProcess *)));
}
@@ -54,8 +54,8 @@ bool BlockingKProcess::start(RunMode runmode, Communication comm)
if (KProcess::start(runmode, comm))
{
m_timeout = false;
- m_timer = new QTimer();
- connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeOut()));
+ m_timer = new TQTimer();
+ connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimeOut()));
m_timer->start(m_timeoutValue*1000, true);
enter_loop();
delete m_timer;
@@ -68,12 +68,12 @@ bool BlockingKProcess::start(RunMode runmode, Communication comm)
void BlockingKProcess::slotReceivedStdOut(KProcess *, char *buffer, int buflen)
{
- m_stdOut += QString::fromLatin1(buffer, buflen);
+ m_stdOut += TQString::fromLatin1(buffer, buflen);
}
void BlockingKProcess::slotReceivedStdErr(KProcess *, char *buffer, int buflen)
{
- m_stdErr += QString::fromLatin1(buffer, buflen);
+ m_stdErr += TQString::fromLatin1(buffer, buflen);
}
void BlockingKProcess::slotProcessExited(KProcess *)
@@ -89,13 +89,13 @@ void BlockingKProcess::slotTimeOut()
}
-void qt_enter_modal( QWidget *widget );
-void qt_leave_modal( QWidget *widget );
+void qt_enter_modal( TQWidget *widget );
+void qt_leave_modal( TQWidget *widget );
void BlockingKProcess::enter_loop()
{
- QWidget dummy(0,0,WType_Dialog | WShowModal);
- dummy.setFocusPolicy( QWidget::NoFocus );
+ TQWidget dummy(0,0,WType_Dialog | WShowModal);
+ dummy.setFocusPolicy( TQWidget::NoFocus );
qt_enter_modal(&dummy);
qApp->enter_loop();
qt_leave_modal(&dummy);
diff --git a/lib/util/blockingkprocess.h b/lib/util/blockingkprocess.h
index c5c8f5d9..b280b81b 100644
--- a/lib/util/blockingkprocess.h
+++ b/lib/util/blockingkprocess.h
@@ -33,7 +33,7 @@ class BlockingKProcess : public KProcess
Q_OBJECT
public:
- BlockingKProcess(QObject *parent, const char *name=0);
+ BlockingKProcess(TQObject *parent, const char *name=0);
BlockingKProcess();
virtual ~BlockingKProcess();
@@ -52,7 +52,7 @@ public:
* Get the output of the run process
* @return the output
*/
- QString stdOut() { return m_stdOut;}
+ TQString stdOut() { return m_stdOut;}
/**
* Clear the internal stdout buffer. Useful in case the class is reused.
*/
@@ -61,7 +61,7 @@ public:
* Get the error output of the run process
* @return the output
*/
- QString stdErr() { return m_stdErr;}
+ TQString stdErr() { return m_stdErr;}
/**
* Clear the internal stderr buffer. Useful in case the class is reused.
*/
@@ -82,11 +82,11 @@ private slots:
private:
void enter_loop();
- QString m_stdOut;
- QString m_stdErr;
+ TQString m_stdOut;
+ TQString m_stdErr;
bool m_timeout;
int m_timeoutValue;
- QTimer *m_timer;
+ TQTimer *m_timer;
};
#endif
diff --git a/lib/util/configwidgetproxy.cpp b/lib/util/configwidgetproxy.cpp
index 70c79fb4..66f267b7 100644
--- a/lib/util/configwidgetproxy.cpp
+++ b/lib/util/configwidgetproxy.cpp
@@ -19,8 +19,8 @@
-#include <qstring.h>
-#include <qvbox.h>
+#include <tqstring.h>
+#include <tqvbox.h>
#include <kdebug.h>
#include <kdialogbase.h>
@@ -34,19 +34,19 @@
ConfigWidgetProxy::ConfigWidgetProxy( KDevCore * core )
{
- connect( core, SIGNAL(configWidget(KDialogBase*)), this, SLOT(slotConfigWidget( KDialogBase*)) );
- connect( core, SIGNAL(projectConfigWidget(KDialogBase*)), this, SLOT(slotProjectConfigWidget( KDialogBase*)) );
+ connect( core, TQT_SIGNAL(configWidget(KDialogBase*)), this, TQT_SLOT(slotConfigWidget( KDialogBase*)) );
+ connect( core, TQT_SIGNAL(projectConfigWidget(KDialogBase*)), this, TQT_SLOT(slotProjectConfigWidget( KDialogBase*)) );
}
ConfigWidgetProxy::~ConfigWidgetProxy()
{}
-void ConfigWidgetProxy::createGlobalConfigPage( QString const & title, unsigned int pagenumber, QString const & icon )
+void ConfigWidgetProxy::createGlobalConfigPage( TQString const & title, unsigned int pagenumber, TQString const & icon )
{
_globalTitleMap.insert( pagenumber, qMakePair( title, icon ) );
}
-void ConfigWidgetProxy::createProjectConfigPage( QString const & title, unsigned int pagenumber, QString const & icon )
+void ConfigWidgetProxy::createProjectConfigPage( TQString const & title, unsigned int pagenumber, TQString const & icon )
{
_projectTitleMap.insert( pagenumber, qMakePair( title, icon ) );
}
@@ -66,8 +66,8 @@ void ConfigWidgetProxy::slotConfigWidget( KDialogBase * dlg )
++it;
}
- connect( dlg, SIGNAL(aboutToShowPage(QWidget*)), this, SLOT( slotAboutToShowPage(QWidget*)) );
- connect( dlg, SIGNAL(destroyed()), this, SLOT(slotConfigWidgetDestroyed()) );
+ connect( dlg, TQT_SIGNAL(aboutToShowPage(TQWidget*)), this, TQT_SLOT( slotAboutToShowPage(TQWidget*)) );
+ connect( dlg, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotConfigWidgetDestroyed()) );
}
void ConfigWidgetProxy::slotProjectConfigWidget( KDialogBase * dlg )
@@ -79,8 +79,8 @@ void ConfigWidgetProxy::slotProjectConfigWidget( KDialogBase * dlg )
++it;
}
- connect( dlg, SIGNAL(aboutToShowPage(QWidget*)), this, SLOT( slotAboutToShowPage(QWidget*)) );
- connect( dlg, SIGNAL(destroyed()), this, SLOT(slotConfigWidgetDestroyed()) );
+ connect( dlg, TQT_SIGNAL(aboutToShowPage(TQWidget*)), this, TQT_SLOT( slotAboutToShowPage(TQWidget*)) );
+ connect( dlg, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotConfigWidgetDestroyed()) );
}
void ConfigWidgetProxy::slotConfigWidgetDestroyed( )
@@ -88,14 +88,14 @@ void ConfigWidgetProxy::slotConfigWidgetDestroyed( )
_pageMap.clear();
}
-void ConfigWidgetProxy::slotAboutToShowPage( QWidget * page )
+void ConfigWidgetProxy::slotAboutToShowPage( TQWidget * page )
{
if ( !page ) return;
PageMap::Iterator it = _pageMap.find( page );
if ( it != _pageMap.end() )
{
- emit insertConfigWidget( static_cast<KDialogBase*>(const_cast<QObject*>(sender())), page, it.data() );
+ emit insertConfigWidget( static_cast<KDialogBase*>(const_cast<TQObject*>(sender())), page, it.data() );
_pageMap.remove( it );
}
}
diff --git a/lib/util/configwidgetproxy.h b/lib/util/configwidgetproxy.h
index 84e1d18c..1ba7e5c5 100644
--- a/lib/util/configwidgetproxy.h
+++ b/lib/util/configwidgetproxy.h
@@ -20,9 +20,9 @@
#ifndef _CONFIGWIDGETPROXY_H
#define _CONFIGWIDGETPROXY_H
-#include <qobject.h>
-#include <qstring.h>
-#include <qmap.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqmap.h>
class KDevCore;
class KDialogBase;
@@ -47,20 +47,20 @@ A typical case looks like this:
_configProxy = new ConfigWidgetProxy( core() );
_configProxy->createGlobalConfigPage( i18n("My Part"), GLOBALDOC_OPTIONS, info()->icon() );
_configProxy->createProjectConfigPage( i18n("My Part"), PROJECTDOC_OPTIONS, info()->icon() );
-connect( _configProxy, SIGNAL(insertConfigWidget(const QObject*, QWidget*, unsigned int )),
- this, SLOT(insertConfigWidget(const QObject*, QWidget*, unsigned int )) );
+connect( _configProxy, TQT_SIGNAL(insertConfigWidget(const TQObject*, TQWidget*, unsigned int )),
+ this, TQT_SLOT(insertConfigWidget(const TQObject*, TQWidget*, unsigned int )) );
...
...
-void MyPart::insertConfigWidget( QObject const * dlg, QWidget * page, unsigned int pagenumber )
+void MyPart::insertConfigWidget( TQObject const * dlg, TQWidget * page, unsigned int pagenumber )
{
if ( pagenumber == PROJECTDOC_OPTIONS ) {
MyPartGlobalSettings * w = new MyPartGlobalSettings( this, page );
- connect( dlg, SIGNAL(okClicked()), w, SLOT(slotAccept()) );
+ connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(slotAccept()) );
} else if ( pagenumber == PROJECTDOC_OPTIONS ) {
MyPartProjectSettings * w = new MyPartProjectSettings( this, page );
- connect( dlg, SIGNAL(okClicked()), w, SLOT(slotAccept()) );
+ connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(slotAccept()) );
}
}
@endcode
@@ -84,7 +84,7 @@ public:
* @param pagenumber A per-proxy unique identifier, used when responding to insertConfigWidget() signal.
* @param icon The name of the icon to use.
*/
- void createGlobalConfigPage( QString const & title, unsigned int pagenumber, QString const & icon = "kdevelop" );
+ void createGlobalConfigPage( TQString const & title, unsigned int pagenumber, TQString const & icon = "kdevelop" );
/**
* Tells the proxy you want a page in the Project Settings.
@@ -92,7 +92,7 @@ public:
* @param pagenumber A per-proxy unique identifier, used when responding to insertConfigWidget() signal.
* @param icon The name of the icon to use.
*/
- void createProjectConfigPage( QString const & title, unsigned int pagenumber, QString const & icon = "kdevelop" );
+ void createProjectConfigPage( TQString const & title, unsigned int pagenumber, TQString const & icon = "kdevelop" );
/**
* Removes a config page from the proxy. Next time the settings dialog opens, this page will not be available.
@@ -107,17 +107,17 @@ signals:
* @param page The setting page. The client should use this as parent to the config widget.
* @param pagenumber The identifier set in createGlobalConfigPage() or createProjectConfigPage(). Identifies the requested config page.
*/
- void insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber );
+ void insertConfigWidget( const KDialogBase * dlg, TQWidget * page, unsigned int pagenumber );
private slots:
void slotConfigWidget( KDialogBase * );
void slotProjectConfigWidget( KDialogBase * );
void slotConfigWidgetDestroyed();
- void slotAboutToShowPage( QWidget * page );
+ void slotAboutToShowPage( TQWidget * page );
private:
- typedef QMap<unsigned int, QPair<QString,QString> > TitleMap;
- typedef QMap<QWidget*, int> PageMap;
+ typedef TQMap<unsigned int, QPair<TQString,TQString> > TitleMap;
+ typedef TQMap<TQWidget*, int> PageMap;
TitleMap _globalTitleMap;
TitleMap _projectTitleMap;
diff --git a/lib/util/domutil.cpp b/lib/util/domutil.cpp
index b183717f..9f5d40c9 100644
--- a/lib/util/domutil.cpp
+++ b/lib/util/domutil.cpp
@@ -15,23 +15,23 @@
#include "domutil.h"
#include <kdebug.h>
-#include <qstringlist.h>
-#include <qfile.h>
+#include <tqstringlist.h>
+#include <tqfile.h>
-void DomUtil::makeEmpty( QDomElement& e )
+void DomUtil::makeEmpty( TQDomElement& e )
{
while( !e.firstChild().isNull() )
e.removeChild( e.firstChild() );
}
-QDomElement DomUtil::elementByPath(const QDomDocument &doc, const QString &path)
+TQDomElement DomUtil::elementByPath(const TQDomDocument &doc, const TQString &path)
{
- QStringList l = QStringList::split('/', path);
+ TQStringList l = TQStringList::split('/', path);
- QDomElement el;
+ TQDomElement el;
if(&doc) el = doc.documentElement();
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for (it = l.begin(); it != l.end(); ++it) {
el = el.namedItem(*it).toElement();
}
@@ -40,9 +40,9 @@ QDomElement DomUtil::elementByPath(const QDomDocument &doc, const QString &path)
}
-QString DomUtil::readEntry(const QDomDocument &doc, const QString &path, const QString &defaultEntry)
+TQString DomUtil::readEntry(const TQDomDocument &doc, const TQString &path, const TQString &defaultEntry)
{
- QDomElement el = elementByPath(doc, path);
+ TQDomElement el = elementByPath(doc, path);
if (el.isNull())
return defaultEntry;
else
@@ -51,20 +51,20 @@ QString DomUtil::readEntry(const QDomDocument &doc, const QString &path, const Q
/// @todo consider whether it's okay to accept empty string == default value
/// if not use the below type
-///typedef pair<bool,QString> EltInfo;
+///typedef pair<bool,TQString> EltInfo;
-QString DomUtil::readEntryAux(const QDomDocument &doc, const QString &path)
+TQString DomUtil::readEntryAux(const TQDomDocument &doc, const TQString &path)
{
- QDomElement el = elementByPath(doc, path);
+ TQDomElement el = elementByPath(doc, path);
if (el.isNull())
- return QString::null;
+ return TQString::null;
else
return el.firstChild().toText().data();
}
-int DomUtil::readIntEntry(const QDomDocument &doc, const QString &path, int defaultEntry)
+int DomUtil::readIntEntry(const TQDomDocument &doc, const TQString &path, int defaultEntry)
{
- QString entry = readEntryAux(doc, path);
+ TQString entry = readEntryAux(doc, path);
if (entry.isNull())
return defaultEntry;
else
@@ -72,9 +72,9 @@ int DomUtil::readIntEntry(const QDomDocument &doc, const QString &path, int defa
}
-bool DomUtil::readBoolEntry(const QDomDocument &doc, const QString &path, bool defaultEntry)
+bool DomUtil::readBoolEntry(const TQDomDocument &doc, const TQString &path, bool defaultEntry)
{
- QString entry = readEntryAux(doc, path);
+ TQString entry = readEntryAux(doc, path);
if (entry.isNull())
return defaultEntry;
else
@@ -82,12 +82,12 @@ bool DomUtil::readBoolEntry(const QDomDocument &doc, const QString &path, bool d
}
-QStringList DomUtil::readListEntry(const QDomDocument &doc, const QString &path, const QString &tag)
+TQStringList DomUtil::readListEntry(const TQDomDocument &doc, const TQString &path, const TQString &tag)
{
- QStringList list;
+ TQStringList list;
- QDomElement el = elementByPath(doc, path);
- QDomElement subEl = el.firstChild().toElement();
+ TQDomElement el = elementByPath(doc, path);
+ TQDomElement subEl = el.firstChild().toElement();
while (!subEl.isNull()) {
if (subEl.tagName() == tag)
list << subEl.firstChild().toText().data();
@@ -98,17 +98,17 @@ QStringList DomUtil::readListEntry(const QDomDocument &doc, const QString &path,
}
-DomUtil::PairList DomUtil::readPairListEntry(const QDomDocument &doc, const QString &path, const QString &tag,
- const QString &firstAttr, const QString &secondAttr)
+DomUtil::PairList DomUtil::readPairListEntry(const TQDomDocument &doc, const TQString &path, const TQString &tag,
+ const TQString &firstAttr, const TQString &secondAttr)
{
PairList list;
- QDomElement el = elementByPath(doc, path);
- QDomElement subEl = el.firstChild().toElement();
+ TQDomElement el = elementByPath(doc, path);
+ TQDomElement subEl = el.firstChild().toElement();
while (!subEl.isNull()) {
if (subEl.tagName() == tag) {
- QString first = subEl.attribute(firstAttr);
- QString second = subEl.attribute(secondAttr);
+ TQString first = subEl.attribute(firstAttr);
+ TQString second = subEl.attribute(secondAttr);
list << Pair(first, second);
}
subEl = subEl.nextSibling().toElement();
@@ -117,12 +117,12 @@ DomUtil::PairList DomUtil::readPairListEntry(const QDomDocument &doc, const QStr
return list;
}
-QMap<QString, QString> DomUtil::readMapEntry(const QDomDocument &doc, const QString& path)
+TQMap<TQString, TQString> DomUtil::readMapEntry(const TQDomDocument &doc, const TQString& path)
{
- QMap<QString, QString> map;
+ TQMap<TQString, TQString> map;
- QDomElement el = elementByPath(doc, path);
- QDomElement subEl = el.firstChild().toElement();
+ TQDomElement el = elementByPath(doc, path);
+ TQDomElement subEl = el.firstChild().toElement();
while (!subEl.isNull()) {
map[subEl.tagName()] = subEl.firstChild().toText().data();
subEl = subEl.nextSibling().toElement();
@@ -131,9 +131,9 @@ QMap<QString, QString> DomUtil::readMapEntry(const QDomDocument &doc, const QStr
return map;
}
-QDomElement DomUtil::namedChildElement( QDomElement& el, const QString& name )
+TQDomElement DomUtil::namedChildElement( TQDomElement& el, const TQString& name )
{
- QDomElement child = el.namedItem( name ).toElement();
+ TQDomElement child = el.namedItem( name ).toElement();
if (child.isNull()) {
child = el.ownerDocument().createElement( name );
el.appendChild(child);
@@ -142,13 +142,13 @@ QDomElement DomUtil::namedChildElement( QDomElement& el, const QString& name )
}
-QDomElement DomUtil::createElementByPath(QDomDocument &doc, const QString &path)
+TQDomElement DomUtil::createElementByPath(TQDomDocument &doc, const TQString &path)
{
- QStringList l = QStringList::split('/', path);
+ TQStringList l = TQStringList::split('/', path);
- QDomElement el;
+ TQDomElement el;
if(&doc) el = doc.documentElement();
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for (it = l.begin(); it != l.end(); ++it)
el = DomUtil::namedChildElement( el, *it );
@@ -159,16 +159,16 @@ QDomElement DomUtil::createElementByPath(QDomDocument &doc, const QString &path)
}
-void DomUtil::writeEntry(QDomDocument &doc, const QString &path, const QString &value)
+void DomUtil::writeEntry(TQDomDocument &doc, const TQString &path, const TQString &value)
{
- QDomElement el = createElementByPath(doc, path);
+ TQDomElement el = createElementByPath(doc, path);
el.appendChild(doc.createTextNode(value));
}
-void DomUtil::writeMapEntry(QDomDocument &doc, const QString &path, const QMap<QString, QString> &map)
+void DomUtil::writeMapEntry(TQDomDocument &doc, const TQString &path, const TQMap<TQString, TQString> &map)
{
- QString basePath( path + "/" );
- QMap<QString,QString>::ConstIterator it;
+ TQString basePath( path + "/" );
+ TQMap<TQString,TQString>::ConstIterator it;
for (it = map.begin(); it != map.end(); ++it)
{
kdDebug( 9010 ) << "writing " << basePath << ";" << it.key() << ";" << it.data() << endl;
@@ -177,65 +177,65 @@ void DomUtil::writeMapEntry(QDomDocument &doc, const QString &path, const QMap<Q
}
}
-void DomUtil::writeIntEntry(QDomDocument &doc, const QString &path, int value)
+void DomUtil::writeIntEntry(TQDomDocument &doc, const TQString &path, int value)
{
- writeEntry(doc, path, QString::number(value));
+ writeEntry(doc, path, TQString::number(value));
}
-void DomUtil::writeBoolEntry(QDomDocument &doc, const QString &path, bool value)
+void DomUtil::writeBoolEntry(TQDomDocument &doc, const TQString &path, bool value)
{
writeEntry(doc, path, value? "true" : "false");
}
-void DomUtil::writeListEntry(QDomDocument &doc, const QString &path, const QString &tag,
- const QStringList &value)
+void DomUtil::writeListEntry(TQDomDocument &doc, const TQString &path, const TQString &tag,
+ const TQStringList &value)
{
- QDomElement el = createElementByPath(doc, path);
+ TQDomElement el = createElementByPath(doc, path);
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for (it = value.begin(); it != value.end(); ++it) {
- QDomElement subEl = doc.createElement(tag);
+ TQDomElement subEl = doc.createElement(tag);
subEl.appendChild(doc.createTextNode(*it));
el.appendChild(subEl);
}
}
-void DomUtil::writePairListEntry(QDomDocument &doc, const QString &path, const QString &tag,
- const QString &firstAttr, const QString &secondAttr,
+void DomUtil::writePairListEntry(TQDomDocument &doc, const TQString &path, const TQString &tag,
+ const TQString &firstAttr, const TQString &secondAttr,
const PairList &value)
{
- QDomElement el = createElementByPath(doc, path);
+ TQDomElement el = createElementByPath(doc, path);
PairList::ConstIterator it;
for (it = value.begin(); it != value.end(); ++it) {
- QDomElement subEl = doc.createElement(tag);
+ TQDomElement subEl = doc.createElement(tag);
subEl.setAttribute(firstAttr, (*it).first);
subEl.setAttribute(secondAttr, (*it).second);
el.appendChild(subEl);
}
}
-DomPath DomUtil::resolvPathStringExt(const QString pathstring)
+DomPath DomUtil::resolvPathStringExt(const TQString pathstring)
{
// parse path
unsigned int i;
- QStringList pathParts = QStringList::split('/',pathstring);
+ TQStringList pathParts = TQStringList::split('/',pathstring);
DomPath dompath;
for (i=0; i<pathParts.count(); i++)
{
- QStringList pathElemParts = QStringList::split('|',pathParts[i],TRUE);
+ TQStringList pathElemParts = TQStringList::split('|',pathParts[i],TRUE);
DomPathElement dompathelem;
dompathelem.tagName = pathElemParts[0].simplifyWhiteSpace();
if (pathElemParts.count()>1)
{
// handle attributes
- QStringList attrParts = QStringList::split(';',pathElemParts[1]);
+ TQStringList attrParts = TQStringList::split(';',pathElemParts[1]);
for (unsigned int j=0; j<attrParts.count(); j++)
{
- QStringList attribSet = QStringList::split('=',attrParts[j]);
+ TQStringList attribSet = TQStringList::split('=',attrParts[j]);
if (attribSet.count()<2)
continue;
DomAttribute domattribute;
@@ -256,12 +256,12 @@ DomPath DomUtil::resolvPathStringExt(const QString pathstring)
#define rightchild !wrongchild
-QDomElement DomUtil::elementByPathExt(QDomDocument &doc, const QString &pathstring)
+TQDomElement DomUtil::elementByPathExt(TQDomDocument &doc, const TQString &pathstring)
{
DomPath dompath = resolvPathStringExt(pathstring);
- QDomElement elem = doc.documentElement();
- QDomNodeList children;
- QDomElement nextElem = elem;
+ TQDomElement elem = doc.documentElement();
+ TQDomNodeList children;
+ TQDomElement nextElem = elem;
for (unsigned int j=0; j<dompath.count(); j++)
{
children = nextElem.childNodes();
@@ -271,15 +271,15 @@ QDomElement DomUtil::elementByPathExt(QDomDocument &doc, const QString &pathstri
for (unsigned int i=0; i<children.count(); i++)
{
wrongchild = false;
- QDomElement child = children.item(i).toElement();
- QString tag = child.tagName();
+ TQDomElement child = children.item(i).toElement();
+ TQString tag = child.tagName();
tag = dompathelement.tagName;
if (child.tagName() == dompathelement.tagName)
{
for (unsigned int k=0; k<dompathelement.attribute.count(); k++)
{
DomAttribute domattribute = dompathelement.attribute[k];
- QDomAttr domattr = child.attributeNode(domattribute.name);
+ TQDomAttr domattr = child.attributeNode(domattribute.name);
if (domattr.isNull() ||
domattr.value() != domattribute.value)
{
@@ -301,7 +301,7 @@ QDomElement DomUtil::elementByPathExt(QDomDocument &doc, const QString &pathstri
}
if (wrongchild)
{
- QDomElement nullDummy;
+ TQDomElement nullDummy;
nullDummy.clear();
return nullDummy;
}
@@ -310,9 +310,9 @@ QDomElement DomUtil::elementByPathExt(QDomDocument &doc, const QString &pathstri
}
-bool DomUtil::openDOMFile(QDomDocument &doc, QString filename)
+bool DomUtil::openDOMFile(TQDomDocument &doc, TQString filename)
{
- QFile file( filename );
+ TQFile file( filename );
if ( !file.open( IO_ReadOnly ) )
return false;
if ( !doc.setContent( &file ) ) {
@@ -323,23 +323,23 @@ bool DomUtil::openDOMFile(QDomDocument &doc, QString filename)
return true;
}
-bool DomUtil::saveDOMFile(QDomDocument &doc, QString filename)
+bool DomUtil::saveDOMFile(TQDomDocument &doc, TQString filename)
{
- QFile file( filename );
+ TQFile file( filename );
if ( !file.open( IO_ReadWrite | IO_Truncate ) )
return false;
- QTextStream t( &file );
+ TQTextStream t( &file );
t << doc.toString();
file.close();
return true;
}
-bool DomUtil::removeTextNodes(QDomDocument doc,QString pathExt)
+bool DomUtil::removeTextNodes(TQDomDocument doc,TQString pathExt)
{
- QDomElement elem = elementByPathExt(doc,pathExt);
+ TQDomElement elem = elementByPathExt(doc,pathExt);
if (elem.isNull())
return false;
- QDomNodeList children = elem.childNodes();
+ TQDomNodeList children = elem.childNodes();
for (unsigned int i=0;i<children.count();i++)
if (children.item(i).isText())
elem.removeChild(children.item(i));
@@ -347,9 +347,9 @@ bool DomUtil::removeTextNodes(QDomDocument doc,QString pathExt)
}
-bool DomUtil::appendText(QDomDocument doc, QString pathExt, QString text)
+bool DomUtil::appendText(TQDomDocument doc, TQString pathExt, TQString text)
{
- QDomElement elem = elementByPathExt(doc,pathExt);
+ TQDomElement elem = elementByPathExt(doc,pathExt);
if (elem.isNull())
return false;
elem.appendChild(doc.createTextNode(text));
@@ -357,7 +357,7 @@ bool DomUtil::appendText(QDomDocument doc, QString pathExt, QString text)
}
-bool DomUtil::replaceText(QDomDocument doc, QString pathExt, QString text)
+bool DomUtil::replaceText(TQDomDocument doc, TQString pathExt, TQString text)
{
if (removeTextNodes(doc,pathExt) &&
appendText(doc,pathExt,text))
diff --git a/lib/util/domutil.h b/lib/util/domutil.h
index a301ef00..08d2571a 100644
--- a/lib/util/domutil.h
+++ b/lib/util/domutil.h
@@ -13,11 +13,11 @@
#ifndef _DOMUTIL_H_
#define _DOMUTIL_H_
-#include <qdom.h>
-#include <qpair.h>
-#include <qstringlist.h>
-#include <qvaluelist.h>
-#include <qmap.h>
+#include <tqdom.h>
+#include <tqpair.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+#include <tqmap.h>
/**
@file domutil.h
@@ -26,18 +26,18 @@ Utility functions to operate on %DOM.
struct DomAttribute
{
- QString name;
- QString value;
+ TQString name;
+ TQString value;
};
struct DomPathElement
{
- QString tagName;
- QValueList<DomAttribute> attribute;
+ TQString tagName;
+ TQValueList<DomAttribute> attribute;
int matchNumber; // for use when more than one element matches the path
};
-typedef QValueList<DomPathElement> DomPath;
+typedef TQValueList<DomPathElement> DomPath;
/**
* Utility class for conveniently accessing data in a %DOM tree.
@@ -45,52 +45,52 @@ typedef QValueList<DomPathElement> DomPath;
class DomUtil
{
public:
- typedef QPair<QString, QString> Pair;
- typedef QValueList<Pair> PairList;
+ typedef QPair<TQString, TQString> Pair;
+ typedef TQValueList<Pair> PairList;
/**
* Remove all child elements from a given element.
*/
- static void makeEmpty( QDomElement& );
+ static void makeEmpty( TQDomElement& );
/**
* Reads a string entry.
*/
- static QString readEntry(const QDomDocument &doc, const QString &path, const QString &defaultEntry = QString::null);
+ static TQString readEntry(const TQDomDocument &doc, const TQString &path, const TQString &defaultEntry = TQString::null);
/**
* Reads a number entry.
*/
- static int readIntEntry(const QDomDocument &doc, const QString &path, int defaultEntry = 0);
+ static int readIntEntry(const TQDomDocument &doc, const TQString &path, int defaultEntry = 0);
/**
* Reads a boolean entry. The strings "true" and "TRUE" are interpreted
* as true, all other as false.
*/
- static bool readBoolEntry(const QDomDocument &doc, const QString &path, bool defaultEntry = false);
+ static bool readBoolEntry(const TQDomDocument &doc, const TQString &path, bool defaultEntry = false);
/**
* Reads a list entry. See writeListEntry().
*/
- static QStringList readListEntry(const QDomDocument &doc, const QString &path, const QString &tag);
+ static TQStringList readListEntry(const TQDomDocument &doc, const TQString &path, const TQString &tag);
/**
* Reads a list of string pairs. See writePairListEntry().
*/
- static PairList readPairListEntry(const QDomDocument &doc, const QString &path, const QString &tag,
- const QString &firstAttr, const QString &secondAttr);
+ static PairList readPairListEntry(const TQDomDocument &doc, const TQString &path, const TQString &tag,
+ const TQString &firstAttr, const TQString &secondAttr);
/**
* Reads a string to string map. See writeMapEntry()
*/
- static QMap<QString, QString> readMapEntry(const QDomDocument &doc, const QString &path);
+ static TQMap<TQString, TQString> readMapEntry(const TQDomDocument &doc, const TQString &path);
/**
* Retrieves an element by path, return null if any item along
* the path does not exist.
*/
- static QDomElement elementByPath( const QDomDocument& doc, const QString& path );
+ static TQDomElement elementByPath( const TQDomDocument& doc, const TQString& path );
/**
* Retrieves an element by path, creating the necessary nodes.
*/
- static QDomElement createElementByPath( QDomDocument& doc, const QString& path );
+ static TQDomElement createElementByPath( TQDomDocument& doc, const TQString& path );
/**
* Retrieves a child element, creating it if it does not exist.
* The return value is guaranteed to be non isNull()
*/
- static QDomElement namedChildElement( QDomElement& el, const QString& name );
+ static TQDomElement namedChildElement( TQDomElement& el, const TQString& name );
/**
Writes a string entry. For example,
\verbatim
@@ -103,20 +103,20 @@ public:
</code>
\endverbatim
*/
- static void writeEntry(QDomDocument &doc, const QString &path, const QString &value);
+ static void writeEntry(TQDomDocument &doc, const TQString &path, const TQString &value);
/**
* Writes a number entry.
*/
- static void writeIntEntry(QDomDocument &doc, const QString &path, int value);
+ static void writeIntEntry(TQDomDocument &doc, const TQString &path, int value);
/**
* Writes a boolean entry. Booleans are stored as "true", "false" resp.
*/
- static void writeBoolEntry(QDomDocument &doc, const QString &path, bool value);
+ static void writeBoolEntry(TQDomDocument &doc, const TQString &path, bool value);
/**
Writes a string list element. The list elements are separated by tag. For example,
\verbatim
<code>
- QStringList l; l << "one" << "two";
+ TQStringList l; l << "one" << "two";
writeListEntry(doc, "/general/special", "el", l);
</code>
\endverbatim creates the %DOM fragment: \verbatim
@@ -125,8 +125,8 @@ public:
</code>
\endverbatim
*/
- static void writeListEntry(QDomDocument &doc, const QString &path, const QString &tag,
- const QStringList &value);
+ static void writeListEntry(TQDomDocument &doc, const TQString &path, const TQString &tag,
+ const TQStringList &value);
/**
Writes a list of string pairs. The list elements are stored in the attributes
firstAttr and secondAttr of elements named tag. For example,
@@ -146,14 +146,14 @@ public:
</code>
\endverbatim
*/
- static void writePairListEntry(QDomDocument &doc, const QString &path, const QString &tag,
- const QString &firstAttr, const QString &secondAttr,
+ static void writePairListEntry(TQDomDocument &doc, const TQString &path, const TQString &tag,
+ const TQString &firstAttr, const TQString &secondAttr,
const PairList &value);
/**
* Writes a string to string map. This map is stored in a way, that it can be read with
* readMapEntry() and readEntry()
*/
- static void writeMapEntry(QDomDocument &doc, const QString& path, const QMap<QString,QString> &map);
+ static void writeMapEntry(TQDomDocument &doc, const TQString& path, const TQMap<TQString,TQString> &map);
/**
* Resolves an extended path
@@ -162,7 +162,7 @@ public:
* where matchNumber is zero-based
* path: pathpart[/pathpart/..]
*/
- static DomPath resolvPathStringExt(const QString pathstring);
+ static DomPath resolvPathStringExt(const TQString pathstring);
/**
Retrieve an element specified with extended path
@@ -174,7 +174,7 @@ public:
or "widget/property||2/string"
.
\verbatim
- <widget class="QDialog">
+ <widget class="TQDialog">
<property name="name">
<cstring>KdevFormName</cstring>
</property>
@@ -192,35 +192,35 @@ public:
</widget>
\endverbatim
*/
- static QDomElement elementByPathExt(QDomDocument &doc, const QString &pathstring);
+ static TQDomElement elementByPathExt(TQDomDocument &doc, const TQString &pathstring);
/**
* Open file - filename - and set setContents of doc
*/
- static bool openDOMFile(QDomDocument &doc, QString filename);
+ static bool openDOMFile(TQDomDocument &doc, TQString filename);
/**
* Store contents of doc in file - filename. Existing file will be truncated!
*/
- static bool saveDOMFile(QDomDocument &doc, QString filename);
+ static bool saveDOMFile(TQDomDocument &doc, TQString filename);
/**
* Remove all child text nodes of parent described in pathExt
*/
- static bool removeTextNodes(QDomDocument doc,QString pathExt);
+ static bool removeTextNodes(TQDomDocument doc,TQString pathExt);
/**
* Add child text node to parent described in pathExt
*/
- static bool appendText(QDomDocument doc, QString pathExt, QString text);
+ static bool appendText(TQDomDocument doc, TQString pathExt, TQString text);
/**
* Replace all chilt text nodes of parent described in pathExt with one new.
*/
- static bool replaceText(QDomDocument doc, QString pathExt, QString text);
+ static bool replaceText(TQDomDocument doc, TQString pathExt, TQString text);
private:
- static QString readEntryAux(const QDomDocument &doc, const QString &path);
+ static TQString readEntryAux(const TQDomDocument &doc, const TQString &path);
};
#endif
diff --git a/lib/util/execcommand.cpp b/lib/util/execcommand.cpp
index 7618bd6e..7c4fea89 100644
--- a/lib/util/execcommand.cpp
+++ b/lib/util/execcommand.cpp
@@ -24,27 +24,27 @@
#include <klocale.h>
#include <kmessagebox.h>
-ExecCommand::ExecCommand( const QString& executable, const QStringList& args,
- const QString& workingDir, const QStringList& env,
- QObject* parent, const char* name ):
- QObject( parent, name ), out( "" ) /* make sure out is not QString::null since that would mean "error" */
+ExecCommand::ExecCommand( const TQString& executable, const TQStringList& args,
+ const TQString& workingDir, const TQStringList& env,
+ TQObject* parent, const char* name ):
+ TQObject( parent, name ), out( "" ) /* make sure out is not TQString::null since that would mean "error" */
{
progressDlg = 0;
proc = new KProcess();
proc->setWorkingDirectory( workingDir );
- for ( QStringList::ConstIterator it = env.begin(); it != env.end(); ++it )
+ for ( TQStringList::ConstIterator it = env.begin(); it != env.end(); ++it )
proc->setEnvironment( (*it).section( '=', 0, 0 ), (*it).section( '=', 1, 1 ) );
*proc << executable;
*proc << args;
- connect( proc, SIGNAL(processExited(KProcess*)),
- this, SLOT(processExited()) );
- connect( proc, SIGNAL(receivedStdout(KProcess*,char*,int)),
- this, SLOT(receivedStdout(KProcess*,char*,int)) );
- connect( proc, SIGNAL(receivedStderr(KProcess*,char*,int)),
- this, SLOT(receivedStderr(KProcess*,char*,int)) );
+ connect( proc, TQT_SIGNAL(processExited(KProcess*)),
+ this, TQT_SLOT(processExited()) );
+ connect( proc, TQT_SIGNAL(receivedStdout(KProcess*,char*,int)),
+ this, TQT_SLOT(receivedStdout(KProcess*,char*,int)) );
+ connect( proc, TQT_SIGNAL(receivedStderr(KProcess*,char*,int)),
+ this, TQT_SLOT(receivedStderr(KProcess*,char*,int)) );
bool ok = proc->start( KProcess::NotifyOnExit, KProcess::AllOutput );
@@ -52,25 +52,25 @@ ExecCommand::ExecCommand( const QString& executable, const QStringList& args,
KMessageBox::error( 0, i18n("Could not invoke \"%1\". Please make sure it is installed correctly").arg( executable ),
i18n("Error Invoking Command") );
- emit finished( QString::null, QString::null );
+ emit finished( TQString::null, TQString::null );
deleteLater();
} else {
progressDlg = new KProgressDialog( 0, 0, i18n("Command running..."),
i18n("Please wait until the \"%1\" command finishes.").arg( executable ), false );
- connect( progressDlg, SIGNAL(cancelClicked()),
- this, SLOT(cancelClicked()) );
+ connect( progressDlg, TQT_SIGNAL(cancelClicked()),
+ this, TQT_SLOT(cancelClicked()) );
}
}
void ExecCommand::receivedStdout (KProcess*, char *buffer, int buflen)
{
- out += QString::fromUtf8( buffer, buflen );
+ out += TQString::fromUtf8( buffer, buflen );
}
void ExecCommand::receivedStderr (KProcess*, char *buffer, int buflen)
{
- err += QString::fromUtf8( buffer, buflen );
+ err += TQString::fromUtf8( buffer, buflen );
}
void ExecCommand::processExited()
@@ -88,7 +88,7 @@ void ExecCommand::cancelClicked()
progressDlg = 0;
proc->kill();
- emit finished( QString::null, QString::null );
+ emit finished( TQString::null, TQString::null );
deleteLater();
}
diff --git a/lib/util/execcommand.h b/lib/util/execcommand.h
index c00085c6..c3e20d47 100644
--- a/lib/util/execcommand.h
+++ b/lib/util/execcommand.h
@@ -20,8 +20,8 @@
#ifndef _EXECCOMMAND_H_
#define _EXECCOMMAND_H_
-#include <qobject.h>
-#include <qstringlist.h>
+#include <tqobject.h>
+#include <tqstringlist.h>
class KProcess;
class KProgressDialog;
@@ -37,22 +37,22 @@ Command execution facilities.
* a progress dialog with the possibility to cancel the command.
*
* If there was an error or the user pressed cancel, finished ()
- * will emit a QString::null, otherwise QStrings containing the stdout/stderr.
+ * will emit a TQString::null, otherwise QStrings containing the stdout/stderr.
*
* The object will delete itself after the finished signal has been emitted.
- * Additional environment can be set in the QStringList env via QStrings with the format "foo=blah"
+ * Additional environment can be set in the TQStringList env via QStrings with the format "foo=blah"
*/
class ExecCommand : public QObject
{
Q_OBJECT
public:
- ExecCommand( const QString& executable, const QStringList& args,
- const QString& workingDir = QString::null,
- const QStringList& env = QStringList(), QObject* parent = 0, const char* name = 0 );
+ ExecCommand( const TQString& executable, const TQStringList& args,
+ const TQString& workingDir = TQString::null,
+ const TQStringList& env = TQStringList(), TQObject* parent = 0, const char* name = 0 );
~ExecCommand();
signals:
- void finished( const QString& output, const QString& errorOutput );
+ void finished( const TQString& output, const TQString& errorOutput );
private slots:
void receivedStdout (KProcess *, char *buffer, int buflen);
@@ -63,8 +63,8 @@ private slots:
private:
KProcess* proc;
KProgressDialog* progressDlg;
- QString out;
- QString err;
+ TQString out;
+ TQString err;
};
#endif
diff --git a/lib/util/filetemplate.cpp b/lib/util/filetemplate.cpp
index 78abf384..cbf4f8bb 100644
--- a/lib/util/filetemplate.cpp
+++ b/lib/util/filetemplate.cpp
@@ -19,11 +19,11 @@
#include "filetemplate.h"
-#include <qdatetime.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qregexp.h>
-#include <qtextstream.h>
+#include <tqdatetime.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqregexp.h>
+#include <tqtextstream.h>
#include <kstandarddirs.h>
@@ -32,97 +32,97 @@
#include "domutil.h"
-bool FileTemplate::exists(KDevPlugin *part, const QString &name, Policy p)
+bool FileTemplate::exists(KDevPlugin *part, const TQString &name, Policy p)
{
- //QString fileName = (p == Default) ?
+ //TQString fileName = (p == Default) ?
// (part->project()->projectDirectory() + "/templates/" + name) : name;
- return QFile::exists( fullPathForName(part,name,p) );
+ return TQFile::exists( fullPathForName(part,name,p) );
}
-QString FileTemplate::read(KDevPlugin *part, const QString &name, Policy p)
+TQString FileTemplate::read(KDevPlugin *part, const TQString &name, Policy p)
{
//KDevProject *project = part->project();
- //QString fileName = (p == Default) ? (project->projectDirectory() +
+ //TQString fileName = (p == Default) ? (project->projectDirectory() +
// "/templates/" + name) : name;
return readFile(part, fullPathForName(part, name, p) );
}
-QString FileTemplate::readFile(KDevPlugin *part, const QString &fileName)
+TQString FileTemplate::readFile(KDevPlugin *part, const TQString &fileName)
{
- QDomDocument &dom = *part->projectDom();
+ TQDomDocument &dom = *part->projectDom();
- QFile f(fileName);
+ TQFile f(fileName);
if (!f.open(IO_ReadOnly))
- return QString::null;
- QTextStream stream(&f);
- QString str = stream.read();
+ return TQString::null;
+ TQTextStream stream(&f);
+ TQString str = stream.read();
return makeSubstitutions( dom, str );
}
-QString FileTemplate::makeSubstitutions( QDomDocument & dom, const QString & text )
+TQString FileTemplate::makeSubstitutions( TQDomDocument & dom, const TQString & text )
{
- QString author = DomUtil::readEntry(dom, "/general/author");
- QString email = DomUtil::readEntry(dom, "/general/email");
- QString version = DomUtil::readEntry(dom, "/general/version");
- QString appname = DomUtil::readEntry(dom, "/general/projectname");
- QString date = QDate::currentDate().toString();
- QString year = QString::number(QDate::currentDate().year());
-
- QString str = text;
- str.replace(QRegExp("\\$EMAIL\\$"),email);
- str.replace(QRegExp("\\$AUTHOR\\$"),author);
- str.replace(QRegExp("\\$VERSION\\$"),version);
- str.replace(QRegExp("\\$DATE\\$"),date);
- str.replace(QRegExp("\\$YEAR\\$"),year);
- str.replace(QRegExp("\\$APPNAME\\$"),appname);
- str.replace(QRegExp("\\$APPNAME\\$"),appname);
- str.replace(QRegExp("\\$APPNAMEUC\\$"),appname.upper());
- str.replace(QRegExp("\\$APPNAMELC\\$"),appname.lower());
+ TQString author = DomUtil::readEntry(dom, "/general/author");
+ TQString email = DomUtil::readEntry(dom, "/general/email");
+ TQString version = DomUtil::readEntry(dom, "/general/version");
+ TQString appname = DomUtil::readEntry(dom, "/general/projectname");
+ TQString date = TQDate::currentDate().toString();
+ TQString year = TQString::number(TQDate::currentDate().year());
+
+ TQString str = text;
+ str.replace(TQRegExp("\\$EMAIL\\$"),email);
+ str.replace(TQRegExp("\\$AUTHOR\\$"),author);
+ str.replace(TQRegExp("\\$VERSION\\$"),version);
+ str.replace(TQRegExp("\\$DATE\\$"),date);
+ str.replace(TQRegExp("\\$YEAR\\$"),year);
+ str.replace(TQRegExp("\\$APPNAME\\$"),appname);
+ str.replace(TQRegExp("\\$APPNAME\\$"),appname);
+ str.replace(TQRegExp("\\$APPNAMEUC\\$"),appname.upper());
+ str.replace(TQRegExp("\\$APPNAMELC\\$"),appname.lower());
return str;
}
-bool FileTemplate::copy(KDevPlugin *part, const QString &name,
- const QString &dest, Policy p)
+bool FileTemplate::copy(KDevPlugin *part, const TQString &name,
+ const TQString &dest, Policy p)
{
- QString text = read(part, name, p);
+ TQString text = read(part, name, p);
- QFile f(dest);
+ TQFile f(dest);
if (!f.open(IO_WriteOnly))
return false;
- QFileInfo fi(f);
- QString module = fi.baseName();
- QString basefilename = fi.baseName(true);
- text.replace(QRegExp("\\$MODULE\\$"),module);
- text.replace(QRegExp("\\$FILENAME\\$"),basefilename);
+ TQFileInfo fi(f);
+ TQString module = fi.baseName();
+ TQString basefilename = fi.baseName(true);
+ text.replace(TQRegExp("\\$MODULE\\$"),module);
+ text.replace(TQRegExp("\\$FILENAME\\$"),basefilename);
- QTextStream stream(&f);
+ TQTextStream stream(&f);
stream << text;
f.close();
return true;
}
-QString FileTemplate::fullPathForName(KDevPlugin *part, const QString &name,
+TQString FileTemplate::fullPathForName(KDevPlugin *part, const TQString &name,
Policy p) {
// if Policy is not default, full path is just the name
if (p!=Default) return name;
- QString fileName;
+ TQString fileName;
// first try project-specific
if (part->project())
{
fileName = (part->project()->projectDirectory() + "/templates/" + name);
- if (QFile::exists(fileName)) return fileName;
+ if (TQFile::exists(fileName)) return fileName;
}
// next try global
- QString globalName = ::locate("data", "kdevfilecreate/file-templates/" + name);
+ TQString globalName = ::locate("data", "kdevfilecreate/file-templates/" + name);
return globalName.isNull() ? fileName : globalName;
}
diff --git a/lib/util/filetemplate.h b/lib/util/filetemplate.h
index f179f5be..b1ba2cdc 100644
--- a/lib/util/filetemplate.h
+++ b/lib/util/filetemplate.h
@@ -20,7 +20,7 @@
#ifndef _FILETEMPLATE_H_
#define _FILETEMPLATE_H_
-#include <qstring.h>
+#include <tqstring.h>
class KDevPlugin;
class QDomDocument;
@@ -49,40 +49,40 @@ public:
* exists in the current project. File templates
* are stored in the "templates" subdirectory of a project or in application shared dirs.
*/
- static bool exists(KDevPlugin *part, const QString &name, Policy p = Default);
+ static bool exists(KDevPlugin *part, const TQString &name, Policy p = Default);
/**
* Reads a template with the given name (e.g. "cpp")
* and makes variable substitutions (like $AUTHOR$ etc.)
* in it. The resulting string is returned.
*/
- static QString read(KDevPlugin *part, const QString &name, Policy p = Default);
+ static TQString read(KDevPlugin *part, const TQString &name, Policy p = Default);
/**
* Reads a template with the given URL
* and makes variable substitutions (like $AUTHOR$ etc.)
* in it. The resulting string is returned.
*/
- static QString readFile(KDevPlugin *part, const QString &fileName);
+ static TQString readFile(KDevPlugin *part, const TQString &fileName);
/**
- * Makes variable substitutions on a text, based on a specified QDomDocument
+ * Makes variable substitutions on a text, based on a specified TQDomDocument
* describing a KDevelop project file. The resulting string is returned.
*/
- static QString makeSubstitutions(QDomDocument &dom, const QString &text);
+ static TQString makeSubstitutions(TQDomDocument &dom, const TQString &text);
/**
* Copies a file template with the given name to the
* file with the name dest and - while copying -
* performs variable substitutions.
*/
- static bool copy(KDevPlugin *part, const QString &name,
- const QString &dest, Policy p = Default);
+ static bool copy(KDevPlugin *part, const TQString &name,
+ const TQString &dest, Policy p = Default);
/**
* Translates a template name into a full path, or suggests a full path
* for the template in the project directory if it doesn't exist.
*/
- static QString fullPathForName(KDevPlugin *part, const QString &name, Policy p = Default);
+ static TQString fullPathForName(KDevPlugin *part, const TQString &name, Policy p = Default);
};
#endif
diff --git a/lib/util/kdeveditorutil.cpp b/lib/util/kdeveditorutil.cpp
index fdf044d5..ca946ce6 100644
--- a/lib/util/kdeveditorutil.cpp
+++ b/lib/util/kdeveditorutil.cpp
@@ -33,15 +33,15 @@ bool KDevEditorUtil::currentPositionReal( unsigned int * line, unsigned int * co
return true;
}
-QString KDevEditorUtil::currentLine( KTextEditor::Document * doc, KTextEditor::View * view )
+TQString KDevEditorUtil::currentLine( KTextEditor::Document * doc, KTextEditor::View * view )
{
KTextEditor::EditInterface * editIface = dynamic_cast<KTextEditor::EditInterface*>( doc );
- if ( !editIface ) return QString();
+ if ( !editIface ) return TQString();
view = view ? view : dynamic_cast<KTextEditor::View*>( doc->widget() );
KTextEditor::ViewCursorInterface * cursorIface = dynamic_cast<KTextEditor::ViewCursorInterface*>( view );
- if ( !cursorIface ) return QString();
+ if ( !cursorIface ) return TQString();
uint line = 0;
uint col = 0;
@@ -50,21 +50,21 @@ QString KDevEditorUtil::currentLine( KTextEditor::Document * doc, KTextEditor::V
return editIface->textLine(line);
}
-QString KDevEditorUtil::currentWord( KTextEditor::Document * doc, KTextEditor::View * view )
+TQString KDevEditorUtil::currentWord( KTextEditor::Document * doc, KTextEditor::View * view )
{
KTextEditor::EditInterface * editIface = dynamic_cast<KTextEditor::EditInterface*>( doc );
- if ( !editIface ) return QString();
+ if ( !editIface ) return TQString();
view = view ? view : dynamic_cast<KTextEditor::View*>( doc->widget() );
KTextEditor::ViewCursorInterface * cursorIface = dynamic_cast<KTextEditor::ViewCursorInterface*>( view );
- if ( !cursorIface ) return QString();
+ if ( !cursorIface ) return TQString();
uint line = 0;
uint col = 0;
cursorIface->cursorPositionReal(&line, &col);
- QString linestr = editIface->textLine(line);
+ TQString linestr = editIface->textLine(line);
int startPos = QMAX( QMIN( (int)col, (int)linestr.length()-1 ), 0 );
int endPos = startPos;
@@ -74,14 +74,14 @@ QString KDevEditorUtil::currentWord( KTextEditor::Document * doc, KTextEditor::V
while (endPos < (int)linestr.length() && ( linestr[endPos].isLetterOrNumber() || linestr[endPos] == '_' ) )
endPos++;
- return ( ( startPos == endPos ) ? QString::null : linestr.mid( startPos+1, endPos-startPos-1 ) );
+ return ( ( startPos == endPos ) ? TQString::null : linestr.mid( startPos+1, endPos-startPos-1 ) );
}
-QString KDevEditorUtil::currentSelection( KTextEditor::Document * doc )
+TQString KDevEditorUtil::currentSelection( KTextEditor::Document * doc )
{
KTextEditor::SelectionInterface * selectIface = dynamic_cast<KTextEditor::SelectionInterface*>( doc );
- return selectIface ? selectIface->selection() : QString();
+ return selectIface ? selectIface->selection() : TQString();
}
diff --git a/lib/util/kdeveditorutil.h b/lib/util/kdeveditorutil.h
index 7b788fc3..79a64fe1 100644
--- a/lib/util/kdeveditorutil.h
+++ b/lib/util/kdeveditorutil.h
@@ -18,7 +18,7 @@ class Document;
class View;
}
-#include <qstring.h>
+#include <tqstring.h>
/**
Class with some common utility operations not currently supported by KTE
@@ -46,19 +46,19 @@ public:
* @param view
* @return
*/
- static QString currentLine( KTextEditor::Document * doc, KTextEditor::View * view = 0 );
+ static TQString currentLine( KTextEditor::Document * doc, KTextEditor::View * view = 0 );
/**
* Call to get the text under the cursor of the currently active view.
* @return the text under the cursor of the currently active view
*/
- static QString currentWord( KTextEditor::Document * doc, KTextEditor::View * view = 0 );
+ static TQString currentWord( KTextEditor::Document * doc, KTextEditor::View * view = 0 );
/**
* Call to get the selection in the currently active view
* @return the selection in the currently active view
*/
- static QString currentSelection( KTextEditor::Document * doc );
+ static TQString currentSelection( KTextEditor::Document * doc );
};
#endif
diff --git a/lib/util/kdevjobtimer.cpp b/lib/util/kdevjobtimer.cpp
index b7f9e2ae..b0b78250 100644
--- a/lib/util/kdevjobtimer.cpp
+++ b/lib/util/kdevjobtimer.cpp
@@ -11,22 +11,22 @@
#include "kdevjobtimer.h"
-KDevJobTimer::KDevJobTimer( void * payload, QObject *parent, const char *name)
- : QTimer(parent, name)
+KDevJobTimer::KDevJobTimer( void * payload, TQObject *parent, const char *name)
+ : TQTimer(parent, name)
{
m_payload = payload;
- connect( this, SIGNAL(timeout()), this, SLOT(slotTimeout()) );
+ connect( this, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotTimeout()) );
}
KDevJobTimer::~KDevJobTimer()
{
}
-void KDevJobTimer::singleShot(int msec, QObject * receiver, const char * member, void * payload)
+void KDevJobTimer::singleShot(int msec, TQObject * receiver, const char * member, void * payload)
{
KDevJobTimer * p = new KDevJobTimer( payload );
p->start( msec, true );
- connect( p, SIGNAL(timeout(void*)), receiver, member );
+ connect( p, TQT_SIGNAL(timeout(void*)), receiver, member );
}
void KDevJobTimer::slotTimeout()
diff --git a/lib/util/kdevjobtimer.h b/lib/util/kdevjobtimer.h
index 972a654a..19915d06 100644
--- a/lib/util/kdevjobtimer.h
+++ b/lib/util/kdevjobtimer.h
@@ -12,19 +12,19 @@
#ifndef KDEVJOBTIMER_H
#define KDEVJOBTIMER_H
-#include <qtimer.h>
+#include <tqtimer.h>
class KDevJobTimer : public QTimer
{
Q_OBJECT
public:
- static void singleShot( int msec, QObject * receiver, const char * member, void * payload );
+ static void singleShot( int msec, TQObject * receiver, const char * member, void * payload );
signals:
void timeout(void*);
private:
- KDevJobTimer( void * payload, QObject *parent = 0, const char *name = 0);
+ KDevJobTimer( void * payload, TQObject *parent = 0, const char *name = 0);
~KDevJobTimer();
private slots:
diff --git a/lib/util/kdevshellwidget.cpp b/lib/util/kdevshellwidget.cpp
index f9a61fea..546360c6 100644
--- a/lib/util/kdevshellwidget.cpp
+++ b/lib/util/kdevshellwidget.cpp
@@ -9,8 +9,8 @@
* *
***************************************************************************/
-#include <qtimer.h>
-#include <qframe.h>
+#include <tqtimer.h>
+#include <tqframe.h>
#include <kdebug.h>
#include <kparts/part.h>
@@ -20,8 +20,8 @@
#include "kdevshellwidget.h"
-KDevShellWidget::KDevShellWidget(QWidget *parent, const char *name)
- : QVBox(parent, name), m_doAutoActivate( false ), m_isRunning( false )
+KDevShellWidget::KDevShellWidget(TQWidget *parent, const char *name)
+ : TQVBox(parent, name), m_doAutoActivate( false ), m_isRunning( false )
{
}
@@ -30,7 +30,7 @@ KDevShellWidget::~KDevShellWidget()
{
}
-void KDevShellWidget::setShell( const QString & shell, const QStrList & arguments )
+void KDevShellWidget::setShell( const TQString & shell, const TQStrList & arguments )
{
m_shellName = shell;
m_shellArguments = arguments;
@@ -44,16 +44,16 @@ void KDevShellWidget::activate( )
m_konsolePart = (KParts::ReadOnlyPart *) factory->create( this, "libkonsolepart", "KParts::ReadOnlyPart" );
if ( !m_konsolePart ) return;
- connect( m_konsolePart, SIGNAL( processExited(KProcess *) ), this, SLOT( processExited(KProcess *) ) );
- connect( m_konsolePart, SIGNAL( receivedData( const QString& ) ), this, SIGNAL( receivedData( const QString& ) ) );
- connect( m_konsolePart, SIGNAL(destroyed()), this, SLOT(partDestroyed()) );
+ connect( m_konsolePart, TQT_SIGNAL( processExited(KProcess *) ), this, TQT_SLOT( processExited(KProcess *) ) );
+ connect( m_konsolePart, TQT_SIGNAL( receivedData( const TQString& ) ), this, TQT_SIGNAL( receivedData( const TQString& ) ) );
+ connect( m_konsolePart, TQT_SIGNAL(destroyed()), this, TQT_SLOT(partDestroyed()) );
- m_konsolePart->widget()->setFocusPolicy( QWidget::WheelFocus );
+ m_konsolePart->widget()->setFocusPolicy( TQWidget::WheelFocus );
setFocusProxy( m_konsolePart->widget() );
m_konsolePart->widget()->setFocus();
- if ( m_konsolePart->widget()->inherits("QFrame") )
- ((QFrame*)m_konsolePart->widget())->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ if ( m_konsolePart->widget()->inherits("TQFrame") )
+ ((TQFrame*)m_konsolePart->widget())->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
m_konsolePart->widget()->show();
@@ -89,7 +89,7 @@ void KDevShellWidget::processExited( KProcess * proc )
emit shellSignalled( proc->exitSignal() );
}
-void KDevShellWidget::sendInput( const QString & text )
+void KDevShellWidget::sendInput( const TQString & text )
{
if ( !m_konsolePart ) return;
TerminalInterface* ti = static_cast<TerminalInterface*>( m_konsolePart->qt_cast( "TerminalInterface" ) );
@@ -109,7 +109,7 @@ void KDevShellWidget::setAutoReactivateOnClose( bool doAutoActivate )
// reactivating with a non-working setting (the partDestroyed()
// slot will have ran before m_doAutoActivate is set)
if ( doAutoActivate )
- QTimer::singleShot( 3000, this, SLOT(setAutoReactivateOnCloseDelayed()) );
+ TQTimer::singleShot( 3000, this, TQT_SLOT(setAutoReactivateOnCloseDelayed()) );
else
m_doAutoActivate = false;
}
diff --git a/lib/util/kdevshellwidget.h b/lib/util/kdevshellwidget.h
index 3f1500aa..69198a7a 100644
--- a/lib/util/kdevshellwidget.h
+++ b/lib/util/kdevshellwidget.h
@@ -13,9 +13,9 @@
#ifndef KDEVSHELLWIDGET_H
#define KDEVSHELLWIDGET_H
-#include <qstrlist.h>
-#include <qvbox.h>
-#include <qguardedptr.h>
+#include <tqstrlist.h>
+#include <tqvbox.h>
+#include <tqguardedptr.h>
class KProcess;
namespace KParts
@@ -29,7 +29,7 @@ class KDevShellWidget : public QVBox
Q_OBJECT
public:
- KDevShellWidget(QWidget *parent = 0, const char *name = 0);
+ KDevShellWidget(TQWidget *parent = 0, const char *name = 0);
virtual ~KDevShellWidget();
/**
@@ -37,7 +37,7 @@ public:
* @param shell The shell name, for example 'irb' or '/bin/bash'
* @param arguments Any optional arguments
*/
- void setShell( const QString & shell, const QStrList & arguments = QStrList() );
+ void setShell( const TQString & shell, const TQStrList & arguments = TQStrList() );
/**
* Executes the previously set shell. If @ref setShell wasn't called before
@@ -55,7 +55,7 @@ public:
* Send text to the running shell
* @param text The text to send to the shell
*/
- void sendInput( const QString & text );
+ void sendInput( const TQString & text );
/**
* Call to check if the shell is currently running
@@ -80,7 +80,7 @@ signals:
* This signal will be emitted when the process receives data
* @param text received data
*/
- void receivedData( const QString & );
+ void receivedData( const TQString & );
private slots:
void partDestroyed();
@@ -88,9 +88,9 @@ private slots:
void setAutoReactivateOnCloseDelayed( );
private:
- QGuardedPtr<KParts::ReadOnlyPart> m_konsolePart;
- QString m_shellName;
- QStrList m_shellArguments;
+ TQGuardedPtr<KParts::ReadOnlyPart> m_konsolePart;
+ TQString m_shellName;
+ TQStrList m_shellArguments;
bool m_doAutoActivate;
bool m_isRunning;
};
diff --git a/lib/util/kscriptactionmanager.cpp b/lib/util/kscriptactionmanager.cpp
index b06a9edf..ffc3a536 100644
--- a/lib/util/kscriptactionmanager.cpp
+++ b/lib/util/kscriptactionmanager.cpp
@@ -29,11 +29,11 @@
#include <kdebug.h>
#include <scriptinterface.h>
#include <kaction.h>
-#include <qfileinfo.h>
-#include <qtimer.h>
+#include <tqfileinfo.h>
+#include <tqtimer.h>
-KScriptAction::KScriptAction( const QString &scriptDesktopFile, QObject *interface, KActionCollection *ac )
- : QObject(interface), KScriptClientInterface( )
+KScriptAction::KScriptAction( const TQString &scriptDesktopFile, TQObject *interface, KActionCollection *ac )
+ : TQObject(interface), KScriptClientInterface( )
{
m_interface = 0L;
m_action = 0L;
@@ -43,24 +43,24 @@ KScriptAction::KScriptAction( const QString &scriptDesktopFile, QObject *interfa
if(KDesktopFile::isDesktopFile(scriptDesktopFile))
{
KDesktopFile desktop(scriptDesktopFile, true);
- QFileInfo scriptPath(scriptDesktopFile);
+ TQFileInfo scriptPath(scriptDesktopFile);
m_scriptFile = scriptPath.dirPath(true) + "/" + desktop.readEntry("X-KDE-ScriptName", "");
m_scriptName = desktop.readName();
m_scriptType = desktop.readType();
- QString scriptTypeQuery = "([X-KDE-Script-Runner] == '" + m_scriptType + "')";
+ TQString scriptTypeQuery = "([X-KDE-Script-Runner] == '" + m_scriptType + "')";
KTrader::OfferList offers = KTrader::self()->query( "KScriptRunner/KScriptRunner", scriptTypeQuery );
if ( !offers.isEmpty() )
{
- m_action = new KAction(m_scriptName, KShortcut(), this, SLOT(activate()), ac, "script");
+ m_action = new KAction(m_scriptName, KShortcut(), this, TQT_SLOT(activate()), ac, "script");
m_isValid = true;
- m_timeout = new QTimer(this);
- QString icon = desktop.readIcon();
+ m_timeout = new TQTimer(this);
+ TQString icon = desktop.readIcon();
m_action->setStatusText(desktop.readComment());
if( !icon.isEmpty() )
m_action->setIcon(icon);
m_action->setShortcutConfigurable(true);
- connect( m_timeout, SIGNAL(timeout()), SLOT(cleanup()) );
+ connect( m_timeout, TQT_SIGNAL(timeout()), TQT_SLOT(cleanup()) );
}
}
}
@@ -82,7 +82,7 @@ void KScriptAction::activate( )
{
if( m_interface == 0L)
{
- QString scriptTypeQuery = "([X-KDE-Script-Runner] == '" + m_scriptType + "')";
+ TQString scriptTypeQuery = "([X-KDE-Script-Runner] == '" + m_scriptType + "')";
m_interface= KParts::ComponentFactory::createInstanceFromQuery<KScriptInterface>( "KScriptRunner/KScriptRunner", scriptTypeQuery, this );
if ( m_interface != 0L)
{
@@ -91,7 +91,7 @@ void KScriptAction::activate( )
m_interface->setScript(m_scriptFile);
else
m_interface->setScript(m_scriptFile, m_scriptMethod);
- connect(this, SIGNAL(done(KScriptClientInterface::Result, const QVariant &)), this, SLOT(scriptFinished()));
+ connect(this, TQT_SIGNAL(done(KScriptClientInterface::Result, const TQVariant &)), this, TQT_SLOT(scriptFinished()));
}
else
{
@@ -100,7 +100,7 @@ void KScriptAction::activate( )
return;
}
}
- m_interface->run(parent(), QVariant());
+ m_interface->run(parent(), TQVariant());
m_timeout->start(60000,FALSE); // after 1 minute unload
m_refs++;
}
@@ -119,7 +119,7 @@ void KScriptAction::scriptFinished()
m_refs--;
}
-KScriptActionManager::KScriptActionManager( QObject *parent, KActionCollection * ac ) : QObject(parent), m_ac(ac)
+KScriptActionManager::KScriptActionManager( TQObject *parent, KActionCollection * ac ) : TQObject(parent), m_ac(ac)
{
m_actions.setAutoDelete(true);
}
@@ -129,22 +129,22 @@ KScriptActionManager::~ KScriptActionManager( )
m_actions.clear();
}
-QPtrList< KAction > KScriptActionManager::scripts( QObject * interface , const QStringList &dirs) const
+TQPtrList< KAction > KScriptActionManager::scripts( TQObject * interface , const TQStringList &dirs) const
{
m_actions.clear();
- QPtrList<KAction> actions;
- QStringList scripts;
+ TQPtrList<KAction> actions;
+ TQStringList scripts;
scripts += KGlobal::dirs()->findAllResources("data",
- QString(kapp->name())+"/scripts/*.desktop", false, true );
+ TQString(kapp->name())+"/scripts/*.desktop", false, true );
- for( QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it)
+ for( TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it)
{
scripts += KGlobal::dirs()->findAllResources("data",
(*it)+"/*.desktop", false, true );
}
- for (QStringList::Iterator it = scripts.begin(); it != scripts.end(); ++it )
+ for (TQStringList::Iterator it = scripts.begin(); it != scripts.end(); ++it )
{
kdDebug() << "Loading " << *it << endl;
KScriptAction *script = new KScriptAction(*it, interface, m_ac);
@@ -152,16 +152,16 @@ QPtrList< KAction > KScriptActionManager::scripts( QObject * interface , const Q
{
actions.append(script->action());
m_actions.append(script);
- connect(script, SIGNAL(error( const QString&)), this,
- SIGNAL(scriptError( const QString&)));
- connect(script, SIGNAL(warning( const QString&)), this,
- SIGNAL(scriptWarning( const QString&)));
- connect(script, SIGNAL(output( const QString&)), this,
- SIGNAL(scriptOutput( const QString&)));
- connect(script, SIGNAL(progress( int )), this,
- SIGNAL(scriptProgress(int)));
- connect(script, SIGNAL(done( KScriptClientInterface::Result, const QVariant &)),this,
- SIGNAL(scriptDone( KScriptClientInterface::Result, const QVariant &)));
+ connect(script, TQT_SIGNAL(error( const TQString&)), this,
+ TQT_SIGNAL(scriptError( const TQString&)));
+ connect(script, TQT_SIGNAL(warning( const TQString&)), this,
+ TQT_SIGNAL(scriptWarning( const TQString&)));
+ connect(script, TQT_SIGNAL(output( const TQString&)), this,
+ TQT_SIGNAL(scriptOutput( const TQString&)));
+ connect(script, TQT_SIGNAL(progress( int )), this,
+ TQT_SIGNAL(scriptProgress(int)));
+ connect(script, TQT_SIGNAL(done( KScriptClientInterface::Result, const TQVariant &)),this,
+ TQT_SIGNAL(scriptDone( KScriptClientInterface::Result, const TQVariant &)));
}
else
delete script;
diff --git a/lib/util/kscriptactionmanager.h b/lib/util/kscriptactionmanager.h
index 78833d2b..47d1a04e 100644
--- a/lib/util/kscriptactionmanager.h
+++ b/lib/util/kscriptactionmanager.h
@@ -21,8 +21,8 @@
#define KScriptAction_H
#include <scriptclientinterface.h>
-#include <qobject.h>
-#include <qptrlist.h>
+#include <tqobject.h>
+#include <tqptrlist.h>
class KAction;
class KActionCollection;
@@ -35,11 +35,11 @@ class QTimer;
*
* @author ian geiser geiseri@sourcextreme.com
*/
-class KScriptAction : public QObject, public KScriptClientInterface {
+class KScriptAction : public TQObject, public KScriptClientInterface {
Q_OBJECT
public:
- KScriptAction( const QString &scriptDesktopFile, QObject *interface, KActionCollection *ac );
+ KScriptAction( const TQString &scriptDesktopFile, TQObject *interface, KActionCollection *ac );
virtual ~KScriptAction();
@@ -55,18 +55,18 @@ public:
signals:
// Reimplemented from KScript
- void error ( const QString &msg );
- void warning ( const QString &msg );
- void output ( const QString &msg );
+ void error ( const TQString &msg );
+ void warning ( const TQString &msg );
+ void output ( const TQString &msg );
void progress ( int percent );
- void done ( KScriptClientInterface::Result result, const QVariant &returned );
+ void done ( KScriptClientInterface::Result result, const TQVariant &returned );
signals:
- void scriptError ( const QString &msg );
- void scriptWarning ( const QString &msg );
- void scriptOutput ( const QString &msg );
+ void scriptError ( const TQString &msg );
+ void scriptWarning ( const TQString &msg );
+ void scriptOutput ( const TQString &msg );
void scriptProgress ( int percent );
- void scriptDone ( KScriptClientInterface::Result result, const QVariant &returned );
+ void scriptDone ( KScriptClientInterface::Result result, const TQVariant &returned );
private slots:
void activate();
@@ -75,13 +75,13 @@ private slots:
private:
KAction *m_action;
- QString m_scriptName;
- QString m_scriptType;
- QString m_scriptFile;
- QString m_scriptMethod;
+ TQString m_scriptName;
+ TQString m_scriptType;
+ TQString m_scriptFile;
+ TQString m_scriptMethod;
KScriptInterface *m_interface;
bool m_isValid;
- QTimer *m_timeout;
+ TQTimer *m_timeout;
uint m_refs;
};
@@ -90,39 +90,39 @@ private:
* Scripts are not actually loaded until they are actually executed.
* @author ian geiser <geiseri@sourcextreme.com>
*/
-class KScriptActionManager : public QObject {
+class KScriptActionManager : public TQObject {
Q_OBJECT
public:
/**
* Create a script manager that is attached to an action collection.
*/
- KScriptActionManager( QObject *parent, KActionCollection *ac );
+ KScriptActionManager( TQObject *parent, KActionCollection *ac );
~KScriptActionManager();
/**
* Return all currently loaded scripts in a direcotry and attaches them
- * to a QObject interface. If the dirs are empty the current applications
+ * to a TQObject interface. If the dirs are empty the current applications
* scripts directory is used. The dirs are actual directories to search
* in the $KDEPATH/data/ direcories. So if you add "coolapp/data" then
* the manager will search in $KDEPATH/data/coolapp/data for all desktop
* files that are scripts.
*/
- QPtrList<KAction> scripts( QObject *interface, const QStringList &dirs = QStringList() ) const;
+ TQPtrList<KAction> scripts( TQObject *interface, const TQStringList &dirs = TQStringList() ) const;
signals:
/**
* Returns an error message from a script.
*/
- void scriptError ( const QString &msg );
+ void scriptError ( const TQString &msg );
/**
* Returns a warning message from a script.
*/
- void scriptWarning ( const QString &msg );
+ void scriptWarning ( const TQString &msg );
/**
* Returns a standard out message from a script.
*/
- void scriptOutput ( const QString &msg );
+ void scriptOutput ( const TQString &msg );
/**
* Returns the percentage complete of an operation in the script.
*/
@@ -130,10 +130,10 @@ signals:
/**
* Notifies that the script has finished.
*/
- void scriptDone( KScriptClientInterface::Result result, const QVariant &returned );
+ void scriptDone( KScriptClientInterface::Result result, const TQVariant &returned );
private:
- mutable QPtrList<KScriptAction> m_actions;
+ mutable TQPtrList<KScriptAction> m_actions;
KActionCollection *m_ac;
};
#endif
diff --git a/lib/util/rurl.cpp b/lib/util/rurl.cpp
index 1ec23434..0d631bda 100644
--- a/lib/util/rurl.cpp
+++ b/lib/util/rurl.cpp
@@ -1,4 +1,4 @@
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include "rurl.h"
@@ -7,7 +7,7 @@ namespace Relative{
//class Name
-Name::Name( const QString & rurl, const Type type )
+Name::Name( const TQString & rurl, const Type type )
:m_rurl(rurl), m_type(type)
{
correct();
@@ -43,9 +43,9 @@ void Name::correct()
}
}
-QString Name::correctName( const QString & rurl, const Type type )
+TQString Name::correctName( const TQString & rurl, const Type type )
{
- QString temp = rurl;
+ TQString temp = rurl;
temp = Name::cleanName(temp);
if (temp[0] == '/')
temp = temp.mid(1);
@@ -65,21 +65,21 @@ QString Name::correctName( const QString & rurl, const Type type )
return temp;
}
-void Name::setRURL( const QString & rurl, const Type type )
+void Name::setRURL( const TQString & rurl, const Type type )
{
m_rurl = rurl;
m_type = type;
correct();
}
-QString Name::rurl( ) const
+TQString Name::rurl( ) const
{
return m_rurl;
}
-void Name::addPath( const QString & addendum )
+void Name::addPath( const TQString & addendum )
{
- QString temp = correctName(addendum, Directory);
+ TQString temp = correctName(addendum, Directory);
m_rurl = directory() + temp + fileName();
}
@@ -88,9 +88,9 @@ void Name::cleanRURL( )
m_rurl = cleanName(m_rurl);
}
-QString Name::cleanName( const QString & rurl )
+TQString Name::cleanName( const TQString & rurl )
{
- QString temp;
+ TQString temp;
bool wasSlash = false;
for (unsigned int i = 0; i < rurl.length(); ++i)
{
@@ -107,30 +107,30 @@ QString Name::cleanName( const QString & rurl )
return temp;
}
-QString Name::extension( bool complete ) const
+TQString Name::extension( bool complete ) const
{
if (m_type == File)
{
- QString temp = fileName();
+ TQString temp = fileName();
if (complete)
return temp.mid(temp.find('.')+1);
else
return temp.mid(temp.findRev('.')+1);
}
- return QString::null;
+ return TQString::null;
}
-QString Name::fileName( ) const
+TQString Name::fileName( ) const
{
if (m_type == File)
return m_rurl.section('/', -1);
- return QString::null;
+ return TQString::null;
}
-QString Name::directory( ) const
+TQString Name::directory( ) const
{
if ( (m_type == File) && (m_rurl.findRev('/') == -1) )
- return QString::null;
+ return TQString::null;
return m_rurl.mid(0, m_rurl.findRev('/')+1);
}
@@ -181,18 +181,18 @@ void Name::setType( const Type type )
m_type = type;
}
-Name Name::relativeName( const QString &base, const QString &url )
+Name Name::relativeName( const TQString &base, const TQString &url )
{
- QString dirUrl = base;
- QString fileUrl = url;
+ TQString dirUrl = base;
+ TQString fileUrl = url;
if (dirUrl.isEmpty() || (dirUrl == "/"))
return Name(fileUrl);
- QStringList dir = QStringList::split("/", dirUrl, false);
- QStringList file = QStringList::split("/", fileUrl, false);
+ TQStringList dir = TQStringList::split("/", dirUrl, false);
+ TQStringList file = TQStringList::split("/", fileUrl, false);
- QString resFileName = file.last();
+ TQString resFileName = file.last();
if (url.endsWith("/"))
resFileName += "/";
file.remove(file.last());
@@ -201,10 +201,10 @@ Name Name::relativeName( const QString &base, const QString &url )
while ( (i < dir.count()) && (i < (file.count())) && (dir[i] == file[i]) )
i++;
- QString result_up;
- QString result_down;
- QString currDir;
- QString currFile;
+ TQString result_up;
+ TQString result_down;
+ TQString currDir;
+ TQString currFile;
do
{
i >= dir.count() ? currDir = "" : currDir = dir[i];
@@ -237,7 +237,7 @@ URL::URL( KURL base, KURL url, Type type )
{
}
-URL::URL( KURL base, QString url, bool isUrlRelative, Type type )
+URL::URL( KURL base, TQString url, bool isUrlRelative, Type type )
:Name(isUrlRelative ? url : Name::relativeName(base.path(), url).rurl(), type), m_base(base)
{
}
@@ -247,7 +247,7 @@ void URL::setBase( const KURL & base )
m_base = base;
}
-void URL::setBase( const QString & base )
+void URL::setBase( const TQString & base )
{
KURL url;
url.setPath(base);
@@ -259,7 +259,7 @@ KURL URL::base( ) const
return m_base;
}
-QString URL::basePath( ) const
+TQString URL::basePath( ) const
{
return m_base.path(1);
}
@@ -272,7 +272,7 @@ KURL URL::url( ) const
return url;
}
-QString URL::urlPath( ) const
+TQString URL::urlPath( ) const
{
KURL url = m_base;
url.addPath(rurl());
@@ -285,7 +285,7 @@ QString URL::urlPath( ) const
return url.path(mod);
}
-QString URL::urlDirectory( ) const
+TQString URL::urlDirectory( ) const
{
KURL url = m_base;
url.addPath(rurl());
@@ -303,7 +303,7 @@ URL URL::relativeURL( KURL base, KURL url )
return URL(base, url);
}
-URL URL::relativeURL( KURL base, QString url, bool isUrlRelative )
+URL URL::relativeURL( KURL base, TQString url, bool isUrlRelative )
{
return URL(base, url, isUrlRelative);
}
@@ -327,17 +327,17 @@ Directory::Directory( KURL base, KURL url )
{
}
-Directory::Directory( KURL base, QString url, bool isRelativeUrl )
+Directory::Directory( KURL base, TQString url, bool isRelativeUrl )
:URL(base, url, isRelativeUrl, Name::Directory)
{
}
-void Directory::setRURL( QString rurl )
+void Directory::setRURL( TQString rurl )
{
URL::setRURL(rurl, Name::Directory);
}
-void Directory::setRURL( QString rurl, Type type )
+void Directory::setRURL( TQString rurl, Type type )
{
URL::setRURL(rurl, type);
}
@@ -351,17 +351,17 @@ File::File( KURL base, KURL url )
{
}
-File::File( KURL base, QString url, bool isRelativeUrl )
+File::File( KURL base, TQString url, bool isRelativeUrl )
:URL(base, url, isRelativeUrl, Name::File)
{
}
-void File::setRURL( QString rurl, Type type )
+void File::setRURL( TQString rurl, Type type )
{
URL::setRURL(rurl, type);
}
-void File::setRURL( QString rurl )
+void File::setRURL( TQString rurl )
{
URL::setRURL(rurl, Name::File);
}
diff --git a/lib/util/rurl.h b/lib/util/rurl.h
index 342b3e3d..5ab2ec73 100644
--- a/lib/util/rurl.h
+++ b/lib/util/rurl.h
@@ -23,33 +23,33 @@ public:
name/name/ are directories
name/name are files.
Trailing slash will be deleted for files (type == File).*/
- Name(const QString &rurl, const Type type = Auto);
+ Name(const TQString &rurl, const Type type = Auto);
Name(const char *rurl, const Type type = Auto);
/**Sets the relative name.*/
- void setRURL(const QString &rurl, const Type type);
+ void setRURL(const TQString &rurl, const Type type);
/**Gets the relative name in form
dir/dir/ -> directory
or
dir/dir/file -> file.*/
- QString rurl() const;
+ TQString rurl() const;
/**Adds addendum to the directory path. This honors file names so
if RName represents /dir1/dir2/fname.ext
addPath(dir3) will change RName to /dir1/dir2/dir3/fname.ext*/
- void addPath(const QString &addendum);
+ void addPath(const TQString &addendum);
/**Removes "//" from the name.*/
void cleanRURL();
- /**Returns the extension of a file or QString::null for directories.
+ /**Returns the extension of a file or TQString::null for directories.
If complete is true then returns extensions like "tar.gz".
Else returns "gz".*/
- QString extension(bool complete = true) const;
- /**Returns the name of the file without the path or QString::null
+ TQString extension(bool complete = true) const;
+ /**Returns the name of the file without the path or TQString::null
for directories.*/
- QString fileName() const;
- /**Returns the name of the directory or QString::null if there are no dirs in path.*/
- QString directory() const;
+ TQString fileName() const;
+ /**Returns the name of the directory or TQString::null if there are no dirs in path.*/
+ TQString directory() const;
/**Returns true if the type of RName is file.*/
bool isFile() const;
@@ -66,12 +66,12 @@ public:
/**Creates and returns relative name between base and url. Base and url should be absolute.
Base is considered to be a directory.*/
- static Name relativeName(const QString &base, const QString &url);
+ static Name relativeName(const TQString &base, const TQString &url);
/**Cleans rurl by removing extra slashes.*/
- static QString cleanName(const QString &rurl);
+ static TQString cleanName(const TQString &rurl);
/**Corrects rurl according to the given type and returns corrected url.
Also cleans url (see @ref cleanRURL).*/
- static QString correctName(const QString &rurl, const Type type = Auto);
+ static TQString correctName(const TQString &rurl, const Type type = Auto);
bool operator == (const Name &rname);
bool operator != (const Name &rname);
@@ -83,7 +83,7 @@ protected:
void correct();
private:
- QString m_rurl;
+ TQString m_rurl;
Type m_type;
};
@@ -97,17 +97,17 @@ public:
URL(KURL base, KURL url, Type type = Auto);
/**Creates RURL object with given base and relative or full url (according to
the isUrlRelative value).*/
- URL(KURL base, QString url, bool isUrlRelative, Type type = Auto);
+ URL(KURL base, TQString url, bool isUrlRelative, Type type = Auto);
/**Sets a new base for a RURL.*/
void setBase(const KURL &base);
/**Sets a new base for a RURL. Base is is considered to be a
directory and converted to KURL using KURL::setPath().*/
- void setBase(const QString &base);
+ void setBase(const TQString &base);
/**Returns RURL base.*/
KURL base() const;
/**Returns a path of a base KURL (using KURL::path()). Trailing slash is guaranteed.*/
- QString basePath() const;
+ TQString basePath() const;
/**Returns a complete url to the RURL location. This is basically base + rurl.
This also resolves ".." components in path.
@@ -120,13 +120,13 @@ public:
This method only returns a path part of the KURL (using KURL::path()).
Trailing slash is guaranteed for directories and no trailing slash - for files.
This also resolves ".." components in path.*/
- QString urlPath() const;
+ TQString urlPath() const;
/**Returns a directory of a complete url to the location. The url is constructed as base + rurl.
Returns the same as urlPath() for directories.
This method uses KURL::directory to determine the directory.
Trailing slash is guaranteed.
This also resolves ".." components in path.*/
- QString urlDirectory() const;
+ TQString urlDirectory() const;
/**Returns a new URL that is relative to given base. Relative part is taken from
current URL object.*/
@@ -136,7 +136,7 @@ public:
static URL relativeURL(KURL base, KURL url);
/**Returns a new relative URL constructed from base and given url. url parameter
is either relative or full (depends on isUrlRelative value).*/
- static URL relativeURL(KURL base, QString url, bool isUrlRelative);
+ static URL relativeURL(KURL base, TQString url, bool isUrlRelative);
bool operator == (const URL &url);
bool operator != (const URL &url);
@@ -150,14 +150,14 @@ class Directory: public URL{
public:
/**Works as URL::URL(KURL, KURL), only implies Name::Directory mode.*/
Directory(KURL base, KURL url);
- /**Works as URL::URL(KURL, QString, bool), only implies Name::Directory mode.*/
- Directory(KURL base, QString url, bool isRelativeUrl);
+ /**Works as URL::URL(KURL, TQString, bool), only implies Name::Directory mode.*/
+ Directory(KURL base, TQString url, bool isRelativeUrl);
- /**Works as URL::setRURL(QString), only implies Name::Directory mode.*/
- void setRURL(QString rurl);
+ /**Works as URL::setRURL(TQString), only implies Name::Directory mode.*/
+ void setRURL(TQString rurl);
private:
- void setRURL(QString rurl, Type type);
+ void setRURL(TQString rurl, Type type);
};
@@ -167,13 +167,13 @@ public:
/**Works as URL::URL(KURL, KURL), only implies Name::File mode.*/
File(KURL base, KURL url);
/**Works as URL::URL(KURL, KURL), only implies Name::File mode.*/
- File(KURL base, QString url, bool isRelativeUrl);
+ File(KURL base, TQString url, bool isRelativeUrl);
- /**Works as URL::setRURL(QString), only implies Name::File mode.*/
- void setRURL(QString rurl);
+ /**Works as URL::setRURL(TQString), only implies Name::File mode.*/
+ void setRURL(TQString rurl);
private:
- void setRURL(QString rurl, Type type);
+ void setRURL(TQString rurl, Type type);
};
diff --git a/lib/util/settings.cpp b/lib/util/settings.cpp
index 4e246e5b..129cdd66 100644
--- a/lib/util/settings.cpp
+++ b/lib/util/settings.cpp
@@ -15,35 +15,35 @@
#include "settings.h"
-QString Settings::terminalEmulatorName( KConfig & config )
+TQString Settings::terminalEmulatorName( KConfig & config )
{
config.setGroup("TerminalEmulator");
bool useKDESetting = config.readBoolEntry( "UseKDESetting", true );
- QString terminal;
+ TQString terminal;
if ( useKDESetting )
{
- KConfigGroup confGroup( KGlobal::config(), QString::fromLatin1("General") );
- terminal = confGroup.readEntry("TerminalApplication", QString::fromLatin1("konsole"));
+ KConfigGroup confGroup( KGlobal::config(), TQString::fromLatin1("General") );
+ terminal = confGroup.readEntry("TerminalApplication", TQString::fromLatin1("konsole"));
}
else
{
- terminal = config.readEntry( "TerminalApplication", QString::fromLatin1("konsole"));
+ terminal = config.readEntry( "TerminalApplication", TQString::fromLatin1("konsole"));
}
return terminal;
}
-QString Settings::profileByAttributes(const QString &language, const QStringList &keywords)
+TQString Settings::profileByAttributes(const TQString &language, const TQStringList &keywords)
{
KConfig config(locate("data", "kdevelop/profiles/projectprofiles"));
config.setGroup(language);
- QStringList profileKeywords = QStringList::split("/", "Empty");
+ TQStringList profileKeywords = TQStringList::split("/", "Empty");
if (config.hasKey("Keywords"))
profileKeywords = config.readListEntry("Keywords");
int idx = 0;
- for (QStringList::const_iterator it = profileKeywords.constBegin();
+ for (TQStringList::const_iterator it = profileKeywords.constBegin();
it != profileKeywords.constEnd(); ++it)
{
if (keywords.contains(*it))
@@ -53,7 +53,7 @@ QString Settings::profileByAttributes(const QString &language, const QStringList
}
}
- QStringList profiles;
+ TQStringList profiles;
if (config.hasKey("Profiles"))
{
profiles = config.readListEntry("Profiles");
diff --git a/lib/util/settings.h b/lib/util/settings.h
index cd241cad..ad92805d 100644
--- a/lib/util/settings.h
+++ b/lib/util/settings.h
@@ -18,8 +18,8 @@ class KConfig;
class Settings
{
public:
- static QString terminalEmulatorName( KConfig & config );
- static QString profileByAttributes(const QString &language, const QStringList &keywords);
+ static TQString terminalEmulatorName( KConfig & config );
+ static TQString profileByAttributes(const TQString &language, const TQStringList &keywords);
};
diff --git a/lib/util/urlutil.cpp b/lib/util/urlutil.cpp
index fb451769..849cc555 100644
--- a/lib/util/urlutil.cpp
+++ b/lib/util/urlutil.cpp
@@ -18,10 +18,10 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
-#include <qstringlist.h>
+#include <tqstringlist.h>
-#include <qdir.h>
-#include <qfileinfo.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
#include <kdebug.h>
#include <unistd.h>
@@ -36,28 +36,28 @@
// Namespace URLUtil
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::filename(const QString & name) {
+TQString URLUtil::filename(const TQString & name) {
int slashPos = name.findRev("/");
return slashPos<0 ? name : name.mid(slashPos+1);
}
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::directory(const QString & name) {
+TQString URLUtil::directory(const TQString & name) {
int slashPos = name.findRev("/");
- return slashPos<0 ? QString("") : name.left(slashPos);
+ return slashPos<0 ? TQString("") : name.left(slashPos);
}
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::getRelativePath(const QString& basepath, const QString& destpath)
+TQString URLUtil::getRelativePath(const TQString& basepath, const TQString& destpath)
{
- QString relpath = ".";
- if (!QFile::exists(basepath) ||
- !QFile::exists(destpath))
+ TQString relpath = ".";
+ if (!TQFile::exists(basepath) ||
+ !TQFile::exists(destpath))
return "";
- QStringList basedirs = QStringList::split(QString( QChar( QDir::separator() ) ),basepath);
- QStringList destdirs = QStringList::split(QString( QChar( QDir::separator() ) ),destpath);
+ TQStringList basedirs = TQStringList::split(TQString( TQChar( TQDir::separator() ) ),basepath);
+ TQStringList destdirs = TQStringList::split(TQString( TQChar( TQDir::separator() ) ),destpath);
int maxCompare=0;
if (basedirs.count()>=destdirs.count())
@@ -72,23 +72,23 @@ QString URLUtil::getRelativePath(const QString& basepath, const QString& destpat
lastCommonDir=i;
}
for (uint i=0;i<basedirs.count()-(lastCommonDir+1); i++)
- relpath += QString( QChar( QDir::separator() ) )+QString("..");
+ relpath += TQString( TQChar( TQDir::separator() ) )+TQString("..");
for (int i=0; i<lastCommonDir+1; i++)
destdirs.pop_front();
if (destdirs.count())
- relpath += QString( QChar( QDir::separator() ) )+destdirs.join( QChar( QDir::separator() ) );
- return QDir::cleanDirPath(relpath);
+ relpath += TQString( TQChar( TQDir::separator() ) )+destdirs.join( TQChar( TQDir::separator() ) );
+ return TQDir::cleanDirPath(relpath);
}
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::relativePath(const KURL & parent, const KURL & child, uint slashPolicy) {
+TQString URLUtil::relativePath(const KURL & parent, const KURL & child, uint slashPolicy) {
bool slashPrefix = slashPolicy & SLASH_PREFIX;
bool slashSuffix = slashPolicy & SLASH_SUFFIX;
if (parent.equals(child,true))
- return slashPrefix ? QString("/") : QString("");
+ return slashPrefix ? TQString("/") : TQString("");
- if (!parent.isParentOf(child)) return QString();
+ if (!parent.isParentOf(child)) return TQString();
int a=slashPrefix ? -1 : 1;
int b=slashSuffix ? 1 : -1;
return child.path(b).mid(parent.path(a).length());
@@ -96,15 +96,15 @@ QString URLUtil::relativePath(const KURL & parent, const KURL & child, uint slas
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::relativePath(const QString & parent, const QString & child, uint slashPolicy) {
+TQString URLUtil::relativePath(const TQString & parent, const TQString & child, uint slashPolicy) {
return relativePath(KURL(parent), KURL(child), slashPolicy);
}
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::upDir(const QString & path, bool slashSuffix) {
+TQString URLUtil::upDir(const TQString & path, bool slashSuffix) {
int slashPos = path.findRev("/");
- if (slashPos<1) return QString::null;
+ if (slashPos<1) return TQString::null;
return path.mid(0,slashPos+ (slashSuffix ? 1 : 0) );
}
@@ -122,41 +122,41 @@ KURL URLUtil::mergeURL(const KURL & source, const KURL & dest, const KURL & chil
if (dest.equals(child,true)) return source;
// calculate
- QString childUrlStr = child.url(-1);
- QString destStemStr = dest.url(1);
- QString sourceStemStr = source.url(1);
+ TQString childUrlStr = child.url(-1);
+ TQString destStemStr = dest.url(1);
+ TQString sourceStemStr = source.url(1);
return KURL(sourceStemStr.append( childUrlStr.mid( destStemStr.length() ) ) );
}
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::getExtension(const QString & path) {
+TQString URLUtil::getExtension(const TQString & path) {
int dotPos = path.findRev('.');
- if (dotPos<0) return QString("");
+ if (dotPos<0) return TQString("");
return path.mid(dotPos+1);
}
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::extractPathNameRelative(const KURL &baseDirUrl, const KURL &url )
+TQString URLUtil::extractPathNameRelative(const KURL &baseDirUrl, const KURL &url )
{
- QString absBase = extractPathNameAbsolute( baseDirUrl ),
+ TQString absBase = extractPathNameAbsolute( baseDirUrl ),
absRef = extractPathNameAbsolute( url );
int i = absRef.find( absBase, 0, true );
if (i == -1)
- return QString();
+ return TQString();
if (absRef == absBase)
- return QString( "." );
+ return TQString( "." );
else
- return absRef.replace( 0, absBase.length(), QString() );
+ return absRef.replace( 0, absBase.length(), TQString() );
}
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::extractPathNameRelative(const QString &basePath, const KURL &url )
+TQString URLUtil::extractPathNameRelative(const TQString &basePath, const KURL &url )
{
KURL baseDirUrl = KURL::fromPathOrURL( basePath );
return extractPathNameRelative( baseDirUrl, url );
@@ -164,7 +164,7 @@ QString URLUtil::extractPathNameRelative(const QString &basePath, const KURL &ur
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::extractPathNameRelative(const QString &basePath, const QString &absFilePath )
+TQString URLUtil::extractPathNameRelative(const TQString &basePath, const TQString &absFilePath )
{
KURL baseDirUrl = KURL::fromPathOrURL( basePath ),
fileUrl = KURL::fromPathOrURL( absFilePath );
@@ -173,7 +173,7 @@ QString URLUtil::extractPathNameRelative(const QString &basePath, const QString
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::extractPathNameAbsolute( const KURL &url )
+TQString URLUtil::extractPathNameAbsolute( const KURL &url )
{
if (isDirectory( url ))
return url.path( +1 ); // with trailing "/" if none is present
@@ -182,9 +182,9 @@ QString URLUtil::extractPathNameAbsolute( const KURL &url )
// Ok, this is an over-tight pre-condition on "url" since I hope nobody will never
// stress this function with absurd cases ... but who knows?
/*
- QString path = url.path();
- QFileInfo fi( path ); // Argh: QFileInfo is back ;))
- return ( fi.exists()? path : QString() );
+ TQString path = url.path();
+ TQFileInfo fi( path ); // Argh: TQFileInfo is back ;))
+ return ( fi.exists()? path : TQString() );
*/
return url.path();
}
@@ -199,14 +199,14 @@ bool URLUtil::isDirectory( const KURL &url )
///////////////////////////////////////////////////////////////////////////////
-bool URLUtil::isDirectory( const QString &absFilePath )
+bool URLUtil::isDirectory( const TQString &absFilePath )
{
- return QDir( absFilePath ).exists();
+ return TQDir( absFilePath ).exists();
}
///////////////////////////////////////////////////////////////////////////////
-void URLUtil::dump( const KURL::List &urls, const QString &aMessage )
+void URLUtil::dump( const KURL::List &urls, const TQString &aMessage )
{
if (!aMessage.isNull())
{
@@ -223,9 +223,9 @@ void URLUtil::dump( const KURL::List &urls, const QString &aMessage )
///////////////////////////////////////////////////////////////////////////////
-QStringList URLUtil::toRelativePaths( const QString &baseDir, const KURL::List &urls)
+TQStringList URLUtil::toRelativePaths( const TQString &baseDir, const KURL::List &urls)
{
- QStringList paths;
+ TQStringList paths;
for (size_t i=0; i<urls.count(); ++i)
{
@@ -237,25 +237,25 @@ QStringList URLUtil::toRelativePaths( const QString &baseDir, const KURL::List &
///////////////////////////////////////////////////////////////////////////////
-QString URLUtil::relativePathToFile( const QString & dirUrl, const QString & fileUrl )
+TQString URLUtil::relativePathToFile( const TQString & dirUrl, const TQString & fileUrl )
{
if (dirUrl.isEmpty() || (dirUrl == "/"))
return fileUrl;
- QStringList dir = QStringList::split("/", dirUrl, false);
- QStringList file = QStringList::split("/", fileUrl, false);
+ TQStringList dir = TQStringList::split("/", dirUrl, false);
+ TQStringList file = TQStringList::split("/", fileUrl, false);
- QString resFileName = file.last();
+ TQString resFileName = file.last();
file.remove(file.last());
uint i = 0;
while ( (i < dir.count()) && (i < (file.count())) && (dir[i] == file[i]) )
i++;
- QString result_up;
- QString result_down;
- QString currDir;
- QString currFile;
+ TQString result_up;
+ TQString result_down;
+ TQString currDir;
+ TQString currFile;
do
{
i >= dir.count() ? currDir = "" : currDir = dir[i];
@@ -282,9 +282,9 @@ QString URLUtil::relativePathToFile( const QString & dirUrl, const QString & fil
///////////////////////////////////////////////////////////////////////////////
//TODO: remove for KDE4
-QString URLUtil::canonicalPath( const QString & path )
+TQString URLUtil::canonicalPath( const TQString & path )
{
- QDir dir(path);
+ TQDir dir(path);
return dir.canonicalPath();
}
@@ -292,7 +292,7 @@ QString URLUtil::canonicalPath( const QString & path )
//written by "Dawit A." <adawit@kde.org>
//borrowed from his patch to KShell
-QString URLUtil::envExpand ( const QString& str )
+TQString URLUtil::envExpand ( const TQString& str )
{
uint len = str.length();
@@ -303,11 +303,11 @@ QString URLUtil::envExpand ( const QString& str )
if (pos < 0)
pos = len;
- char* ret = getenv( QConstString(str.unicode()+1, pos-1).string().local8Bit().data() );
+ char* ret = getenv( TQConstString(str.unicode()+1, pos-1).string().local8Bit().data() );
if (ret)
{
- QString expandedStr ( QFile::decodeName( ret ) );
+ TQString expandedStr ( TQFile::decodeName( ret ) );
if (pos < (int)len)
expandedStr += str.mid(pos);
return expandedStr;
diff --git a/lib/util/urlutil.h b/lib/util/urlutil.h
index 65e96a56..e8c84607 100644
--- a/lib/util/urlutil.h
+++ b/lib/util/urlutil.h
@@ -21,8 +21,8 @@
#ifndef _URLUTIL_H_
#define _URLUTIL_H_
-#include <qstring.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
#include <kurl.h>
/**
@@ -43,12 +43,12 @@ namespace URLUtil
* @return The filename part of a pathname (i.e. everything past the last slash).
* @param pathName The absolute path to a file.
*/
- QString filename(const QString & pathName);
+ TQString filename(const TQString & pathName);
/**
* @return The directory part of a path (i.e. everything up to but not including the last slash)
* @param pathName The absolute path to a directory.
*/
- QString directory(const QString & pathName);
+ TQString directory(const TQString & pathName);
/**
* @return The relative path between a parent and child URL, or blank if the specified
* child is not a child of parent.
@@ -59,7 +59,7 @@ namespace URLUtil
* if slashPolicy contains SLASH_SUFFIX.\n"/" is prepended to a result if
* slashPolicy contains SLASH_PREFIX.
*/
- QString relativePath(const KURL & parent, const KURL & child, uint slashPolicy = SLASH_PREFIX);
+ TQString relativePath(const KURL & parent, const KURL & child, uint slashPolicy = SLASH_PREFIX);
/**
* @return The relative path between a parent and child URL, or blank if the specified
* child is not a child of parent.
@@ -70,13 +70,13 @@ namespace URLUtil
* if slashPolicy contains SLASH_SUFFIX.\n"/" is prepended to a result if
* slashPolicy contains SLASH_PREFIX.
*/
- QString relativePath(const QString & parent, const QString & child, uint slashPolicy = SLASH_PREFIX);
+ TQString relativePath(const TQString & parent, const TQString & child, uint slashPolicy = SLASH_PREFIX);
/**
* @return The relative path between a base path and destination path or.
* @param base The base Path.
* @param dest The destination path.
*/
- QString getRelativePath( const QString& base, const QString& dest );
+ TQString getRelativePath( const TQString& base, const TQString& dest );
/**
* @param dirUrl An URL of a directory.
* @param fileUrl An URL of a file.
@@ -86,13 +86,13 @@ namespace URLUtil
* fileUrl: /home/test/lib/mylib.cpp
* returns: ../lib/mylib.cpp</pre>
*/
- QString relativePathToFile( const QString & dirUrl, const QString & fileUrl );
+ TQString relativePathToFile( const TQString & dirUrl, const TQString & fileUrl );
/**
*@param path A path (absolute or relative).
*@param slashSuffix if true then "/" is appended to a path.
*@returns The path 'up one level' - the opposite of what filename returns.
*/
- QString upDir(const QString & path, bool slashSuffix = false);
+ TQString upDir(const TQString & path, bool slashSuffix = false);
/**
* 'Merges' URLs - changes a URL that starts with dest to start with source instead.\n
* <pre>Example:
@@ -110,7 +110,7 @@ namespace URLUtil
* @return The file extension for a filename or path.
* @param path Absolute or relative path.
*/
- QString getExtension(const QString & path);
+ TQString getExtension(const TQString & path);
/**
* Given a base directory url in @p baseDirUrl and the url referring to the
@@ -120,8 +120,8 @@ namespace URLUtil
* KURL baseUrl, dirUrl;
* baseUrl.setPath( "/home/mario/src/kdevelop/" );
* dirUrl.setPath( "/home/mario/src/kdevelop/parts/cvs/" );
- * QString relPathName = extractDirPathRelative( baseUrl, url ); // == "parts/cvs/"
- * QString absPathName = extractDirPathAbsolute( url ); // == "/home/mario/src/kdevelop/parts/cvs/"
+ * TQString relPathName = extractDirPathRelative( baseUrl, url ); // == "parts/cvs/"
+ * TQString absPathName = extractDirPathAbsolute( url ); // == "/home/mario/src/kdevelop/parts/cvs/"
* @endcode
* Note that if you pass a file name in @p url (instead of a directory) or the
* @p baseUrl is not contained in @p url then the function will return "" (void string).
@@ -130,25 +130,25 @@ namespace URLUtil
* @param url Base directory URL.
* @return The relative path between @p url and @p baseDirUrl.
*/
- QString extractPathNameRelative(const KURL &baseDirUrl, const KURL &url );
- /**Same as above. @p basePath is QString.*/
- QString extractPathNameRelative(const QString &basePath, const KURL &url );
+ TQString extractPathNameRelative(const KURL &baseDirUrl, const KURL &url );
+ /**Same as above. @p basePath is TQString.*/
+ TQString extractPathNameRelative(const TQString &basePath, const KURL &url );
/**Same as above. Both @p basePath and @p absFilePath are QStrings.*/
- QString extractPathNameRelative(const QString &basePath, const QString &absFilePath );
+ TQString extractPathNameRelative(const TQString &basePath, const TQString &absFilePath );
/**
* @param url The url to extract the absolute path from.
* @return The absolute path name referred in @p url.
* Look at @ref extractPathNameRelative documentation for an example.
*/
- QString extractPathNameAbsolute( const KURL &url );
+ TQString extractPathNameAbsolute( const KURL &url );
/**
* @param baseDir Base directory for relative URLs.
* @param urls The list of urls to extract the relative paths from.
- * @return A QStringList of relative (to @p baseDir) paths from a list of KURLs in @p urls.
+ * @return A TQStringList of relative (to @p baseDir) paths from a list of KURLs in @p urls.
*/
- QStringList toRelativePaths( const QString &baseDir, const KURL::List &urls);
+ TQStringList toRelativePaths( const TQString &baseDir, const KURL::List &urls);
/**
* @param url The absolute URL.
@@ -159,7 +159,7 @@ namespace URLUtil
* @param absFilePath The absolute path.
* @return true if @p url is a directory, false otherwise.
*/
- bool isDirectory( const QString &absFilePath );
+ bool isDirectory( const TQString &absFilePath );
/**
* Dumps the list of KURL @p urls on standard output, eventually printing @p aMessage if it
@@ -167,14 +167,14 @@ namespace URLUtil
* @param urls URLs to dump.
* @param aMessage Message to be written onto a stdout.
*/
- void dump( const KURL::List &urls, const QString &aMessage = QString::null );
+ void dump( const KURL::List &urls, const TQString &aMessage = TQString::null );
/**
- * Same as QDir::canonicalPath in later versions of Qt. Earlier versions of Qt
+ * Same as TQDir::canonicalPath in later versions of Qt. Earlier versions of Qt
* had this broken, so it's reproduced here.
- * Deprecated, use QDir::canonicalPath instead.
+ * Deprecated, use TQDir::canonicalPath instead.
*/
- QString canonicalPath( const QString & path );
+ TQString canonicalPath( const TQString & path );
/**
* Performs environment variable expansion on @p variable.
@@ -183,7 +183,7 @@ namespace URLUtil
* @return The expanded environment variable value. if the variable
* cannot be expanded, @p variable itself is returned.
*/
- QString envExpand ( const QString &variable );
+ TQString envExpand ( const TQString &variable );
}