diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:22:56 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:22:56 +0000 |
commit | 7346aee26bf190a7e70333c40fab4caca847cd27 (patch) | |
tree | 4b019b434f88dcc3eeaafe1d3f26240b4c4718e8 /kate/snippets | |
parent | 23a3d3aa5b44cbdf305495919866d9dbf4f6da54 (diff) | |
download | tdeaddons-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/snippets')
-rw-r--r-- | kate/snippets/CWidgetSnippetsBase.ui.h | 4 | ||||
-rw-r--r-- | kate/snippets/csnippet.cpp | 4 | ||||
-rw-r--r-- | kate/snippets/csnippet.h | 26 | ||||
-rw-r--r-- | kate/snippets/cwidgetsnippets.cpp | 2 | ||||
-rw-r--r-- | kate/snippets/cwidgetsnippets.h | 2 | ||||
-rw-r--r-- | kate/snippets/plugin_katesnippets.cpp | 70 | ||||
-rw-r--r-- | kate/snippets/plugin_katesnippets.h | 28 |
7 files changed, 68 insertions, 68 deletions
diff --git a/kate/snippets/CWidgetSnippetsBase.ui.h b/kate/snippets/CWidgetSnippetsBase.ui.h index 816d7d8..539442a 100644 --- a/kate/snippets/CWidgetSnippetsBase.ui.h +++ b/kate/snippets/CWidgetSnippetsBase.ui.h @@ -15,9 +15,9 @@ void CWidgetSnippetsBase::init() } -QListViewItem* CWidgetSnippetsBase::insertItem( const QString& name, bool bRename ) +TQListViewItem* CWidgetSnippetsBase::insertItem( const TQString& name, bool bRename ) { - QListViewItem *item = new QListViewItem(lvSnippets, name); + TQListViewItem *item = new TQListViewItem(lvSnippets, name); item->setRenameEnabled(0,true); lvSnippets->setSelected( item, true ); if ( bRename ) { diff --git a/kate/snippets/csnippet.cpp b/kate/snippets/csnippet.cpp index fc7d7e7..2aebb5d 100644 --- a/kate/snippets/csnippet.cpp +++ b/kate/snippets/csnippet.cpp @@ -9,8 +9,8 @@ ***************************************************************************/ #include "csnippet.h" -CSnippet::CSnippet(QString sKey, QString sValue, QListViewItem *lvi, QObject *parent, const char *name) - : QObject(parent, name), _sKey(sKey), _sValue(sValue), _lvi(lvi) {} +CSnippet::CSnippet(TQString sKey, TQString sValue, TQListViewItem *lvi, TQObject *parent, const char *name) + : TQObject(parent, name), _sKey(sKey), _sValue(sValue), _lvi(lvi) {} CSnippet::~CSnippet() {} diff --git a/kate/snippets/csnippet.h b/kate/snippets/csnippet.h index a139f03..3c75db4 100644 --- a/kate/snippets/csnippet.h +++ b/kate/snippets/csnippet.h @@ -10,30 +10,30 @@ #ifndef CSNIPPET_H #define CSNIPPET_H -#include <qobject.h> -#include <qlistview.h> +#include <tqobject.h> +#include <tqlistview.h> #include <kaction.h> -#include <qsignalmapper.h> +#include <tqsignalmapper.h> /** @author Stephan Möres */ -class CSnippet : public QObject { +class CSnippet : public TQObject { Q_OBJECT public: - CSnippet(QString sKey, QString sValue, QListViewItem *lvi, QObject *parent = 0, const char *name = 0); + CSnippet(TQString sKey, TQString sValue, TQListViewItem *lvi, TQObject *parent = 0, const char *name = 0); ~CSnippet(); - QString getKey() { return _sKey; } - QString getValue() { return _sValue; } - QListViewItem* getListViewItem() const { return _lvi; } - void setKey(const QString& sKey) { _sKey = sKey; } - void setValue(const QString& sValue) { _sValue = sValue; } + TQString getKey() { return _sKey; } + TQString getValue() { return _sValue; } + TQListViewItem* getListViewItem() const { return _lvi; } + void setKey(const TQString& sKey) { _sKey = sKey; } + void setValue(const TQString& sValue) { _sValue = sValue; } protected: - QString _sKey; - QString _sValue; - QListViewItem *_lvi; + TQString _sKey; + TQString _sValue; + TQListViewItem *_lvi; }; #endif diff --git a/kate/snippets/cwidgetsnippets.cpp b/kate/snippets/cwidgetsnippets.cpp index cf44319..e58c15f 100644 --- a/kate/snippets/cwidgetsnippets.cpp +++ b/kate/snippets/cwidgetsnippets.cpp @@ -9,7 +9,7 @@ ***************************************************************************/ #include "cwidgetsnippets.h" -CWidgetSnippets::CWidgetSnippets( QWidget* parent, const char* name, WFlags fl) +CWidgetSnippets::CWidgetSnippets( TQWidget* parent, const char* name, WFlags fl) : CWidgetSnippetsBase(parent, name, fl) { } diff --git a/kate/snippets/cwidgetsnippets.h b/kate/snippets/cwidgetsnippets.h index 6d246c3..831f335 100644 --- a/kate/snippets/cwidgetsnippets.h +++ b/kate/snippets/cwidgetsnippets.h @@ -17,7 +17,7 @@ */ class CWidgetSnippets : public CWidgetSnippetsBase { public: - CWidgetSnippets( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + CWidgetSnippets( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~CWidgetSnippets(); diff --git a/kate/snippets/plugin_katesnippets.cpp b/kate/snippets/plugin_katesnippets.cpp index 07cba2b..fd594e1 100644 --- a/kate/snippets/plugin_katesnippets.cpp +++ b/kate/snippets/plugin_katesnippets.cpp @@ -23,7 +23,7 @@ K_EXPORT_COMPONENT_FACTORY(katesnippetsplugin, KGenericFactory<KatePluginSnippet * @param w * @return */ -KatePluginSnippetsView::KatePluginSnippetsView(Kate::MainWindow *w, QWidget *dock) : CWidgetSnippets(dock,"snippetswidget") +KatePluginSnippetsView::KatePluginSnippetsView(Kate::MainWindow *w, TQWidget *dock) : CWidgetSnippets(dock,"snippetswidget") , dock (dock) { setInstance (new KInstance("kate")); @@ -35,29 +35,29 @@ KatePluginSnippetsView::KatePluginSnippetsView(Kate::MainWindow *w, QWidget *doc //<make connections> connect ( - lvSnippets, SIGNAL( selectionChanged(QListViewItem *) ), - this, SLOT( slot_lvSnippetsSelectionChanged(QListViewItem *) ) + lvSnippets, TQT_SIGNAL( selectionChanged(TQListViewItem *) ), + this, TQT_SLOT( slot_lvSnippetsSelectionChanged(TQListViewItem *) ) ); connect ( - lvSnippets, SIGNAL( doubleClicked (QListViewItem *) ), - this, SLOT( slot_lvSnippetsClicked(QListViewItem *) ) + lvSnippets, TQT_SIGNAL( doubleClicked (TQListViewItem *) ), + this, TQT_SLOT( slot_lvSnippetsClicked(TQListViewItem *) ) ); connect ( - lvSnippets, SIGNAL( itemRenamed(QListViewItem *, int, const QString &) ), - this, SLOT( slot_lvSnippetsItemRenamed(QListViewItem *, int, const QString &) ) + lvSnippets, TQT_SIGNAL( itemRenamed(TQListViewItem *, int, const TQString &) ), + this, TQT_SLOT( slot_lvSnippetsItemRenamed(TQListViewItem *, int, const TQString &) ) ); connect ( - btnNew, SIGNAL( clicked () ), - this, SLOT( slot_btnNewClicked() ) + btnNew, TQT_SIGNAL( clicked () ), + this, TQT_SLOT( slot_btnNewClicked() ) ); connect ( - btnSave, SIGNAL( clicked () ), - this, SLOT( slot_btnSaveClicked() ) + btnSave, TQT_SIGNAL( clicked () ), + this, TQT_SLOT( slot_btnSaveClicked() ) ); connect ( - btnDelete, SIGNAL( clicked () ), - this, SLOT( slot_btnDeleteClicked() ) + btnDelete, TQT_SIGNAL( clicked () ), + this, TQT_SLOT( slot_btnDeleteClicked() ) ); //</make connections> @@ -99,7 +99,7 @@ KatePluginSnippetsView::~ KatePluginSnippetsView() { * @param name * @return */ -KatePluginSnippets::KatePluginSnippets( QObject* parent, const char* name, const QStringList& ) +KatePluginSnippets::KatePluginSnippets( TQObject* parent, const char* name, const TQStringList& ) : Kate::Plugin ( (Kate::Application*)parent, name ) {} /** @@ -114,7 +114,7 @@ KatePluginSnippets::~KatePluginSnippets() {} */ void KatePluginSnippets::addView(Kate::MainWindow *win) { - QWidget *dock = win->toolViewManager()->createToolView( + TQWidget *dock = win->toolViewManager()->createToolView( "kate_plugin_snippets", Kate::ToolViewManager::Left, SmallIcon("contents"), @@ -142,7 +142,7 @@ void KatePluginSnippets::removeView(Kate::MainWindow *win) { * * @param item */ -void KatePluginSnippetsView::slot_lvSnippetsSelectionChanged(QListViewItem * item) { +void KatePluginSnippetsView::slot_lvSnippetsSelectionChanged(TQListViewItem * item) { CSnippet *snippet; if ( (snippet = findSnippetByListViewItem(item))!= NULL ) { teSnippetText->setText(snippet->getValue()); @@ -155,14 +155,14 @@ void KatePluginSnippetsView::slot_lvSnippetsSelectionChanged(QListViewItem * it * Special meaning of <mark/> and <cursor/> ... * @param item */ -void KatePluginSnippetsView::slot_lvSnippetsClicked (QListViewItem * item) { +void KatePluginSnippetsView::slot_lvSnippetsClicked (TQListViewItem * item) { Kate::View *kv = win->viewManager()->activeView(); CSnippet *snippet; if (kv) { if ( (snippet = findSnippetByListViewItem(item))!= NULL ) { - QString sText = snippet->getValue(); - QString sSelection = ""; + TQString sText = snippet->getValue(); + TQString sSelection = ""; if ( kv->getDoc()->hasSelection() ) { sSelection = kv->getDoc()->selection(); @@ -170,9 +170,9 @@ void KatePluginSnippetsView::slot_lvSnippetsClicked (QListViewItem * item) { kv->keyDelete(); } - sText.replace( QRegExp("<mark/>"), sSelection ); - sText.replace( QRegExp("<date/>"), QDate::currentDate().toString(Qt::LocalDate) ); - sText.replace( QRegExp("<time/>"), QTime::currentTime().toString(Qt::LocalDate) ); + sText.replace( TQRegExp("<mark/>"), sSelection ); + sText.replace( TQRegExp("<date/>"), TQDate::currentDate().toString(Qt::LocalDate) ); + sText.replace( TQRegExp("<time/>"), TQTime::currentTime().toString(Qt::LocalDate) ); kv->insertText ( sText ); } kv->setFocus(); @@ -186,7 +186,7 @@ void KatePluginSnippetsView::slot_lvSnippetsClicked (QListViewItem * item) { * @param * @param text */ -void KatePluginSnippetsView::slot_lvSnippetsItemRenamed(QListViewItem *lvi,int /*col*/, const QString& text) { +void KatePluginSnippetsView::slot_lvSnippetsItemRenamed(TQListViewItem *lvi,int /*col*/, const TQString& text) { CSnippet *snippet; if ( (snippet = findSnippetByListViewItem(lvi)) != NULL ) { snippet->setKey( text ); @@ -199,10 +199,10 @@ void KatePluginSnippetsView::slot_lvSnippetsItemRenamed(QListViewItem *lvi,int / * */ void KatePluginSnippetsView::slot_btnNewClicked() { - QString sKey = "New Snippet"; - QString sValue = ""; + TQString sKey = "New Snippet"; + TQString sValue = ""; - QListViewItem *lvi = insertItem(sKey, true); + TQListViewItem *lvi = insertItem(sKey, true); lSnippets.append( new CSnippet(sKey, sValue, lvi) ); } @@ -212,7 +212,7 @@ void KatePluginSnippetsView::slot_btnNewClicked() { */ void KatePluginSnippetsView::slot_btnSaveClicked() { CSnippet *snippet; - QListViewItem *lvi = lvSnippets->selectedItem(); + TQListViewItem *lvi = lvSnippets->selectedItem(); if ( (snippet = findSnippetByListViewItem(lvi)) != NULL ) { snippet->setValue(teSnippetText->text() ); writeConfig(); @@ -225,7 +225,7 @@ void KatePluginSnippetsView::slot_btnSaveClicked() { */ void KatePluginSnippetsView::slot_btnDeleteClicked() { CSnippet *snippet; - QListViewItem *lvi = lvSnippets->selectedItem(); + TQListViewItem *lvi = lvSnippets->selectedItem(); if ( (snippet = findSnippetByListViewItem(lvi)) != NULL ) { @@ -239,15 +239,15 @@ void KatePluginSnippetsView::slot_btnDeleteClicked() { * */ void KatePluginSnippetsView::readConfig() { - QString sKey, sValue; - QListViewItem *lvi; + TQString sKey, sValue; + TQListViewItem *lvi; config->setGroup("Snippets"); int iNrOfSnippets = config->readEntry("NumberOfSnippets", "0").toInt() ; for (int i=0; i < iNrOfSnippets; i++) { - QStringList slFields; - slFields = config->readListEntry ( QString::number(i) ); + TQStringList slFields; + slFields = config->readListEntry ( TQString::number(i) ); sKey = slFields[0]; sValue = slFields[1]; @@ -288,11 +288,11 @@ void KatePluginSnippetsView::writeConfig() { CSnippet *snippet; for ( snippet = lSnippets.first(); snippet; snippet = lSnippets.next() ) { - QStringList slFields; + TQStringList slFields; slFields.append( snippet->getKey() ); slFields.append( snippet->getValue() ); - config->writeEntry ( QString::number(i), slFields, ',' ); + config->writeEntry ( TQString::number(i), slFields, ',' ); i++; } // sync to disc ... @@ -305,7 +305,7 @@ void KatePluginSnippetsView::writeConfig() { * @param item * @return */ -CSnippet* KatePluginSnippetsView::findSnippetByListViewItem(QListViewItem *item) { +CSnippet* KatePluginSnippetsView::findSnippetByListViewItem(TQListViewItem *item) { CSnippet *snippet = NULL; for ( snippet = lSnippets.first(); snippet; snippet = lSnippets.next() ) { if ( snippet->getListViewItem() == item) diff --git a/kate/snippets/plugin_katesnippets.h b/kate/snippets/plugin_katesnippets.h index 9a940e5..aac5049 100644 --- a/kate/snippets/plugin_katesnippets.h +++ b/kate/snippets/plugin_katesnippets.h @@ -17,12 +17,12 @@ #include <kate/toolviewmanager.h> -#include <qlistview.h> -#include <qregexp.h> +#include <tqlistview.h> +#include <tqregexp.h> #include <kconfig.h> -#include <qptrlist.h> -#include <qtoolbutton.h> -#include <qtextedit.h> +#include <tqptrlist.h> +#include <tqtoolbutton.h> +#include <tqtextedit.h> #include <kiconloader.h> #include "csnippet.h" @@ -35,14 +35,14 @@ class KatePluginSnippetsView : public CWidgetSnippets, public KXMLGUIClient { friend class KatePluginSnippets; public: - KatePluginSnippetsView (Kate::MainWindow *w, QWidget *dock); + KatePluginSnippetsView (Kate::MainWindow *w, TQWidget *dock); virtual ~KatePluginSnippetsView (); - CSnippet* findSnippetByListViewItem(QListViewItem *item); + CSnippet* findSnippetByListViewItem(TQListViewItem *item); public slots: - void slot_lvSnippetsSelectionChanged(QListViewItem * item); - void slot_lvSnippetsClicked (QListViewItem * item); - void slot_lvSnippetsItemRenamed(QListViewItem *lvi,int col, const QString& text); + void slot_lvSnippetsSelectionChanged(TQListViewItem * item); + void slot_lvSnippetsClicked (TQListViewItem * item); + void slot_lvSnippetsItemRenamed(TQListViewItem *lvi,int col, const TQString& text); void slot_btnNewClicked(); void slot_btnSaveClicked(); void slot_btnDeleteClicked(); @@ -53,25 +53,25 @@ protected: private: KConfig *config; - QPtrList<CSnippet> lSnippets; + TQPtrList<CSnippet> lSnippets; public: Kate::MainWindow *win; - QWidget *dock; + TQWidget *dock; }; class KatePluginSnippets : public Kate::Plugin, Kate::PluginViewInterface { Q_OBJECT public: - KatePluginSnippets( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() ); + KatePluginSnippets( TQObject* parent = 0, const char* name = 0, const TQStringList& = TQStringList() ); virtual ~KatePluginSnippets(); void addView (Kate::MainWindow *win); void removeView (Kate::MainWindow *win); private: - QPtrList<class KatePluginSnippetsView> m_views; + TQPtrList<class KatePluginSnippetsView> m_views; }; |