summaryrefslogtreecommitdiffstats
path: root/kate/kpybrowser
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:22:56 +0000
commit7346aee26bf190a7e70333c40fab4caca847cd27 (patch)
tree4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /kate/kpybrowser
parent23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff)
downloadtdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.tar.gz
tdeaddons-7346aee26bf190a7e70333c40fab4caca847cd27.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/kpybrowser')
-rw-r--r--kate/kpybrowser/kpybrowser.cpp72
-rw-r--r--kate/kpybrowser/kpybrowser.h24
-rw-r--r--kate/kpybrowser/pybrowse_part.cpp18
-rw-r--r--kate/kpybrowser/pybrowse_part.h12
-rw-r--r--kate/kpybrowser/pybrowsenode.cpp28
-rw-r--r--kate/kpybrowser/pybrowsenode.h36
6 files changed, 95 insertions, 95 deletions
diff --git a/kate/kpybrowser/kpybrowser.cpp b/kate/kpybrowser/kpybrowser.cpp
index 9023e65..183e1e7 100644
--- a/kate/kpybrowser/kpybrowser.cpp
+++ b/kate/kpybrowser/kpybrowser.cpp
@@ -16,10 +16,10 @@
***************************************************************************/
#include "kpybrowser.h"
-#include <qheader.h>
+#include <tqheader.h>
#include <kmessagebox.h>
#include <klocale.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include "kpybrowser.moc"
@@ -165,7 +165,7 @@ static const char *container_xpm[] = {
};
void
-getOpenNodes (QValueList < QString > *open_nodes, PyBrowseNode * node)
+getOpenNodes (TQValueList < TQString > *open_nodes, PyBrowseNode * node)
{
if (node == NULL)
return;
@@ -181,23 +181,23 @@ getOpenNodes (QValueList < QString > *open_nodes, PyBrowseNode * node)
}
-KPyBrowser::KPyBrowser (QWidget * parent, const char *name):
+KPyBrowser::KPyBrowser (TQWidget * parent, const char *name):
KListView (parent, name)
{
addColumn(i18n("Name"));
header ()->hide ();
class_root =
- new PyBrowseNode (this, QString ("Classes"), i18n("Classes"),
+ new PyBrowseNode (this, TQString ("Classes"), i18n("Classes"),
PYOTHER);
- class_root->setPixmap (0, QPixmap (container_xpm));
+ class_root->setPixmap (0, TQPixmap (container_xpm));
function_root =
- new PyBrowseNode (this, QString ("Globals"), i18n("Globals"),
+ new PyBrowseNode (this, TQString ("Globals"), i18n("Globals"),
PYOTHER);
- function_root->setPixmap (0, QPixmap (container_xpm));
+ function_root->setPixmap (0, TQPixmap (container_xpm));
setRootIsDecorated (1);
- connect (this, SIGNAL (executed (QListViewItem *)), this,
- SLOT (nodeSelected (QListViewItem *)));
+ connect (this, TQT_SIGNAL (executed (TQListViewItem *)), this,
+ TQT_SLOT (nodeSelected (TQListViewItem *)));
setTooltipColumn (1);
setShowToolTips (1);
tooltip = new KPBToolTip (this);
@@ -208,7 +208,7 @@ KPyBrowser::~KPyBrowser ()
}
void
-KPyBrowser::nodeSelected (QListViewItem * node)
+KPyBrowser::nodeSelected (TQListViewItem * node)
{
PyBrowseNode *browse_node = dynamic_cast < PyBrowseNode * >(node);
@@ -217,41 +217,41 @@ KPyBrowser::nodeSelected (QListViewItem * node)
return;
}
- QString method_name;
+ TQString method_name;
int line_no;
line_no = browse_node->getLine();
method_name = browse_node->getName();
if (browse_node->getType () == PYCLASS)
{
- method_name = QString ("class ") + browse_node->getName ();
+ method_name = TQString ("class ") + browse_node->getName ();
}
else if (browse_node->getType () == PYMETHOD
|| browse_node->getType () == PYFUNCTION)
{
- method_name = QString ("def ") + browse_node->getName ();
+ method_name = TQString ("def ") + browse_node->getName ();
}
emit selected(method_name, line_no);
}
void
-KPyBrowser::parseText (QString & pytext)
+KPyBrowser::parseText (TQString & pytext)
{
- QRegExp class_rx (QString ("^class [a-zA-Z0-9_,\\s\\(\\).]+:"));
- QRegExp function_rx (QString ("^def [a-zA-Z_]+[^#]*:"));
- QRegExp method_rx (QString ("[\\s]+def [a-zA-Z_]+[^#]*:"));
+ TQRegExp class_rx (TQString ("^class [a-zA-Z0-9_,\\s\\(\\).]+:"));
+ TQRegExp function_rx (TQString ("^def [a-zA-Z_]+[^#]*:"));
+ TQRegExp method_rx (TQString ("[\\s]+def [a-zA-Z_]+[^#]*:"));
int paren_i;
- QStringList lines = QStringList::split ("\n", pytext, TRUE);
- QStringList::Iterator iter;
- QString *line;
- QString class_name, method_name, function_name, class_sig, method_sig,
+ TQStringList lines = TQStringList::split ("\n", pytext, TRUE);
+ TQStringList::Iterator iter;
+ TQString *line;
+ TQString class_name, method_name, function_name, class_sig, method_sig,
function_sig;
PyBrowseNode *last_class_node = NULL;
PyBrowseNode *last_method_node = NULL;
PyBrowseNode *last_function_node = NULL;
- QValueList < QString > open_nodes;
+ TQValueList < TQString > open_nodes;
getOpenNodes (&open_nodes, class_root);
getOpenNodes (&open_nodes, function_root);
@@ -267,13 +267,13 @@ KPyBrowser::parseText (QString & pytext)
delete function_root;
}
class_root =
- new PyBrowseNode (this, QString ("Classes"), i18n("Classes"),
+ new PyBrowseNode (this, TQString ("Classes"), i18n("Classes"),
PYOTHER);
- class_root->setPixmap (0, QPixmap (container_xpm));
+ class_root->setPixmap (0, TQPixmap (container_xpm));
function_root =
- new PyBrowseNode (this, QString ("Globals"), i18n("Globals"),
+ new PyBrowseNode (this, TQString ("Globals"), i18n("Globals"),
PYOTHER);
- function_root->setPixmap (0, QPixmap (container_xpm));
+ function_root->setPixmap (0, TQPixmap (container_xpm));
node_dict.insert (class_root->getQualifiedName (), class_root);
node_dict.insert (function_root->getQualifiedName (), function_root);
@@ -286,7 +286,7 @@ KPyBrowser::parseText (QString & pytext)
line = &(*iter);
if (class_rx.search(*line) >= 0)
{
- //KMessageBox::information(this, *line, QString("Found class on line %1").arg(line_no));
+ //KMessageBox::information(this, *line, TQString("Found class on line %1").arg(line_no));
//strip out the beginning class and ending colon
class_sig = line->stripWhiteSpace ().mid (6);
class_sig = class_sig.left (class_sig.length () - 1);
@@ -318,7 +318,7 @@ KPyBrowser::parseText (QString & pytext)
}
if ((function_rx.search(*line) >= 0))
{
- //KMessageBox::information(this, *line, QString("Found function on line %1").arg(line_no));
+ //KMessageBox::information(this, *line, TQString("Found function on line %1").arg(line_no));
function_sig = line->stripWhiteSpace ().mid (4);
function_sig = function_sig.left (function_sig.find (":"));
paren_i = function_sig.find ("(");
@@ -336,7 +336,7 @@ KPyBrowser::parseText (QString & pytext)
//now go through the list of old open nodes and open them in the new
//tree. For each node name in the open_nodes list, attempt to find that
//node and in the new dict and open it.
- QValueList<QString>::iterator it;
+ TQValueList<TQString>::iterator it;
PyBrowseNode *tmp_node;
for (it=open_nodes.begin(); it != open_nodes.end(); ++it)
{
@@ -351,9 +351,9 @@ KPyBrowser::parseText (QString & pytext)
void
-KPyBrowser::tip (const QPoint & p, QRect & r, QString & str)
+KPyBrowser::tip (const TQPoint & p, TQRect & r, TQString & str)
{
- QListViewItem *item = (QListViewItem *) itemAt (p);
+ TQListViewItem *item = (TQListViewItem *) itemAt (p);
if (item == NULL)
{
str = "";
@@ -380,15 +380,15 @@ KPyBrowser::tip (const QPoint & p, QRect & r, QString & str)
/////////////////////////////////////////////////////////////////////
// KateFileList::KFLToolTip implementation
-KPyBrowser::KPBToolTip::KPBToolTip (QWidget * parent):QToolTip (parent)
+KPyBrowser::KPBToolTip::KPBToolTip (TQWidget * parent):TQToolTip (parent)
{
}
void
-KPyBrowser::KPBToolTip::maybeTip (const QPoint & p)
+KPyBrowser::KPBToolTip::maybeTip (const TQPoint & p)
{
- QString str;
- QRect r;
+ TQString str;
+ TQRect r;
((KPyBrowser *) parentWidget ())->tip (p, r, str);
diff --git a/kate/kpybrowser/kpybrowser.h b/kate/kpybrowser/kpybrowser.h
index ae49d3c..5f73c31 100644
--- a/kate/kpybrowser/kpybrowser.h
+++ b/kate/kpybrowser/kpybrowser.h
@@ -24,10 +24,10 @@
#include <kapplication.h>
#include <klistview.h>
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qtooltip.h>
-#include <qdict.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqtooltip.h>
+#include <tqdict.h>
#include "pybrowsenode.h"
@@ -37,31 +37,31 @@ class KPyBrowser : public KListView
Q_OBJECT
public:
/** construtor */
- KPyBrowser(QWidget* parent=0, const char *name=0);
+ KPyBrowser(TQWidget* parent=0, const char *name=0);
/** destructor */
~KPyBrowser();
- void parseText(QString &pytext);
+ void parseText(TQString &pytext);
//used by KPBToolTip to dynamically create the needed tooltip
- void tip (const QPoint &p, QRect &r, QString &str);
+ void tip (const TQPoint &p, TQRect &r, TQString &str);
private:
PyBrowseNode *class_root, *function_root;
//create a mapping of names to nodes
- QDict<PyBrowseNode> node_dict;
+ TQDict<PyBrowseNode> node_dict;
public slots:
- void nodeSelected(QListViewItem *node);
+ void nodeSelected(TQListViewItem *node);
signals:
- void selected(QString, int);
+ void selected(TQString, int);
private:
class KPBToolTip : public QToolTip
{
public:
- KPBToolTip(QWidget *parent);
+ KPBToolTip(TQWidget *parent);
protected:
- void maybeTip( const QPoint & );
+ void maybeTip( const TQPoint & );
};
KPBToolTip* tooltip;
};
diff --git a/kate/kpybrowser/pybrowse_part.cpp b/kate/kpybrowser/pybrowse_part.cpp
index d8b7551..4b8490c 100644
--- a/kate/kpybrowser/pybrowse_part.cpp
+++ b/kate/kpybrowser/pybrowse_part.cpp
@@ -25,7 +25,7 @@
#include <klocale.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
-#include <qimage.h>
+#include <tqimage.h>
#include <kdockwidget.h>
K_EXPORT_COMPONENT_FACTORY( katepybrowseplugin, KGenericFactory<KatePluginPyBrowse>( "katepybrowse" ) )
@@ -34,7 +34,7 @@ PluginViewPyBrowse::PluginViewPyBrowse (Kate::MainWindow *w)
: win (w)
{
(void) new KAction ( i18n("Update Python Browser"), 0, this,
- SLOT( slotUpdatePyBrowser() ), actionCollection(),
+ TQT_SLOT( slotUpdatePyBrowser() ), actionCollection(),
"python_update_pybrowse" );
//set up the menus
@@ -43,8 +43,8 @@ PluginViewPyBrowse::PluginViewPyBrowse (Kate::MainWindow *w)
win->guiFactory()->addClient(this);
//create a python head pixmap for the tab
- QPixmap *py_pixmap = new QPixmap(pybrowse_xpm);
- QImage py_image = py_pixmap->convertToImage().smoothScale(20, 20);
+ TQPixmap *py_pixmap = new TQPixmap(pybrowse_xpm);
+ TQImage py_image = py_pixmap->convertToImage().smoothScale(20, 20);
py_pixmap->convertFromImage(py_image);
//create the browser and put it into a dockwidget using kate's tool view manager
@@ -53,7 +53,7 @@ PluginViewPyBrowse::PluginViewPyBrowse (Kate::MainWindow *w)
my_dock = tool_view_manager->createToolView("kate_plugin_kpybrowser", Kate::ToolViewManager::Left, (*py_pixmap), i18n("Python Browser"));
kpybrowser = new KPyBrowser(my_dock, "kpybrowser");
- connect(kpybrowser, SIGNAL(selected(QString, int)), this, SLOT(slotSelected(QString, int)));
+ connect(kpybrowser, TQT_SIGNAL(selected(TQString, int)), this, TQT_SLOT(slotSelected(TQString, int)));
}
PluginViewPyBrowse::~PluginViewPyBrowse ()
@@ -63,7 +63,7 @@ PluginViewPyBrowse::~PluginViewPyBrowse ()
}
-void PluginViewPyBrowse::slotSelected(QString name, int line)
+void PluginViewPyBrowse::slotSelected(TQString name, int line)
{
//TO DO - deal with setting the active view to be the file that has this class
//if multiple files are open.
@@ -74,7 +74,7 @@ void PluginViewPyBrowse::slotSelected(QString name, int line)
Kate::View *view = win->viewManager()->activeView();
Kate::Document *doc = view->getDoc();
- QString docline = doc->textLine(line);
+ TQString docline = doc->textLine(line);
int numlines = doc->numLines();
int done = 0, apiline = -1, forward_line = line,backward_line = line-1;
while (!done)
@@ -121,7 +121,7 @@ void PluginViewPyBrowse::slotUpdatePyBrowser()
Kate::View *view = viewManager->activeView();
if (view == NULL)
return;
- QString pytext(view->getDoc()->text());
+ TQString pytext(view->getDoc()->text());
kpybrowser->parseText(pytext);
}
@@ -130,7 +130,7 @@ void PluginViewPyBrowse::slotShowPyBrowser()
//TO DO implement this later so that you can turn the browser off and on
}
-KatePluginPyBrowse::KatePluginPyBrowse( QObject* parent, const char* name, const QStringList& )
+KatePluginPyBrowse::KatePluginPyBrowse( TQObject* parent, const char* name, const TQStringList& )
: Kate::Plugin ( (Kate::Application *)parent, name )
{
}
diff --git a/kate/kpybrowser/pybrowse_part.h b/kate/kpybrowser/pybrowse_part.h
index 85aedbb..3769661 100644
--- a/kate/kpybrowser/pybrowse_part.h
+++ b/kate/kpybrowser/pybrowse_part.h
@@ -30,10 +30,10 @@
#include <kdockwidget.h>
#include <klibloader.h>
#include <klocale.h>
-#include <qstring.h>
+#include <tqstring.h>
#include "kpybrowser.h"
-class PluginViewPyBrowse : public QObject, KXMLGUIClient
+class PluginViewPyBrowse : public TQObject, KXMLGUIClient
{
Q_OBJECT
@@ -45,12 +45,12 @@ class PluginViewPyBrowse : public QObject, KXMLGUIClient
public slots:
void slotShowPyBrowser();
- void slotSelected(QString name, int line);
+ void slotSelected(TQString name, int line);
void slotUpdatePyBrowser();
private:
Kate::MainWindow *win;
- QWidget *my_dock;
+ TQWidget *my_dock;
KPyBrowser *kpybrowser;
};
@@ -59,14 +59,14 @@ class KatePluginPyBrowse : public Kate::Plugin, public Kate::PluginViewInterface
Q_OBJECT
public:
- KatePluginPyBrowse( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() );
+ KatePluginPyBrowse( TQObject* parent = 0, const char* name = 0, const TQStringList& = TQStringList() );
~KatePluginPyBrowse();
void addView(Kate::MainWindow *win);
void removeView(Kate::MainWindow *win);
private:
- QPtrList<PluginViewPyBrowse> m_views;
+ TQPtrList<PluginViewPyBrowse> m_views;
};
#endif
diff --git a/kate/kpybrowser/pybrowsenode.cpp b/kate/kpybrowser/pybrowsenode.cpp
index 866924b..81c59e5 100644
--- a/kate/kpybrowser/pybrowsenode.cpp
+++ b/kate/kpybrowser/pybrowsenode.cpp
@@ -99,30 +99,30 @@ static const char *py_function_xpm[] = {
};
-PyBrowseNode::PyBrowseNode (QListViewItem * parent, const QString &name,
- const QString &signature, int nodeType):
-QListViewItem (parent, signature)
+PyBrowseNode::PyBrowseNode (TQListViewItem * parent, const TQString &name,
+ const TQString &signature, int nodeType):
+TQListViewItem (parent, signature)
{
init (name, signature, nodeType);
}
-PyBrowseNode::PyBrowseNode (QListView * parent, const QString &name,
- const QString &signature, int nodeType):
-QListViewItem (parent, signature)
+PyBrowseNode::PyBrowseNode (TQListView * parent, const TQString &name,
+ const TQString &signature, int nodeType):
+TQListViewItem (parent, signature)
{
init (name, signature, nodeType);
}
void
-PyBrowseNode::init (const QString &a_name, const QString &a_signature, int nodeType)
+PyBrowseNode::init (const TQString &a_name, const TQString &a_signature, int nodeType)
{
node_type = nodeType;
if (nodeType == PYCLASS)
- setPixmap (0, QPixmap (py_class_xpm));
+ setPixmap (0, TQPixmap (py_class_xpm));
if (nodeType == PYMETHOD)
- setPixmap (0, QPixmap (py_method_xpm));
+ setPixmap (0, TQPixmap (py_method_xpm));
if (nodeType == PYFUNCTION)
- setPixmap (0, QPixmap (py_function_xpm));
+ setPixmap (0, TQPixmap (py_function_xpm));
name = a_name;
signature = a_signature;
@@ -130,11 +130,11 @@ PyBrowseNode::init (const QString &a_name, const QString &a_signature, int nodeT
PyBrowseNode::~PyBrowseNode ()
{
- setPixmap (0, QPixmap (py_class_xpm));
+ setPixmap (0, TQPixmap (py_class_xpm));
}
void
-PyBrowseNode::setName (const QString &a_name)
+PyBrowseNode::setName (const TQString &a_name)
{
name = a_name;
setText (0, name);
@@ -147,7 +147,7 @@ PyBrowseNode::getName ()const
}
void
-PyBrowseNode::setSig (const QString &a_signature)
+PyBrowseNode::setSig (const TQString &a_signature)
{
signature = a_signature;
@@ -185,7 +185,7 @@ PyBrowseNode::getType ()const
}
void
-PyBrowseNode::setClass (const QString &a_method_class)
+PyBrowseNode::setClass (const TQString &a_method_class)
{
node_class = a_method_class;
}
diff --git a/kate/kpybrowser/pybrowsenode.h b/kate/kpybrowser/pybrowsenode.h
index d5083f9..d87a81d 100644
--- a/kate/kpybrowser/pybrowsenode.h
+++ b/kate/kpybrowser/pybrowsenode.h
@@ -18,11 +18,11 @@
#ifndef PYBROWSENODE_H
#define PYBROWSENODE_H
-#include <qlistview.h>
-#include <qpixmap.h>
+#include <tqlistview.h>
+#include <tqpixmap.h>
#define PYCLASS 1
-#define PYMETHOD 2
+#define PYQT_METHOD 2
#define PYFUNCTION 3
#define PYVARIABLE 4
#define PYOTHER 5
@@ -33,33 +33,33 @@
-class PyBrowseNode : public QListViewItem {
+class PyBrowseNode : public TQListViewItem {
public:
- QPixmap *pyClassPixmap;
+ TQPixmap *pyClassPixmap;
- PyBrowseNode(QListView *parent, const QString &a_name, const QString &a_signature, int type);
- PyBrowseNode(QListViewItem *parent, const QString &a_name, const QString &a_signature, int type);
+ PyBrowseNode(TQListView *parent, const TQString &a_name, const TQString &a_signature, int type);
+ PyBrowseNode(TQListViewItem *parent, const TQString &a_name, const TQString &a_signature, int type);
~PyBrowseNode();
- void init(const QString &a_name, const QString &a_signature, int nodeType);
+ void init(const TQString &a_name, const TQString &a_signature, int nodeType);
- void setName(const QString &name);
- QString getName()const ;
+ void setName(const TQString &name);
+ TQString getName()const ;
void setLine(int line);
int getLine()const;
- void setSig(const QString &signature);
- QString getSig()const;
+ void setSig(const TQString &signature);
+ TQString getSig()const;
void setType(int type);
int getType()const;
- void setClass(const QString &a_method_class);
- QString getClass()const;
+ void setClass(const TQString &a_method_class);
+ TQString getClass()const;
- QString getQualifiedName()const;
+ TQString getQualifiedName()const;
private:
- QString name;
- QString signature;
- QString node_class;
+ TQString name;
+ TQString signature;
+ TQString node_class;
int line;
int node_type;