summaryrefslogtreecommitdiffstats
path: root/kate/snippets/plugin_katesnippets.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kate/snippets/plugin_katesnippets.cpp')
-rw-r--r--kate/snippets/plugin_katesnippets.cpp70
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)