diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:50:21 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-15 15:50:21 -0600 |
commit | 3ca10fd9a2dc631429d3b5d5c5e42a7d211d5a12 (patch) | |
tree | 89de88213bd261e4ccaade899ab2d6ec34b3a5a7 /kmail/snippetwidget.cpp | |
parent | 1dad5f662a09dfc5cc041caffe0f674044a4dcec (diff) | |
download | tdepim-3ca10fd9a2dc631429d3b5d5c5e42a7d211d5a12.tar.gz tdepim-3ca10fd9a2dc631429d3b5d5c5e42a7d211d5a12.zip |
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'kmail/snippetwidget.cpp')
-rw-r--r-- | kmail/snippetwidget.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/kmail/snippetwidget.cpp b/kmail/snippetwidget.cpp index aff2e8067..128687fc3 100644 --- a/kmail/snippetwidget.cpp +++ b/kmail/snippetwidget.cpp @@ -14,7 +14,7 @@ #include <kurl.h> #include <kdebug.h> #include <klocale.h> -#include <tqlayout.h> +#include <layout.h> #include <kpushbutton.h> #include <klistview.h> #include <tqheader.h> @@ -145,7 +145,7 @@ void SnippetWidget::slotAdd() SnippetItem* SnippetWidget::makeItem( SnippetItem* parent, const TQString& name, const TQString& text, const KShortcut& shortcut ) { SnippetItem * item = new SnippetItem(parent, name, text); - const TQString actionName = i18n("Snippet %1").tqarg(name); + const TQString actionName = i18n("Snippet %1").arg(name); const TQString normalizedName = TQString(actionName).replace(" ", "_"); if ( !mActionCollection->action(normalizedName.utf8().data() ) ) { KAction * action = new KAction( actionName, shortcut, item, @@ -352,8 +352,8 @@ void SnippetWidget::writeConfig() SnippetGroup * group = dynamic_cast<SnippetGroup*>(item); if (group) { //kdDebug(5006) << "-->GROUP " << item->getName() << group->getId() << " " << iGroupCount<< endl; - strKeyName=TQString("snippetGroupName_%1").tqarg(iGroupCount); - strKeyId=TQString("snippetGroupId_%1").tqarg(iGroupCount); + strKeyName=TQString("snippetGroupName_%1").arg(iGroupCount); + strKeyId=TQString("snippetGroupId_%1").arg(iGroupCount); _cfg->writeEntry(strKeyName, group->getName()); _cfg->writeEntry(strKeyId, group->getId()); @@ -361,9 +361,9 @@ void SnippetWidget::writeConfig() iGroupCount++; } else if (dynamic_cast<SnippetItem*>(item)) { //kdDebug(5006) << "-->ITEM " << item->getName() << item->getParent() << " " << iSnipCount << endl; - strKeyName=TQString("snippetName_%1").tqarg(iSnipCount); - strKeyText=TQString("snippetText_%1").tqarg(iSnipCount); - strKeyId=TQString("snippetParent_%1").tqarg(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()); @@ -373,7 +373,7 @@ void SnippetWidget::writeConfig() assert( action ); const KShortcut& sc = action->shortcut(); if (!sc.isNull() ) { - _cfg->writeEntry( TQString("snippetShortcut_%1").tqarg(iSnipCount), sc.toString() ); + _cfg->writeEntry( TQString("snippetShortcut_%1").arg(iSnipCount), sc.toString() ); } iSnipCount++; } else { @@ -389,8 +389,8 @@ void SnippetWidget::writeConfig() 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=TQString("snippetSavedName_%1").tqarg(iCount); - strKeyText=TQString("snippetSavedVal_%1").tqarg(iCount); + strKeyName=TQString("snippetSavedName_%1").arg(iCount); + strKeyText=TQString("snippetSavedVal_%1").arg(iCount); _cfg->writeEntry(strKeyName, it.key()); _cfg->writeEntry(strKeyText, it.data()); @@ -434,8 +434,8 @@ void SnippetWidget::initConfig() int iCount = _cfg->readNumEntry("snippetGroupCount", -1); for ( int i=0; i<iCount; i++) { //read the group-list - strKeyName=TQString("snippetGroupName_%1").tqarg(i); - strKeyId=TQString("snippetGroupId_%1").tqarg(i); + strKeyName=TQString("snippetGroupName_%1").arg(i); + strKeyId=TQString("snippetGroupId_%1").arg(i); TQString strNameVal=""; int iIdVal=-1; @@ -460,9 +460,9 @@ void SnippetWidget::initConfig() if (iCount != -1) { iCount = _cfg->readNumEntry("snippetCount", 0); for ( int i=0; i<iCount; i++) { //read the snippet-list - strKeyName=TQString("snippetName_%1").tqarg(i); - strKeyText=TQString("snippetText_%1").tqarg(i); - strKeyId=TQString("snippetParent_%1").tqarg(i); + strKeyName=TQString("snippetName_%1").arg(i); + strKeyText=TQString("snippetText_%1").arg(i); + strKeyId=TQString("snippetParent_%1").arg(i); TQString strNameVal=""; TQString strTextVal=""; @@ -474,7 +474,7 @@ void SnippetWidget::initConfig() //kdDebug(5006) << "Read item " << strNameVal << " " << iParentVal << endl; if (strNameVal != "" && strTextVal != "" && iParentVal != -1) { - KShortcut shortcut( _cfg->readEntry( TQString("snippetShortcut_%1").tqarg(i), TQString() ) ); + KShortcut shortcut( _cfg->readEntry( TQString("snippetShortcut_%1").arg(i), TQString() ) ); item = makeItem( SnippetItem::findGroupById(iParentVal, _list), strNameVal, strTextVal, shortcut ); //kdDebug(5006) << "Created item " << item->getName() << " " << item->getParent() << endl; _list.append(item); @@ -487,8 +487,8 @@ void SnippetWidget::initConfig() iCount = _cfg->readNumEntry("snippetSavedCount", 0); for ( int i=1; i<=iCount; i++) { //read the saved-values and store in TQMap - strKeyName=TQString("snippetSavedName_%1").tqarg(i); - strKeyText=TQString("snippetSavedVal_%1").tqarg(i); + strKeyName=TQString("snippetSavedName_%1").arg(i); + strKeyText=TQString("snippetSavedVal_%1").arg(i); TQString strNameVal=""; TQString strTextVal=""; @@ -521,7 +521,7 @@ void SnippetWidget::maybeTip( const TQPoint & p ) if (!item) return; - TQRect r = tqitemRect( item ); + TQRect r = itemRect( item ); if (r.isValid() && _SnippetConfig.useToolTips() ) @@ -586,7 +586,7 @@ TQString SnippetWidget::parseText(TQString text, TQString del) if ( strName != del+del ) { //if not doubel-delimiter if (iInMeth == 0) { //if input-method "single" is selected if ( mapVar[strName].length() <= 0 ) { // and not already in map - strMsg=i18n("Please enter the value for <b>%1</b>:").tqarg(strName); + strMsg=i18n("Please enter the value for <b>%1</b>:").arg(strName); strNew = showSingleVarDialog( strName, &_mapSaved, rSingle ); if (strNew=="") return ""; //user clicked Cancle @@ -660,7 +660,7 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ TQDialog dlg(this); dlg.setCaption(i18n("Enter Values for Variables")); - TQGridLayout * tqlayout = new TQGridLayout( &dlg, 1, 1, 11, 6, "tqlayout"); + 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"); @@ -670,15 +670,15 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ TQCheckBox * cb = NULL; labTop = new TQLabel( &dlg, "label" ); - labTop->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, + 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); - tqlayout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 ); + layout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 ); int i = 0; //walk through the variable map and add - for ( it = map->begin(); it != map->end(); ++it ) { //a checkbox, a lable and a lineedit to the main tqlayout + for ( it = map->begin(); it != map->end(); ++it ) { //a checkbox, a lable and a lineedit to the main layout if (it.key() == _SnippetConfig.getDelimiter() + _SnippetConfig.getDelimiter()) continue; @@ -705,20 +705,20 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ i++; } - tqlayout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 ); + layout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 ); KPushButton * btn1 = new KPushButton( KStdGuiItem::cancel(), &dlg, "pushButton1" ); - btn1->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::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( KStdGuiItem::apply(), &dlg, "pushButton2" ); btn2->setDefault( TRUE ); - btn2->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, + btn2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, btn2->sizePolicy().hasHeightForWidth() ) ); layoutBtn->addWidget( btn2, 0, 1 ); - tqlayout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 ); + layout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 ); // --END-- building a dynamic dialog //connect the buttons to the TQDialog default slots @@ -729,7 +729,7 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ bool bReturn = false; //resize the textedits if (iWidth > 1) { - TQRect r = dlg.tqgeometry(); + TQRect r = dlg.geometry(); r.setHeight(iBasicHeight + iOneHeight*mapVar2Te.count()); r.setWidth(iWidth); dlg.setGeometry(r); @@ -750,9 +750,9 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ } bReturn = true; - iBasicHeight = dlg.tqgeometry().height() - layoutVar->tqgeometry().height(); - iOneHeight = layoutVar->tqgeometry().height() / mapVar2Te.count(); - iWidth = dlg.tqgeometry().width(); + iBasicHeight = dlg.geometry().height() - layoutVar->geometry().height(); + iOneHeight = layoutVar->geometry().height() / mapVar2Te.count(); + iWidth = dlg.geometry().width(); } //do some cleanup @@ -767,7 +767,7 @@ bool SnippetWidget::showMultiVarDialog(TQMap<TQString, TQString> * map, TQMap<TQ delete layoutTop; delete layoutVar; delete layoutBtn; - delete tqlayout; + delete layout; if (i==0) //if nothing happened this means, that there are no variables to translate return true; //.. so just return OK @@ -788,7 +788,7 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri TQDialog dlg(this); dlg.setCaption(i18n("Enter Values for Variables")); - TQGridLayout * tqlayout = new TQGridLayout( &dlg, 1, 1, 11, 6, "tqlayout"); + 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"); @@ -799,8 +799,8 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri labTop = new TQLabel( &dlg, "label" ); layoutTop->addWidget(labTop, 0, 0); - labTop->setText(i18n("Enter the replacement values for %1:").tqarg( var )); - tqlayout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 ); + labTop->setText(i18n("Enter the replacement values for %1:").arg( var )); + layout->addMultiCellLayout( layoutTop, 0, 0, 0, 1 ); cb = new TQCheckBox( &dlg, "cbVar" ); @@ -820,7 +820,7 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri "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.") ); - tqlayout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 ); + layout->addMultiCellLayout( layoutVar, 1, 1, 0, 1 ); KPushButton * btn1 = new KPushButton( KStdGuiItem::cancel(), &dlg, "pushButton1" ); layoutBtn->addWidget( btn1, 0, 0 ); @@ -829,7 +829,7 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri btn2->setDefault( TRUE ); layoutBtn->addWidget( btn2, 0, 1 ); - tqlayout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 ); + layout->addMultiCellLayout( layoutBtn, 2, 2, 0, 1 ); te->setFocus(); // --END-- building a dynamic dialog @@ -849,7 +849,7 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri strReturn = te->text(); //copy the entered values back the the given map - dlgSize = dlg.tqgeometry(); + dlgSize = dlg.geometry(); } //do some cleanup @@ -861,7 +861,7 @@ TQString SnippetWidget::showSingleVarDialog(TQString var, TQMap<TQString, TQStri delete layoutTop; delete layoutVar; delete layoutBtn; - delete tqlayout; + delete layout; return strReturn; } @@ -912,7 +912,7 @@ void SnippetWidget::slotDropped(TQDropEvent *e, TQListViewItem *) group = dynamic_cast<SnippetGroup *>(item2->parent()); TQCString dropped; - TQByteArray data = e->tqencodedData("text/plain"); + TQByteArray data = e->encodedData("text/plain"); if ( e->provides("text/plain") && data.size()>0 ) { //get the data from the event... TQString encData(data.data()); |