summaryrefslogtreecommitdiffstats
path: root/parts/snippet
diff options
context:
space:
mode:
Diffstat (limited to 'parts/snippet')
-rw-r--r--parts/snippet/snippet_part.cpp40
-rw-r--r--parts/snippet/snippet_part.h10
-rw-r--r--parts/snippet/snippet_widget.cpp292
-rw-r--r--parts/snippet/snippet_widget.h34
-rw-r--r--parts/snippet/snippetconfig.h26
-rw-r--r--parts/snippet/snippetitem.cpp28
-rw-r--r--parts/snippet/snippetitem.h32
-rw-r--r--parts/snippet/snippetsettings.cpp10
-rw-r--r--parts/snippet/snippetsettings.h4
9 files changed, 238 insertions, 238 deletions
diff --git a/parts/snippet/snippet_part.cpp b/parts/snippet/snippet_part.cpp
index f7564109..eb1c47ac 100644
--- a/parts/snippet/snippet_part.cpp
+++ b/parts/snippet/snippet_part.cpp
@@ -7,17 +7,17 @@
*/
#include "snippet_part.h"
-#include <qwhatsthis.h>
+#include <tqwhatsthis.h>
#include <kaction.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kaboutdata.h>
-#include <qvbox.h>
+#include <tqvbox.h>
#include <kdialogbase.h>
#include <klineedit.h>
-#include <qcheckbox.h>
-#include <qbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqbuttongroup.h>
#include <ktrader.h>
#include "kdevcore.h"
@@ -37,7 +37,7 @@ static const KDevPluginInfo data("kdevsnippet");
typedef KDevGenericFactory<SnippetPart> snippetFactory;
K_EXPORT_COMPONENT_FACTORY( libkdevsnippet, snippetFactory( data ) )
-SnippetPart::SnippetPart(QObject *parent, const char *name, const QStringList& )
+SnippetPart::SnippetPart(TQObject *parent, const char *name, const TQStringList& )
: KDevPlugin(&data, parent, name ? name : "SnippetPart" )
{
setInstance(snippetFactory::instance());
@@ -47,16 +47,16 @@ SnippetPart::SnippetPart(QObject *parent, const char *name, const QStringList& )
m_widget->setCaption(i18n("Code Snippets"));
m_widget->setIcon(SmallIcon( info()->icon() ));
- QWhatsThis::add(m_widget, i18n("<b>Code Snippet</b><p>This is a list of available snippets."));
+ TQWhatsThis::add(m_widget, i18n("<b>Code Snippet</b><p>This is a list of available snippets."));
mainWindow()->embedSelectViewRight( m_widget, i18n("Code Snippets"), i18n("Insert a code snippet") );
- connect( core(), SIGNAL( configWidget( KDialogBase * ) ), this, SLOT( slotConfigWidget( KDialogBase * ) ) );
+ connect( core(), TQT_SIGNAL( configWidget( KDialogBase * ) ), this, TQT_SLOT( slotConfigWidget( KDialogBase * ) ) );
/*The next two connects are used to check if certain SnippetGroups need to be opened
according to the languages supported by this project*/
- connect( core(), SIGNAL( projectOpened() ), m_widget, SLOT( languageChanged() ) );
- connect( core(), SIGNAL( languageChanged() ), m_widget, SLOT( languageChanged() ) );
+ connect( core(), TQT_SIGNAL( projectOpened() ), m_widget, TQT_SLOT( languageChanged() ) );
+ connect( core(), TQT_SIGNAL( languageChanged() ), m_widget, TQT_SLOT( languageChanged() ) );
setupActions();
}
@@ -73,7 +73,7 @@ SnippetPart::~SnippetPart()
void SnippetPart::setupActions()
{
- new KAction( i18n("Show Snippet Tree"), CTRL+ALT+SHIFT+Key_S, this, SLOT(slotShowView()), actionCollection(), "snippet_showview");
+ new KAction( i18n("Show Snippet Tree"), CTRL+ALT+SHIFT+Key_S, this, TQT_SLOT(slotShowView()), actionCollection(), "snippet_showview");
}
/*!
@@ -97,7 +97,7 @@ KAboutData* SnippetPart::aboutData()
*/
void SnippetPart::slotConfigWidget( KDialogBase *dlg )
{
- QVBox *vbox = dlg->addVBoxPage( i18n("Code Snippets"), i18n("Code Snippets"), BarIcon( info()->icon(), KIcon::SizeMedium ) );
+ TQVBox *vbox = dlg->addVBoxPage( i18n("Code Snippets"), i18n("Code Snippets"), BarIcon( info()->icon(), KIcon::SizeMedium ) );
SnippetSettings * w = new SnippetSettings( m_widget, vbox );
@@ -105,22 +105,22 @@ void SnippetPart::slotConfigWidget( KDialogBase *dlg )
w->leDelimiter->setText(m_widget->getSnippetConfig()->getDelimiter());
w->cbToolTip->setChecked(m_widget->getSnippetConfig()->useToolTips());
w->btnGroupAutoOpen->setButton(m_widget->getSnippetConfig()->getAutoOpenGroups());
- connect( dlg, SIGNAL(okClicked()), w, SLOT(slotOKClicked()) );
+ connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(slotOKClicked()) );
}
-QStringList SnippetPart::getAllLanguages()
+TQStringList SnippetPart::getAllLanguages()
{
KTrader::OfferList languageSupportOffers =
- KTrader::self()->query(QString::fromLatin1("KDevelop/LanguageSupport"),
- QString::fromLatin1("[X-KDevelop-Version] == %1"
+ KTrader::self()->query(TQString::fromLatin1("KDevelop/LanguageSupport"),
+ TQString::fromLatin1("[X-KDevelop-Version] == %1"
).arg( KDEVELOP_PLUGIN_VERSION ));
- QStringList languages;
+ TQStringList languages;
for (KTrader::OfferList::ConstIterator it = languageSupportOffers.begin(); it != languageSupportOffers.end(); ++it)
{
- QString language = (*it)->property("X-KDevelop-Language").toString();
+ TQString language = (*it)->property("X-KDevelop-Language").toString();
languages.append(language);
kdDebug(9035) << "Found language: " << (*it)->property("X-KDevelop-Language").toString() << endl <<
@@ -132,13 +132,13 @@ QStringList SnippetPart::getAllLanguages()
}
-QStringList SnippetPart::getProjectLanguages()
+TQStringList SnippetPart::getProjectLanguages()
{
- QStringList languages;
+ TQStringList languages;
if (!projectDom())
return languages;
- QDomDocument m_projectDom = *projectDom();
+ TQDomDocument m_projectDom = *projectDom();
if (m_widget->getSnippetConfig()->getAutoOpenGroups() == 1)
languages = DomUtil::readListEntry(m_projectDom, "/general/secondaryLanguages", "language");
diff --git a/parts/snippet/snippet_part.h b/parts/snippet/snippet_part.h
index 98c3b252..c62950fc 100644
--- a/parts/snippet/snippet_part.h
+++ b/parts/snippet/snippet_part.h
@@ -11,7 +11,7 @@
#define __KDEVPART_SNIPPET_H__
-#include <qguardedptr.h>
+#include <tqguardedptr.h>
#include <kdevplugin.h>
@@ -30,16 +30,16 @@ class SnippetPart : public KDevPlugin
public:
- SnippetPart(QObject *parent, const char *name, const QStringList &);
+ SnippetPart(TQObject *parent, const char *name, const TQStringList &);
~SnippetPart();
KAboutData * aboutData();
- QStringList getAllLanguages();
- QStringList getProjectLanguages();
+ TQStringList getAllLanguages();
+ TQStringList getProjectLanguages();
private:
void setupActions();
- QGuardedPtr<SnippetWidget> m_widget;
+ TQGuardedPtr<SnippetWidget> m_widget;
public slots:
void slotConfigWidget( KDialogBase *dlg );
diff --git a/parts/snippet/snippet_widget.cpp b/parts/snippet/snippet_widget.cpp
index 98d61505..2c35d5c5 100644
--- a/parts/snippet/snippet_widget.cpp
+++ b/parts/snippet/snippet_widget.cpp
@@ -11,28 +11,28 @@
#include <kurl.h>
#include <kdebug.h>
#include <klocale.h>
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kpushbutton.h>
#include <klistview.h>
-#include <qheader.h>
+#include <tqheader.h>
#include <klineedit.h>
#include <ktextedit.h>
#include <kmessagebox.h>
-#include <qsplitter.h>
+#include <tqsplitter.h>
#include <ktexteditor/editinterface.h>
#include <ktexteditor/editor.h>
#include <ktexteditor/viewcursorinterface.h>
#include <ktexteditor/document.h>
#include <kconfig.h>
-#include <qtooltip.h>
+#include <tqtooltip.h>
#include <kpopupmenu.h>
-#include <qregexp.h>
-#include <qinputdialog.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qwhatsthis.h>
-#include <qdragobject.h>
-#include <qtimer.h>
+#include <tqregexp.h>
+#include <tqinputdialog.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqwhatsthis.h>
+#include <tqdragobject.h>
+#include <tqtimer.h>
#include <kcombobox.h>
#include <kdeversion.h>
@@ -47,7 +47,7 @@
#include "snippet_widget.h"
SnippetWidget::SnippetWidget(SnippetPart *part)
- : KListView(0, "snippet widget"), QToolTip( viewport() ),
+ : KListView(0, "snippet widget"), TQToolTip( viewport() ),
m_part( part )
{
// init the QPtrList
@@ -64,20 +64,20 @@ SnippetWidget::SnippetWidget(SnippetPart *part)
setRootIsDecorated(true);
//connect the signals
- connect( this, SIGNAL( contextMenuRequested ( QListViewItem *, const QPoint & , int ) ),
- this, SLOT( showPopupMenu(QListViewItem *, const QPoint & , int ) ) );
+ connect( this, TQT_SIGNAL( contextMenuRequested ( TQListViewItem *, const TQPoint & , int ) ),
+ this, TQT_SLOT( showPopupMenu(TQListViewItem *, const TQPoint & , int ) ) );
- connect( this, SIGNAL( executed (QListViewItem *) ),
- this, SLOT( slotExecuted( QListViewItem *) ) );
- connect( this, SIGNAL( returnPressed (QListViewItem *) ),
- this, SLOT( slotExecuted( QListViewItem *) ) );
+ connect( this, TQT_SIGNAL( executed (TQListViewItem *) ),
+ this, TQT_SLOT( slotExecuted( TQListViewItem *) ) );
+ connect( this, TQT_SIGNAL( returnPressed (TQListViewItem *) ),
+ this, TQT_SLOT( slotExecuted( TQListViewItem *) ) );
- connect( this, SIGNAL( dropped(QDropEvent *, QListViewItem *) ),
- this, SLOT( slotDropped(QDropEvent *, QListViewItem *) ) );
+ connect( this, TQT_SIGNAL( dropped(TQDropEvent *, TQListViewItem *) ),
+ this, TQT_SLOT( slotDropped(TQDropEvent *, TQListViewItem *) ) );
_cfg = 0;
- QTimer::singleShot(0, this, SLOT(initConfig()));
+ TQTimer::singleShot(0, this, TQT_SLOT(initConfig()));
}
SnippetWidget::~SnippetWidget()
@@ -121,7 +121,7 @@ void SnippetWidget::slotAdd()
}
dlg.cbGroup->setCurrentText(group->getName());
- if (dlg.exec() == QDialog::Accepted) {
+ if (dlg.exec() == TQDialog::Accepted) {
group = dynamic_cast<SnippetGroup*>(SnippetItem::findItemByName(dlg.cbGroup->currentText(), _list));
_list.append( new SnippetItem(group, dlg.snippetName->text(), dlg.snippetText->text()) );
}
@@ -144,7 +144,7 @@ void SnippetWidget::slotAddGroup()
dlg.cbGroup->setCurrentText(i18n("All"));
dlg.textLabelGroup->setText(i18n("Language:"));
- if (dlg.exec() == QDialog::Accepted) {
+ if (dlg.exec() == TQDialog::Accepted) {
_list.append( new SnippetGroup(this, dlg.snippetName->text(), SnippetGroup::getMaxId(), dlg.cbGroup->currentText()) );
}
}
@@ -157,7 +157,7 @@ void SnippetWidget::slotAddGroup()
void SnippetWidget::slotRemove()
{
//get current data
- QListViewItem * item = currentItem();
+ TQListViewItem * item = currentItem();
SnippetItem *snip = dynamic_cast<SnippetItem*>( item );
SnippetGroup *group = dynamic_cast<SnippetGroup*>( item );
if (!snip)
@@ -165,7 +165,7 @@ void SnippetWidget::slotRemove()
if (group) {
if (group->childCount() > 0 &&
- KMessageBox::warningContinueCancel(this, i18n("Do you really want to remove this group and all its snippets?"),QString::null,KStdGuiItem::del())
+ KMessageBox::warningContinueCancel(this, i18n("Do you really want to remove this group and all its snippets?"),TQString::null,KStdGuiItem::del())
== KMessageBox::Cancel)
return;
@@ -190,7 +190,7 @@ void SnippetWidget::slotRemove()
void SnippetWidget::slotEdit()
{
//get current data
- QListViewItem * item = currentItem();
+ TQListViewItem * item = currentItem();
SnippetGroup *pGroup = dynamic_cast<SnippetGroup*>(item);
SnippetItem *pSnippet = dynamic_cast<SnippetItem*>( item );
@@ -212,7 +212,7 @@ void SnippetWidget::slotEdit()
}
dlg.cbGroup->setCurrentText(SnippetItem::findGroupById(pSnippet->getParent(), _list)->getName());
- if (dlg.exec() == QDialog::Accepted) {
+ if (dlg.exec() == TQDialog::Accepted) {
//update the KListView and the SnippetItem
item->setText( 0, dlg.snippetName->text() );
pSnippet->setName( dlg.snippetName->text() );
@@ -237,7 +237,7 @@ void SnippetWidget::slotEdit()
void SnippetWidget::slotEditGroup()
{
//get current data
- QListViewItem * item = currentItem();
+ TQListViewItem * item = currentItem();
SnippetGroup *pGroup = dynamic_cast<SnippetGroup*>( item );
if (!pGroup) /*selected item MUST be a SnippetGroup*/
@@ -255,7 +255,7 @@ void SnippetWidget::slotEditGroup()
dlg.cbGroup->setCurrentText(pGroup->getLanguage());
dlg.textLabelGroup->setText(i18n("Language:"));
- if (dlg.exec() == QDialog::Accepted) {
+ if (dlg.exec() == TQDialog::Accepted) {
//update the KListView and the SnippetGroup
item->setText( 0, dlg.snippetName->text() );
pGroup->setName( dlg.snippetName->text() );
@@ -265,7 +265,7 @@ void SnippetWidget::slotEditGroup()
}
}
-void SnippetWidget::slotExecuted(QListViewItem * item)
+void SnippetWidget::slotExecuted(TQListViewItem * item)
{
SnippetItem *pSnippet = dynamic_cast<SnippetItem*>( item );
if (!pSnippet || dynamic_cast<SnippetGroup*>(item))
@@ -277,10 +277,10 @@ void SnippetWidget::slotExecuted(QListViewItem * item)
/*!
- \fn SnippetWidget::insertIntoActiveView(QString text)
+ \fn SnippetWidget::insertIntoActiveView(TQString text)
Inserts the parameter text into the activ view
*/
-void SnippetWidget::insertIntoActiveView(QString text)
+void SnippetWidget::insertIntoActiveView(TQString text)
{
//get the interfaces for the KTexteditor parts
KTextEditor::ViewCursorInterface *cursorIface
@@ -315,9 +315,9 @@ void SnippetWidget::writeConfig()
_cfg->setGroup("SnippetPart");
SnippetItem *item;
- QString strKeyName="";
- QString strKeyText="";
- QString strKeyId="";
+ TQString strKeyName="";
+ TQString strKeyText="";
+ TQString strKeyId="";
int iSnipCount = 0;
int iGroupCount = 0;
@@ -327,9 +327,9 @@ void SnippetWidget::writeConfig()
SnippetGroup * group = dynamic_cast<SnippetGroup*>(item);
if (group) {
kdDebug(9035) << "-->GROUP " << item->getName() << group->getId() << " " << iGroupCount<< endl;
- strKeyName=QString("snippetGroupName_%1").arg(iGroupCount);
- strKeyId=QString("snippetGroupId_%1").arg(iGroupCount);
- strKeyText=QString("snippetGroupLang_%1").arg(iGroupCount);
+ strKeyName=TQString("snippetGroupName_%1").arg(iGroupCount);
+ strKeyId=TQString("snippetGroupId_%1").arg(iGroupCount);
+ strKeyText=TQString("snippetGroupLang_%1").arg(iGroupCount);
_cfg->writeEntry(strKeyName, group->getName());
_cfg->writeEntry(strKeyId, group->getId());
@@ -337,9 +337,9 @@ void SnippetWidget::writeConfig()
iGroupCount++;
} else if (dynamic_cast<SnippetItem*>(item)) {
kdDebug(9035) << "-->ITEM " << item->getName() << item->getParent() << " " << iSnipCount << endl;
- strKeyName=QString("snippetName_%1").arg(iSnipCount);
- strKeyText=QString("snippetText_%1").arg(iSnipCount);
- strKeyId=QString("snippetParent_%1").arg(iSnipCount);
+ strKeyName=TQString("snippetName_%1").arg(iSnipCount);
+ strKeyText=TQString("snippetText_%1").arg(iSnipCount);
+ strKeyId=TQString("snippetParent_%1").arg(iSnipCount);
_cfg->writeEntry(strKeyName, item->getName());
_cfg->writeEntry(strKeyText, item->getText());
@@ -353,12 +353,12 @@ void SnippetWidget::writeConfig()
_cfg->writeEntry("snippetGroupCount", iGroupCount);
int iCount = 1;
- QMap<QString, QString>::Iterator it;
+ TQMap<TQString, TQString>::Iterator it;
for ( it = _mapSaved.begin(); it != _mapSaved.end(); ++it ) { //write the saved variable values
if (it.data().length()<=0) continue; //is the saved value has no length -> no need to save it
- strKeyName=QString("snippetSavedName_%1").arg(iCount);
- strKeyText=QString("snippetSavedVal_%1").arg(iCount);
+ strKeyName=TQString("snippetSavedName_%1").arg(iCount);
+ strKeyText=TQString("snippetSavedVal_%1").arg(iCount);
_cfg->writeEntry(strKeyName, it.key());
_cfg->writeEntry(strKeyText, it.data());
@@ -391,14 +391,14 @@ void SnippetWidget::initConfigOldVersion(KConfig *cfg)
_list.append(group);
int iCount = cfg->readNumEntry("snippetCount", 0);
- QString strKeyName="";
- QString strKeyText="";
+ TQString strKeyName="";
+ TQString strKeyText="";
for ( int i=0; i<iCount; i++) { //read the snippet-list
- strKeyName=QString("snippetName_%1").arg(i);
- strKeyText=QString("snippetText_%1").arg(i);
+ strKeyName=TQString("snippetName_%1").arg(i);
+ strKeyText=TQString("snippetText_%1").arg(i);
- QString strNameVal="";
- QString strTextVal="";
+ TQString strNameVal="";
+ TQString strTextVal="";
strNameVal = cfg->readEntry(strKeyName, "");
strTextVal = cfg->readEntry(strKeyText, "");
@@ -422,9 +422,9 @@ void SnippetWidget::initConfig()
_cfg->setGroup("SnippetPart");
- QString strKeyName="";
- QString strKeyText="";
- QString strKeyId="";
+ TQString strKeyName="";
+ TQString strKeyText="";
+ TQString strKeyId="";
SnippetItem *item;
SnippetGroup *group;
@@ -434,13 +434,13 @@ void SnippetWidget::initConfig()
int iCount = _cfg->readNumEntry("snippetGroupCount", -1);
for ( int i=0; i<iCount; i++) { //read the group-list
- strKeyName=QString("snippetGroupName_%1").arg(i);
- strKeyId=QString("snippetGroupId_%1").arg(i);
- strKeyText=QString("snippetGroupLang_%1").arg(i);
+ strKeyName=TQString("snippetGroupName_%1").arg(i);
+ strKeyId=TQString("snippetGroupId_%1").arg(i);
+ strKeyText=TQString("snippetGroupLang_%1").arg(i);
- QString strNameVal="";
+ TQString strNameVal="";
int iIdVal=-1;
- QString strLangVal="";
+ TQString strLangVal="";
strNameVal = _cfg->readEntry(strKeyName, "");
iIdVal = _cfg->readNumEntry(strKeyId, -1);
@@ -465,12 +465,12 @@ void SnippetWidget::initConfig()
if (iCount != -1) {
iCount = _cfg->readNumEntry("snippetCount", 0);
for ( int i=0; i<iCount; i++) { //read the snippet-list
- strKeyName=QString("snippetName_%1").arg(i);
- strKeyText=QString("snippetText_%1").arg(i);
- strKeyId=QString("snippetParent_%1").arg(i);
+ strKeyName=TQString("snippetName_%1").arg(i);
+ strKeyText=TQString("snippetText_%1").arg(i);
+ strKeyId=TQString("snippetParent_%1").arg(i);
- QString strNameVal="";
- QString strTextVal="";
+ TQString strNameVal="";
+ TQString strTextVal="";
int iParentVal = -1;
strNameVal = _cfg->readEntry(strKeyName, "");
@@ -492,11 +492,11 @@ void SnippetWidget::initConfig()
iCount = _cfg->readNumEntry("snippetSavedCount", 0);
for ( int i=1; i<=iCount; i++) { //read the saved-values and store in QMap
- strKeyName=QString("snippetSavedName_%1").arg(i);
- strKeyText=QString("snippetSavedVal_%1").arg(i);
+ strKeyName=TQString("snippetSavedName_%1").arg(i);
+ strKeyText=TQString("snippetSavedVal_%1").arg(i);
- QString strNameVal="";
- QString strTextVal="";
+ TQString strNameVal="";
+ TQString strTextVal="";
strNameVal = _cfg->readEntry(strKeyName, "");
strTextVal = _cfg->readEntry(strKeyText, "");
@@ -517,16 +517,16 @@ void SnippetWidget::initConfig()
}
/*!
- \fn SnippetWidget::maybeTip( const QPoint & p )
+ \fn SnippetWidget::maybeTip( const TQPoint & p )
Shows the Snippet-Text as ToolTip
*/
-void SnippetWidget::maybeTip( const QPoint & p )
+void SnippetWidget::maybeTip( const TQPoint & p )
{
SnippetItem * item = dynamic_cast<SnippetItem*>( itemAt( p ) );
if (!item)
return;
- QRect r = itemRect( item );
+ TQRect r = itemRect( item );
if (r.isValid() &&
_SnippetConfig.useToolTips() )
@@ -540,10 +540,10 @@ void SnippetWidget::maybeTip( const QPoint & p )
}
/*!
- \fn SnippetWidget::showPopupMenu( QListViewItem * item, const QPoint & p, int )
+ \fn SnippetWidget::showPopupMenu( TQListViewItem * item, const TQPoint & p, int )
Shows the Popup-Menu depending item is a valid pointer
*/
-void SnippetWidget::showPopupMenu( QListViewItem * item, const QPoint & p, int )
+void SnippetWidget::showPopupMenu( TQListViewItem * item, const TQPoint & p, int )
{
KPopupMenu popup;
@@ -551,45 +551,45 @@ void SnippetWidget::showPopupMenu( QListViewItem * item, const QPoint & p, int )
if ( item ) {
popup.insertTitle( selectedItem->getName() );
- popup.insertItem( i18n("Add Item..."), this, SLOT( slotAdd() ) );
- popup.insertItem( i18n("Add Group..."), this, SLOT( slotAddGroup() ) );
+ popup.insertItem( i18n("Add Item..."), this, TQT_SLOT( slotAdd() ) );
+ popup.insertItem( i18n("Add Group..."), this, TQT_SLOT( slotAddGroup() ) );
if (dynamic_cast<SnippetGroup*>(item)) {
- popup.insertItem( i18n("Edit..."), this, SLOT( slotEditGroup() ) );
+ popup.insertItem( i18n("Edit..."), this, TQT_SLOT( slotEditGroup() ) );
} else {
- popup.insertItem( i18n("Edit..."), this, SLOT( slotEdit() ) );
+ popup.insertItem( i18n("Edit..."), this, TQT_SLOT( slotEdit() ) );
}
- popup.insertItem( i18n("Remove"), this, SLOT( slotRemove() ) );
+ popup.insertItem( i18n("Remove"), this, TQT_SLOT( slotRemove() ) );
} else {
popup.insertTitle(i18n("Code Snippets"));
- popup.insertItem( i18n("Add Group..."), this, SLOT( slotAddGroup() ) );
+ popup.insertItem( i18n("Add Group..."), this, TQT_SLOT( slotAddGroup() ) );
}
popup.exec(p);
}
-// fn SnippetWidget::parseText(QString text, QString del)
+// fn SnippetWidget::parseText(TQString text, TQString del)
/*!
- This function is used to parse the given QString for variables. If found the user will be prompted
+ This function is used to parse the given TQString for variables. If found the user will be prompted
for a replacement value. It returns the string text with all replacements made
*/
-QString SnippetWidget::parseText(QString text, QString del)
+TQString SnippetWidget::parseText(TQString text, TQString del)
{
- QString str = text;
- QString strName = "";
- QString strNew = "";
- QString strMsg="";
+ TQString str = text;
+ TQString strName = "";
+ TQString strNew = "";
+ TQString strMsg="";
int iFound = -1;
int iEnd = -1;
- QMap<QString, QString> mapVar;
+ TQMap<TQString, TQString> mapVar;
int iInMeth = _SnippetConfig.getInputMethod();
- QRect rSingle = _SnippetConfig.getSingleRect();
- QRect rMulti = _SnippetConfig.getMultiRect();
+ TQRect rSingle = _SnippetConfig.getSingleRect();
+ TQRect rMulti = _SnippetConfig.getMultiRect();
do {
- iFound = text.find(QRegExp("\\"+del+"[A-Za-z-_0-9\\s]*\\"+del), iEnd+1); //find the next variable by this QRegExp
+ iFound = text.find(TQRegExp("\\"+del+"[A-Za-z-_0-9\\s]*\\"+del), iEnd+1); //find the next variable by this QRegExp
if (iFound >= 0) {
iEnd = text.find(del, iFound+1)+1;
strName = text.mid(iFound, iEnd-iFound);
@@ -625,7 +625,7 @@ QString SnippetWidget::parseText(QString text, QString del)
bh = rMulti.height();
oh = rMulti.top();
if (showMultiVarDialog( &mapVar, &_mapSaved, w, bh, oh )) { //generate and show the dialog
- QMap<QString, QString>::Iterator it;
+ TQMap<TQString, TQString>::Iterator it;
for ( it = mapVar.begin(); it != mapVar.end(); ++it ) { //walk through the map and do the replacement
str.replace(it.key(), it.data());
}
@@ -652,7 +652,7 @@ QString SnippetWidget::parseText(QString text, QString del)
variable that is stored in the given map except the double-delimiter entry
It return true if everything was ok and false if the user hit cancel
*/
-bool SnippetWidget::showMultiVarDialog(QMap<QString, QString> * map, QMap<QString, QString> * mapSave,
+bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQString, TQString> * mapSave,
int & iWidth, int & iBasicHeight, int & iOneHeight)
{
//if no var -> no need to show
@@ -660,28 +660,28 @@ bool SnippetWidget::showMultiVarDialog(QMap<QString, QString> * map, QMap<QStrin
return true;
//if only var is the double-delimiter -> no need to show
- QMap<QString, QString>::Iterator it = map->begin();
+ TQMap<TQString, TQString>::Iterator it = map->begin();
if ( map->count() == 1 && it.data()==_SnippetConfig.getDelimiter()+_SnippetConfig.getDelimiter() )
return true;
- QMap<QString, KTextEdit *> mapVar2Te; //this map will help keeping track which TEXTEDIT goes with which variable
- QMap<QString, QCheckBox *> mapVar2Cb; //this map will help keeping track which CHECKBOX goes with which variable
+ TQMap<TQString, KTextEdit *> mapVar2Te; //this map will help keeping track which TEXTEDIT goes with which variable
+ TQMap<TQString, TQCheckBox *> mapVar2Cb; //this map will help keeping track which CHECKBOX goes with which variable
// --BEGIN-- building a dynamic dialog
- QDialog dlg(this);
+ TQDialog dlg(this);
dlg.setCaption(i18n("Enter Values for Variables"));
- QGridLayout * layout = new QGridLayout( &dlg, 1, 1, 11, 6, "layout");
- QGridLayout * layoutTop = new QGridLayout( 0, 1, 1, 0, 6, "layoutTop");
- QGridLayout * layoutVar = new QGridLayout( 0, 1, 1, 0, 6, "layoutVar");
- QGridLayout * layoutBtn = new QGridLayout( 0, 1, 1, 0, 6, "layoutBtn");
+ TQGridLayout * layout = new TQGridLayout( &dlg, 1, 1, 11, 6, "layout");
+ TQGridLayout * layoutTop = new TQGridLayout( 0, 1, 1, 0, 6, "layoutTop");
+ TQGridLayout * layoutVar = new TQGridLayout( 0, 1, 1, 0, 6, "layoutVar");
+ TQGridLayout * layoutBtn = new TQGridLayout( 0, 1, 1, 0, 6, "layoutBtn");
KTextEdit *te = NULL;
- QLabel * labTop = NULL;
- QCheckBox * cb = NULL;
+ TQLabel * labTop = NULL;
+ TQCheckBox * cb = NULL;
- labTop = new QLabel( &dlg, "label" );
- labTop->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0,
+ labTop = new TQLabel( &dlg, "label" );
+ labTop->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0,
labTop->sizePolicy().hasHeightForWidth() ) );
labTop->setText(i18n("Enter the replacement values for these variables:"));
layoutTop->addWidget(labTop, 0, 0);
@@ -693,7 +693,7 @@ bool SnippetWidget::showMultiVarDialog(QMap<QString, QString> * map, QMap<QStrin
if (it.key() == _SnippetConfig.getDelimiter() + _SnippetConfig.getDelimiter())
continue;
- cb = new QCheckBox( &dlg, "cbVar" );
+ cb = new TQCheckBox( &dlg, "cbVar" );
cb->setChecked( FALSE );
cb->setText(it.key());
layoutVar->addWidget( cb, i ,0, Qt::AlignTop );
@@ -709,8 +709,8 @@ bool SnippetWidget::showMultiVarDialog(QMap<QString, QString> * map, QMap<QStrin
mapVar2Te[it.key()] = te;
mapVar2Cb[it.key()] = cb;
- QToolTip::add( cb, i18n("Enable this to save the value entered to the right as the default value for this variable") );
- QWhatsThis::add( cb, i18n("If you enable this option, the value entered to the right will be saved. "
+ TQToolTip::add( cb, i18n("Enable this to save the value entered to the right as the default value for this variable") );
+ TQWhatsThis::add( cb, i18n("If you enable this option, the value entered to the right will be saved. "
"If you use the same variable later, even in another snippet, the value entered to the right "
"will be the default value for that variable.") );
@@ -720,37 +720,37 @@ bool SnippetWidget::showMultiVarDialog(QMap<QString, QString> * map, QMap<QStrin
KPushButton * btn1 = new KPushButton( &dlg, "pushButton1" );
btn1->setText(i18n("&Cancel"));
- btn1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0,
+ btn1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0,
btn1->sizePolicy().hasHeightForWidth() ) );
layoutBtn->addWidget( btn1, 0, 0 );
KPushButton * btn2 = new KPushButton( &dlg, "pushButton2" );
btn2->setText(i18n("&Apply"));
btn2->setDefault( TRUE );
- btn2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0,
+ btn2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0,
btn2->sizePolicy().hasHeightForWidth() ) );
layoutBtn->addWidget( btn2, 0, 1 );
layout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 );
// --END-- building a dynamic dialog
- //connect the buttons to the QDialog default slots
- connect(btn1, SIGNAL(clicked()), &dlg, SLOT(reject()) );
- connect(btn2, SIGNAL(clicked()), &dlg, SLOT(accept()) );
+ //connect the buttons to the TQDialog default slots
+ connect(btn1, TQT_SIGNAL(clicked()), &dlg, TQT_SLOT(reject()) );
+ connect(btn2, TQT_SIGNAL(clicked()), &dlg, TQT_SLOT(accept()) );
//prepare to execute the dialog
bool bReturn = false;
//resize the textedits
if (iWidth > 1) {
- QRect r = dlg.geometry();
+ TQRect r = dlg.geometry();
r.setHeight(iBasicHeight + iOneHeight*mapVar2Te.count());
r.setWidth(iWidth);
dlg.setGeometry(r);
}
if ( i > 0 && // only if there are any variables
- dlg.exec() == QDialog::Accepted ) {
+ dlg.exec() == TQDialog::Accepted ) {
- QMap<QString, KTextEdit *>::Iterator it2;
+ TQMap<TQString, KTextEdit *>::Iterator it2;
for ( it2 = mapVar2Te.begin(); it2 != mapVar2Te.end(); ++it2 ) {
if (it2.key() == _SnippetConfig.getDelimiter() + _SnippetConfig.getDelimiter())
continue;
@@ -769,11 +769,11 @@ bool SnippetWidget::showMultiVarDialog(QMap<QString, QString> * map, QMap<QStrin
}
//do some cleanup
- QMap<QString, KTextEdit *>::Iterator it1;
+ TQMap<TQString, KTextEdit *>::Iterator it1;
for (it1 = mapVar2Te.begin(); it1 != mapVar2Te.end(); ++it1)
delete it1.data();
mapVar2Te.clear();
- QMap<QString, QCheckBox *>::Iterator it2;
+ TQMap<TQString, TQCheckBox *>::Iterator it2;
for (it2 = mapVar2Cb.begin(); it2 != mapVar2Cb.end(); ++it2)
delete it2.data();
mapVar2Cb.clear();
@@ -789,33 +789,33 @@ bool SnippetWidget::showMultiVarDialog(QMap<QString, QString> * map, QMap<QStrin
}
-// fn SnippetWidget::showSingleVarDialog(QString var, QMap<QString, QString> * mapSave)
+// fn SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQString> * mapSave)
/*!
This function constructs a dialog which contains a label and a linedit for the given variable
It return either the entered value or an empty string if the user hit cancel
*/
-QString SnippetWidget::showSingleVarDialog(QString var, QMap<QString, QString> * mapSave, QRect & dlgSize)
+TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQString> * mapSave, TQRect & dlgSize)
{
// --BEGIN-- building a dynamic dialog
- QDialog dlg(this);
+ TQDialog dlg(this);
dlg.setCaption(i18n("Enter Values for Variables"));
- QGridLayout * layout = new QGridLayout( &dlg, 1, 1, 11, 6, "layout");
- QGridLayout * layoutTop = new QGridLayout( 0, 1, 1, 0, 6, "layoutTop");
- QGridLayout * layoutVar = new QGridLayout( 0, 1, 1, 0, 6, "layoutVar");
- QGridLayout * layoutBtn = new QGridLayout( 0, 2, 1, 0, 6, "layoutBtn");
+ TQGridLayout * layout = new TQGridLayout( &dlg, 1, 1, 11, 6, "layout");
+ TQGridLayout * layoutTop = new TQGridLayout( 0, 1, 1, 0, 6, "layoutTop");
+ TQGridLayout * layoutVar = new TQGridLayout( 0, 1, 1, 0, 6, "layoutVar");
+ TQGridLayout * layoutBtn = new TQGridLayout( 0, 2, 1, 0, 6, "layoutBtn");
KTextEdit *te = NULL;
- QLabel * labTop = NULL;
- QCheckBox * cb = NULL;
+ TQLabel * labTop = NULL;
+ TQCheckBox * cb = NULL;
- labTop = new QLabel( &dlg, "label" );
+ labTop = new TQLabel( &dlg, "label" );
layoutTop->addWidget(labTop, 0, 0);
labTop->setText(i18n("Enter the replacement values for %1:").arg( var ));
layout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 );
- cb = new QCheckBox( &dlg, "cbVar" );
+ cb = new TQCheckBox( &dlg, "cbVar" );
cb->setChecked( FALSE );
cb->setText(i18n( "Make value &default" ));
@@ -827,8 +827,8 @@ QString SnippetWidget::showSingleVarDialog(QString var, QMap<QString, QString> *
te->setText((*mapSave)[var]);
}
- QToolTip::add( cb, i18n("Enable this to save the value entered to the right as the default value for this variable") );
- QWhatsThis::add( cb, i18n("If you enable this option, the value entered to the right will be saved. "
+ TQToolTip::add( cb, i18n("Enable this to save the value entered to the right as the default value for this variable") );
+ TQWhatsThis::add( cb, i18n("If you enable this option, the value entered to the right will be saved. "
"If you use the same variable later, even in another snippet, the value entered to the right "
"will be the default value for that variable.") );
@@ -847,15 +847,15 @@ QString SnippetWidget::showSingleVarDialog(QString var, QMap<QString, QString> *
te->setFocus();
// --END-- building a dynamic dialog
- //connect the buttons to the QDialog default slots
- connect(btn1, SIGNAL(clicked()), &dlg, SLOT(reject()) );
- connect(btn2, SIGNAL(clicked()), &dlg, SLOT(accept()) );
+ //connect the buttons to the TQDialog default slots
+ connect(btn1, TQT_SIGNAL(clicked()), &dlg, TQT_SLOT(reject()) );
+ connect(btn2, TQT_SIGNAL(clicked()), &dlg, TQT_SLOT(accept()) );
//execute the dialog
- QString strReturn = "";
+ TQString strReturn = "";
if (dlgSize.isValid())
dlg.setGeometry(dlgSize);
- if ( dlg.exec() == QDialog::Accepted ) {
+ if ( dlg.exec() == TQDialog::Accepted ) {
if (cb->isChecked()) //if the checkbox is on; save the values for later
(*mapSave)[var] = te->text();
else
@@ -880,21 +880,21 @@ QString SnippetWidget::showSingleVarDialog(QString var, QMap<QString, QString> *
return strReturn;
}
-// fn SnippetWidget::acceptDrag (QDropEvent *event) const
+// fn SnippetWidget::acceptDrag (TQDropEvent *event) const
/*!
Reimplementation from KListView.
Check here if the data the user is about to drop fits our restrictions.
We only accept dropps of plaintext, because from the dropped text
we will create a snippet.
*/
-bool SnippetWidget::acceptDrag (QDropEvent *event) const
+bool SnippetWidget::acceptDrag (TQDropEvent *event) const
{
kdDebug(9035) << "Format: " << event->format() << "" << event->pos() << endl;
- QListViewItem * item = itemAt(event->pos());
+ TQListViewItem * item = itemAt(event->pos());
if (item &&
- QString(event->format()).startsWith("text/plain") &&
+ TQString(event->format()).startsWith("text/plain") &&
static_cast<SnippetWidget *>(event->source()) != this) {
kdDebug(9035) << "returning TRUE " << endl;
return TRUE;
@@ -905,25 +905,25 @@ bool SnippetWidget::acceptDrag (QDropEvent *event) const
}
}
-// fn SnippetWidget::slotDropped(QDropEvent *e, QListViewItem *after)
+// fn SnippetWidget::slotDropped(TQDropEvent *e, TQListViewItem *after)
/*!
This slot is connected to the dropped signal.
If it is emitted, we need to construct a new snippet entry with
the data given
*/
-void SnippetWidget::slotDropped(QDropEvent *e, QListViewItem *)
+void SnippetWidget::slotDropped(TQDropEvent *e, TQListViewItem *)
{
- QListViewItem * item2 = itemAt(e->pos());
+ TQListViewItem * item2 = itemAt(e->pos());
SnippetGroup *group = dynamic_cast<SnippetGroup *>(item2);
if (!group)
group = dynamic_cast<SnippetGroup *>(item2->parent());
- QCString dropped;
- QByteArray data = e->encodedData("text/plain");
+ TQCString dropped;
+ TQByteArray data = e->encodedData("text/plain");
if ( e->provides("text/plain") && data.size()>0 ) {
//get the data from the event...
- QString encData(data.data());
+ TQString encData(data.data());
kdDebug(9035) << "encData: " << encData << endl;
//... then fill the dialog with the given data
@@ -939,7 +939,7 @@ void SnippetWidget::slotDropped(QDropEvent *e, QListViewItem *)
}
dlg.cbGroup->setCurrentText(group->getName());
- if (dlg.exec() == QDialog::Accepted) {
+ if (dlg.exec() == TQDialog::Accepted) {
/* get the group that the user selected with the combobox */
group = dynamic_cast<SnippetGroup*>(SnippetItem::findItemByName(dlg.cbGroup->currentText(), _list));
_list.append( new SnippetItem(group, dlg.snippetName->text(), dlg.snippetText->text()) );
@@ -953,7 +953,7 @@ void SnippetWidget::slotDropped(QDropEvent *e, QListViewItem *)
*/
void SnippetWidget::languageChanged()
{
- QStringList langs = m_part->getProjectLanguages();
+ TQStringList langs = m_part->getProjectLanguages();
for (SnippetItem *it=_list.first(); it; it=_list.next()) {
SnippetGroup * group = dynamic_cast<SnippetGroup*>(it);
diff --git a/parts/snippet/snippet_widget.h b/parts/snippet/snippet_widget.h
index 84df7a6f..d8cf7756 100644
--- a/parts/snippet/snippet_widget.h
+++ b/parts/snippet/snippet_widget.h
@@ -9,11 +9,11 @@
#ifndef __SNIPPET_WIDGET_H__
#define __SNIPPET_WIDGET_H__
-#include <qwidget.h>
-#include <qstring.h>
+#include <tqwidget.h>
+#include <tqstring.h>
#include <klistview.h>
-#include <qtooltip.h>
-#include <qrect.h>
+#include <tqtooltip.h>
+#include <tqrect.h>
#include <ktexteditor/editinterface.h>
#include <ktexteditor/view.h>
@@ -33,7 +33,7 @@ class KConfig;
/**
This is the widget which gets added to the right TreeToolView.
-It inherits KListView and QToolTip which is needed for showing the
+It inherits KListView and TQToolTip which is needed for showing the
tooltips which contains the text of the snippet
@author Robert Gruber
*/
@@ -46,7 +46,7 @@ class SnippetWidget : public KListView, public QToolTip
public:
SnippetWidget(SnippetPart *part);
~SnippetWidget();
- QPtrList<SnippetItem> * getList() { return (&_list); }
+ TQPtrList<SnippetItem> * getList() { return (&_list); }
void writeConfig();
void initConfigOldVersion(KConfig *cfg);
SnippetConfig * getSnippetConfig() { return (&_SnippetConfig); }
@@ -58,18 +58,18 @@ private slots:
protected:
SnippetPart * m_part;
- void maybeTip( const QPoint & );
- bool acceptDrag (QDropEvent *event) const;
+ void maybeTip( const TQPoint & );
+ bool acceptDrag (TQDropEvent *event) const;
private:
- void insertIntoActiveView(QString text);
- QString parseText(QString text, QString del="$");
- bool showMultiVarDialog(QMap<QString, QString> * map, QMap<QString, QString> * mapSave,
+ void insertIntoActiveView(TQString text);
+ TQString parseText(TQString text, TQString del="$");
+ bool showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQString, TQString> * mapSave,
int & iWidth, int & iBasicHeight, int & iOneHeight);
- QString showSingleVarDialog(QString var, QMap<QString, QString> * mapSave, QRect & dlgSize);
+ TQString showSingleVarDialog(TQString var, TQMap<TQString, TQString> * mapSave, TQRect & dlgSize);
- QPtrList<SnippetItem> _list;
- QMap<QString, QString> _mapSaved;
+ TQPtrList<SnippetItem> _list;
+ TQMap<TQString, TQString> _mapSaved;
KConfig * _cfg;
SnippetConfig _SnippetConfig;
@@ -81,9 +81,9 @@ public slots:
void slotAddGroup();
protected slots:
- void showPopupMenu( QListViewItem * item, const QPoint & p, int );
- void slotExecuted(QListViewItem * item);
- void slotDropped(QDropEvent *e, QListViewItem *after);
+ void showPopupMenu( TQListViewItem * item, const TQPoint & p, int );
+ void slotExecuted(TQListViewItem * item);
+ void slotDropped(TQDropEvent *e, TQListViewItem *after);
};
diff --git a/parts/snippet/snippetconfig.h b/parts/snippet/snippetconfig.h
index 89fe00e0..b1f089f4 100644
--- a/parts/snippet/snippetconfig.h
+++ b/parts/snippet/snippetconfig.h
@@ -9,8 +9,8 @@
#ifndef SNIPPETCONFIG_H
#define SNIPPETCONFIG_H
-#include <qstring.h>
-#include <qrect.h>
+#include <tqstring.h>
+#include <tqrect.h>
/**
@@ -26,28 +26,28 @@ public:
bool useToolTips() { return (bToolTip); };
int getInputMethod() { return (iInputMethod); };
- QString getDelimiter() { return (strDelimiter); };
- QRect getSingleRect() { return (rSingle); };
- QRect getMultiRect() { return (rMulti); };
+ TQString getDelimiter() { return (strDelimiter); };
+ TQRect getSingleRect() { return (rSingle); };
+ TQRect getMultiRect() { return (rMulti); };
int getAutoOpenGroups() { return iAutoOpenGroups; }
void setToolTips(bool b) { bToolTip=b; };
void setInputMethod(int i) { iInputMethod=i; };
- void setDelimiter(QString s) { strDelimiter=s; };
- void setSingleRect(QRect r) {
- rSingle = (r.isValid())?r:QRect();
+ void setDelimiter(TQString s) { strDelimiter=s; };
+ void setSingleRect(TQRect r) {
+ rSingle = (r.isValid())?r:TQRect();
}
- void setMultiRect(QRect r) {
- rMulti = (r.isValid())?r:QRect();
+ void setMultiRect(TQRect r) {
+ rMulti = (r.isValid())?r:TQRect();
}
void setAutoOpenGroups(int autoopen) { iAutoOpenGroups = autoopen; }
protected:
bool bToolTip;
int iInputMethod;
- QString strDelimiter;
- QRect rSingle;
- QRect rMulti;
+ TQString strDelimiter;
+ TQRect rSingle;
+ TQRect rMulti;
int iMultiBasicHeight;
int iMultiCount;
int iAutoOpenGroups;
diff --git a/parts/snippet/snippetitem.cpp b/parts/snippet/snippetitem.cpp
index 7548ad16..e2f08a2b 100644
--- a/parts/snippet/snippetitem.cpp
+++ b/parts/snippet/snippetitem.cpp
@@ -6,21 +6,21 @@
* Copyright: See COPYING file that comes with this distribution
*/
-#include <qstring.h>
+#include <tqstring.h>
#include "snippetitem.h"
-SnippetItem::SnippetItem(QListView * parent, QString name, QString text )
- : QListViewItem( parent, name )
+SnippetItem::SnippetItem(TQListView * parent, TQString name, TQString text )
+ : TQListViewItem( parent, name )
{
strName = name;
strText = text;
iParent = -1;
}
-SnippetItem::SnippetItem(QListViewItem * parent, QString name, QString text)
- : QListViewItem( parent, name )
+SnippetItem::SnippetItem(TQListViewItem * parent, TQString name, TQString text)
+ : TQListViewItem( parent, name )
{
strName = name;
strText = text;
@@ -35,7 +35,7 @@ SnippetItem::~SnippetItem()
/*!
\fn SnippetItem::getName()
*/
-QString SnippetItem::getName()
+TQString SnippetItem::getName()
{
return strName;
}
@@ -44,25 +44,25 @@ QString SnippetItem::getName()
/*!
\fn SnippetItem::getText
*/
-QString SnippetItem::getText()
+TQString SnippetItem::getText()
{
return strText;
}
/*!
- \fn SnippetItem::setText(QString text)
+ \fn SnippetItem::setText(TQString text)
*/
-void SnippetItem::setText(QString text)
+void SnippetItem::setText(TQString text)
{
strText = text;
}
/*!
- \fn SnippetItem::setName(QString name)
+ \fn SnippetItem::setName(TQString name)
*/
-void SnippetItem::setName(QString name)
+void SnippetItem::setName(TQString name)
{
strName = name;
}
@@ -74,7 +74,7 @@ void SnippetItem::resetParent()
iParent = group->getId();
}
-SnippetItem * SnippetItem::findItemByName(QString name, QPtrList<SnippetItem> &list)
+SnippetItem * SnippetItem::findItemByName(TQString name, TQPtrList<SnippetItem> &list)
{
for ( SnippetItem * item = list.first(); item; item = list.next() ) { //write the snippet-list
if (item->getName() == name)
@@ -83,7 +83,7 @@ SnippetItem * SnippetItem::findItemByName(QString name, QPtrList<SnippetItem> &l
return NULL;
}
-SnippetGroup * SnippetItem::findGroupById(int id, QPtrList<SnippetItem> &list)
+SnippetGroup * SnippetItem::findGroupById(int id, TQPtrList<SnippetItem> &list)
{
for ( SnippetItem * item = list.first(); item; item = list.next() ) { //write the snippet-list
SnippetGroup * group = dynamic_cast<SnippetGroup*>(item);
@@ -100,7 +100,7 @@ Deklaration for class SnippetGroup
int SnippetGroup::iMaxId = 1;
-SnippetGroup::SnippetGroup(QListView * parent, QString name, int id, QString lang)
+SnippetGroup::SnippetGroup(TQListView * parent, TQString name, int id, TQString lang)
: SnippetItem(parent, name, "GROUP")
{
if (id > 0) {
diff --git a/parts/snippet/snippetitem.h b/parts/snippet/snippetitem.h
index ac6fb416..9cfe2ccf 100644
--- a/parts/snippet/snippetitem.h
+++ b/parts/snippet/snippetitem.h
@@ -21,50 +21,50 @@ This class represents one CodeSnippet-Item in the listview.
It also holds the needed data for one snippet.
@author Robert Gruber
*/
-class SnippetItem : public QListViewItem {
+class SnippetItem : public TQListViewItem {
friend class SnippetGroup;
public:
- SnippetItem(QListViewItem * parent, QString name, QString text);
+ SnippetItem(TQListViewItem * parent, TQString name, TQString text);
~SnippetItem();
- QString getName();
- QString getText();
+ TQString getName();
+ TQString getText();
int getParent() { return iParent; }
void resetParent();
- void setText(QString text);
- void setName(QString name);
- static SnippetItem * findItemByName(QString name, QPtrList<SnippetItem> &list);
- static SnippetGroup * findGroupById(int id, QPtrList<SnippetItem> &list);
+ void setText(TQString text);
+ void setName(TQString name);
+ static SnippetItem * findItemByName(TQString name, TQPtrList<SnippetItem> &list);
+ static SnippetGroup * findGroupById(int id, TQPtrList<SnippetItem> &list);
private:
- SnippetItem(QListView * parent, QString name, QString text);
- QString strName;
- QString strText;
+ SnippetItem(TQListView * parent, TQString name, TQString text);
+ TQString strName;
+ TQString strText;
int iParent;
};
/**
This class represents one group in the listview.
It is derived from SnippetItem in order to allow storing
-it in the main QPtrList<SnippetItem>.
+it in the main TQPtrList<SnippetItem>.
@author Robert Gruber
*/
class SnippetGroup : public SnippetItem {
public:
- SnippetGroup(QListView * parent, QString name, int id, QString lang=i18n("All"));
+ SnippetGroup(TQListView * parent, TQString name, int id, TQString lang=i18n("All"));
~SnippetGroup();
int getId() { return iId; }
static int getMaxId() { return iMaxId; }
- QString getLanguage() { return strLanguage; }
+ TQString getLanguage() { return strLanguage; }
void setId(int id);
- void setLanguage(QString lang) { strLanguage = lang; }
+ void setLanguage(TQString lang) { strLanguage = lang; }
private:
static int iMaxId;
int iId;
- QString strLanguage;
+ TQString strLanguage;
};
#endif
diff --git a/parts/snippet/snippetsettings.cpp b/parts/snippet/snippetsettings.cpp
index f0f9348b..8e559ba5 100644
--- a/parts/snippet/snippetsettings.cpp
+++ b/parts/snippet/snippetsettings.cpp
@@ -6,22 +6,22 @@
* Copyright: See COPYING file that comes with this distribution
*/
-#include <qstring.h>
+#include <tqstring.h>
#include <klineedit.h>
-#include <qcheckbox.h>
-#include <qbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqbuttongroup.h>
#include "snippetsettings.h"
#include "snippet_widget.h"
-SnippetSettings::SnippetSettings(QWidget *parent, const char *name)
+SnippetSettings::SnippetSettings(TQWidget *parent, const char *name)
: SnippetSettingsBase(parent, name)
{
_widget = NULL;
}
-SnippetSettings::SnippetSettings(SnippetWidget * w, QWidget *parent, const char *name)
+SnippetSettings::SnippetSettings(SnippetWidget * w, TQWidget *parent, const char *name)
: SnippetSettingsBase(parent, name)
{
_cfg = w->getSnippetConfig();
diff --git a/parts/snippet/snippetsettings.h b/parts/snippet/snippetsettings.h
index ef4a019a..2f51a823 100644
--- a/parts/snippet/snippetsettings.h
+++ b/parts/snippet/snippetsettings.h
@@ -25,8 +25,8 @@ class SnippetSettings : public SnippetSettingsBase
{
Q_OBJECT
public:
- SnippetSettings(QWidget *parent = 0, const char *name = 0);
- SnippetSettings(SnippetWidget * w, QWidget *parent = 0, const char *name = 0);
+ SnippetSettings(TQWidget *parent = 0, const char *name = 0);
+ SnippetSettings(SnippetWidget * w, TQWidget *parent = 0, const char *name = 0);
~SnippetSettings();