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/plugin_katesnippets.cpp | |
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/plugin_katesnippets.cpp')
-rw-r--r-- | kate/snippets/plugin_katesnippets.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
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) |