From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/plugins/autoreplace/autoreplaceconfig.cpp | 18 +++---- kopete/plugins/autoreplace/autoreplaceconfig.h | 10 ++-- kopete/plugins/autoreplace/autoreplaceplugin.cpp | 28 +++++----- kopete/plugins/autoreplace/autoreplaceplugin.h | 10 ++-- .../plugins/autoreplace/autoreplacepreferences.cpp | 62 +++++++++++----------- .../plugins/autoreplace/autoreplacepreferences.h | 6 +-- 6 files changed, 67 insertions(+), 67 deletions(-) (limited to 'kopete/plugins/autoreplace') diff --git a/kopete/plugins/autoreplace/autoreplaceconfig.cpp b/kopete/plugins/autoreplace/autoreplaceconfig.cpp index 0407990a..2537f44a 100644 --- a/kopete/plugins/autoreplace/autoreplaceconfig.cpp +++ b/kopete/plugins/autoreplace/autoreplaceconfig.cpp @@ -33,7 +33,7 @@ void AutoReplaceConfig::load() KConfig *config = KGlobal::config(); config->setGroup( "AutoReplace Plugin" ); - QStringList wordsList = config->readListEntry( "WordsToReplace" ); + TQStringList wordsList = config->readListEntry( "WordsToReplace" ); if( wordsList.isEmpty() ) { // basic list, key/value @@ -44,8 +44,8 @@ void AutoReplaceConfig::load() // we may be reloading after removing an entry from the list m_map.clear(); - QString k, v; - for ( QStringList::Iterator it = wordsList.begin(); it != wordsList.end(); ++it ) + TQString k, v; + for ( TQStringList::Iterator it = wordsList.begin(); it != wordsList.end(); ++it ) { k = *it; ++it; @@ -61,18 +61,18 @@ void AutoReplaceConfig::load() m_upper = config->readBoolEntry( "CapitalizeBeginningSentence" , false ); } -QStringList AutoReplaceConfig::defaultAutoReplaceList() +TQStringList AutoReplaceConfig::defaultAutoReplaceList() { - return QStringList::split( ",", i18n( "list_of_words_to_replace", + return TQStringList::split( ",", i18n( "list_of_words_to_replace", "ur,your,r,are,u,you,theres,there is,arent,are not,dont,do not" ) ); } void AutoReplaceConfig::loadDefaultAutoReplaceList() { - QStringList wordsList = defaultAutoReplaceList(); + TQStringList wordsList = defaultAutoReplaceList(); m_map.clear(); - QString k, v; - for ( QStringList::Iterator it = wordsList.begin(); it != wordsList.end(); ++it ) + TQString k, v; + for ( TQStringList::Iterator it = wordsList.begin(); it != wordsList.end(); ++it ) { k = *it; v = *( ++it ); @@ -116,7 +116,7 @@ void AutoReplaceConfig::save() KConfig * config = KGlobal::config(); config->setGroup( "AutoReplace Plugin" ); - QStringList newWords; + TQStringList newWords; WordsToReplace::Iterator it; for ( it = m_map.begin(); it != m_map.end(); ++it ) { diff --git a/kopete/plugins/autoreplace/autoreplaceconfig.h b/kopete/plugins/autoreplace/autoreplaceconfig.h index 62b11fbf..b819098e 100644 --- a/kopete/plugins/autoreplace/autoreplaceconfig.h +++ b/kopete/plugins/autoreplace/autoreplaceconfig.h @@ -16,9 +16,9 @@ ************************************************************************* */ -#include -#include -#include +#include +#include +#include #ifndef AutoReplaceConfig_H #define AutoReplaceConfig_H @@ -31,7 +31,7 @@ public: void save(); void load(); - typedef QMap WordsToReplace; + typedef TQMap WordsToReplace; WordsToReplace map() const; bool autoReplaceIncoming() const; @@ -40,7 +40,7 @@ public: bool capitalizeBeginningSentence() const; void setMap( const WordsToReplace &w ); - QStringList defaultAutoReplaceList(); + TQStringList defaultAutoReplaceList(); void loadDefaultAutoReplaceList(); private: diff --git a/kopete/plugins/autoreplace/autoreplaceplugin.cpp b/kopete/plugins/autoreplace/autoreplaceplugin.cpp index c06bc0bd..f3610a7f 100644 --- a/kopete/plugins/autoreplace/autoreplaceplugin.cpp +++ b/kopete/plugins/autoreplace/autoreplaceplugin.cpp @@ -29,7 +29,7 @@ typedef KGenericFactory AutoReplacePluginFactory; K_EXPORT_COMPONENT_FACTORY( kopete_autoreplace, AutoReplacePluginFactory( "kopete_autoreplace" ) ) AutoReplacePlugin * AutoReplacePlugin::pluginStatic_ = 0L; -AutoReplacePlugin::AutoReplacePlugin( QObject *parent, const char * name, const QStringList & ) +AutoReplacePlugin::AutoReplacePlugin( TQObject *parent, const char * name, const TQStringList & ) : Kopete::Plugin( AutoReplacePluginFactory::instance(), parent, name ) { if( !pluginStatic_ ) @@ -37,16 +37,16 @@ AutoReplacePlugin::AutoReplacePlugin( QObject *parent, const char * name, const m_prefs = new AutoReplaceConfig; - connect( Kopete::ChatSessionManager::self(), SIGNAL( aboutToSend( Kopete::Message & ) ), - this, SLOT( slotAboutToSend( Kopete::Message & ) ) ); + connect( Kopete::ChatSessionManager::self(), TQT_SIGNAL( aboutToSend( Kopete::Message & ) ), + this, TQT_SLOT( slotAboutToSend( Kopete::Message & ) ) ); // nb this connection causes the slot to be called on in- and outbound // messages which suggests something is broken in the message handler // system! m_inboundHandler = new Kopete::SimpleMessageHandlerFactory( Kopete::Message::Inbound, - Kopete::MessageHandlerFactory::InStageToSent, this, SLOT( slotAboutToSend( Kopete::Message& ) ) ); + Kopete::MessageHandlerFactory::InStageToSent, this, TQT_SLOT( slotAboutToSend( Kopete::Message& ) ) ); - connect( this, SIGNAL( settingsChanged() ), this, SLOT( slotSettingsChanged() ) ); + connect( this, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT( slotSettingsChanged() ) ); } AutoReplacePlugin::~AutoReplacePlugin() @@ -71,21 +71,21 @@ void AutoReplacePlugin::slotAboutToSend( Kopete::Message &msg ) if ( ( msg.direction() == Kopete::Message::Outbound && m_prefs->autoReplaceOutgoing() ) || ( msg.direction() == Kopete::Message::Inbound && m_prefs->autoReplaceIncoming() ) ) { - QString replaced_message = msg.plainBody(); + TQString replaced_message = msg.plainBody(); AutoReplaceConfig::WordsToReplace map = m_prefs->map(); // replaces all matched words --> try to find a more 'economic' way // "\\b(%1)\\b" doesn't work when substituting /me. - QString match = "(^|\\s|\\.|\\;|\\,|\\:)(%1)(\\b)"; + TQString match = "(^|\\s|\\.|\\;|\\,|\\:)(%1)(\\b)"; AutoReplaceConfig::WordsToReplace::Iterator it; bool isReplaced=false; for ( it = map.begin(); it != map.end(); ++it ) { - QRegExp re( match.arg( QRegExp::escape( it.key() ) ) ); + TQRegExp re( match.arg( TQRegExp::escape( it.key() ) ) ); if( re.search( replaced_message ) != -1 ) { - QString before = re.cap(1); - QString after = re.cap(3); + TQString before = re.cap(1); + TQString after = re.cap(3); replaced_message.replace( re, before + map.find( it.key() ).data() + after ); isReplaced=true; } @@ -99,10 +99,10 @@ void AutoReplacePlugin::slotAboutToSend( Kopete::Message &msg ) { if ( m_prefs->dotEndSentence() ) { - QString replaced_message = msg.plainBody(); + TQString replaced_message = msg.plainBody(); // eventually add . at the end of the lines, sent lines only - replaced_message.replace( QRegExp( "([a-z])$" ), "\\1." ); - // replaced_message.replace(QRegExp( "([\\w])$" ), "\\1." ); + replaced_message.replace( TQRegExp( "([a-z])$" ), "\\1." ); + // replaced_message.replace(TQRegExp( "([\\w])$" ), "\\1." ); // the message is now the one with replaced words msg.setBody( replaced_message, Kopete::Message::PlainText ); @@ -110,7 +110,7 @@ void AutoReplacePlugin::slotAboutToSend( Kopete::Message &msg ) if( m_prefs->capitalizeBeginningSentence() ) { - QString replaced_message = msg.plainBody(); + TQString replaced_message = msg.plainBody(); // eventually start each sent line with capital letter // TODO ". " "? " "! " replaced_message[ 0 ] = replaced_message.at( 0 ).upper(); diff --git a/kopete/plugins/autoreplace/autoreplaceplugin.h b/kopete/plugins/autoreplace/autoreplaceplugin.h index 750f0614..7d9bcedf 100644 --- a/kopete/plugins/autoreplace/autoreplaceplugin.h +++ b/kopete/plugins/autoreplace/autoreplaceplugin.h @@ -18,10 +18,10 @@ #ifndef AutoReplacePLUGIN_H #define AutoReplacePLUGIN_H -#include -#include -#include -#include +#include +#include +#include +#include #include "kopetemessage.h" #include "kopeteplugin.h" @@ -42,7 +42,7 @@ class AutoReplacePlugin : public Kopete::Plugin public: static AutoReplacePlugin *plugin(); - AutoReplacePlugin( QObject *parent, const char *name, const QStringList &args ); + AutoReplacePlugin( TQObject *parent, const char *name, const TQStringList &args ); ~AutoReplacePlugin(); private slots: diff --git a/kopete/plugins/autoreplace/autoreplacepreferences.cpp b/kopete/plugins/autoreplace/autoreplacepreferences.cpp index 0a2a6b0f..4f852610 100644 --- a/kopete/plugins/autoreplace/autoreplacepreferences.cpp +++ b/kopete/plugins/autoreplace/autoreplacepreferences.cpp @@ -15,12 +15,12 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -36,10 +36,10 @@ typedef KGenericFactory AutoReplacePreferencesFactory; K_EXPORT_COMPONENT_FACTORY( kcm_kopete_autoreplace, AutoReplacePreferencesFactory( "kcm_kopete_autoreplace" ) ) -AutoReplacePreferences::AutoReplacePreferences( QWidget *parent, const char * /* name */, const QStringList &args ) +AutoReplacePreferences::AutoReplacePreferences( TQWidget *parent, const char * /* name */, const TQStringList &args ) : KCAutoConfigModule( AutoReplacePreferencesFactory::instance(), parent, args ) { - ( new QVBoxLayout( this ) )->setAutoAdd( true ); + ( new TQVBoxLayout( this ) )->setAutoAdd( true ); preferencesDialog = new AutoReplacePrefsUI( this ); // creates table columns (avoids new columns every time) @@ -48,16 +48,16 @@ AutoReplacePreferences::AutoReplacePreferences( QWidget *parent, const char * /* preferencesDialog->m_list->header()->setStretchEnabled( true , 1 ); // connect SIGNALS/SLOTS - connect( preferencesDialog->m_add, SIGNAL(pressed()), - SLOT( slotAddCouple()) ); - connect( preferencesDialog->m_edit, SIGNAL(pressed()), - SLOT( slotEditCouple()) ); - connect( preferencesDialog->m_remove, SIGNAL(pressed()), - SLOT(slotRemoveCouple()) ); - connect( preferencesDialog->m_list, SIGNAL(selectionChanged()), - SLOT(slotSelectionChanged()) ); - connect( preferencesDialog->m_key, SIGNAL(textChanged ( const QString & )), - SLOT( slotEnableAddEdit( const QString & )) ); + connect( preferencesDialog->m_add, TQT_SIGNAL(pressed()), + TQT_SLOT( slotAddCouple()) ); + connect( preferencesDialog->m_edit, TQT_SIGNAL(pressed()), + TQT_SLOT( slotEditCouple()) ); + connect( preferencesDialog->m_remove, TQT_SIGNAL(pressed()), + TQT_SLOT(slotRemoveCouple()) ); + connect( preferencesDialog->m_list, TQT_SIGNAL(selectionChanged()), + TQT_SLOT(slotSelectionChanged()) ); + connect( preferencesDialog->m_key, TQT_SIGNAL(textChanged ( const TQString & )), + TQT_SLOT( slotEnableAddEdit( const TQString & )) ); m_wordListChanged = false; @@ -90,7 +90,7 @@ void AutoReplacePreferences::load() for ( it = map.begin(); it != map.end(); ++it ) { // notice: insertItem is called automatically by the constructor - new QListViewItem( preferencesDialog->m_list, it.key(), it.data() ); + new TQListViewItem( preferencesDialog->m_list, it.key(), it.data() ); } m_wordListChanged = false; @@ -102,7 +102,7 @@ void AutoReplacePreferences::save() { // make a list reading all values from gui AutoReplaceConfig::WordsToReplace newWords; - for ( QListViewItem * i = preferencesDialog->m_list->firstChild(); i != 0; i = i->nextSibling() ) + for ( TQListViewItem * i = preferencesDialog->m_list->firstChild(); i != 0; i = i->nextSibling() ) newWords[ i->text( 0 ) ] = i->text( 1 ); // save the words list @@ -116,16 +116,16 @@ void AutoReplacePreferences::save() // read m_key m_value, create a QListViewItem void AutoReplacePreferences::slotAddCouple() { - QString k = preferencesDialog->m_key->text(); - QString v = preferencesDialog->m_value->text(); + TQString k = preferencesDialog->m_key->text(); + TQString v = preferencesDialog->m_value->text(); if ( !k.isEmpty() && !k.isNull() && !v.isEmpty() && !v.isNull() ) { - QListViewItem * lvi; - QListViewItem * oldLvi = 0; + TQListViewItem * lvi; + TQListViewItem * oldLvi = 0; // see if we are replacing an existing entry if ( ( oldLvi = preferencesDialog->m_list->findItem( k, 0 ) ) ) delete oldLvi; - lvi = new QListViewItem( preferencesDialog->m_list, k, v ); + lvi = new TQListViewItem( preferencesDialog->m_list, k, v ); // Triggers a size, geometry and content update // during the next iteration of the event loop preferencesDialog->m_list->triggerUpdate(); @@ -140,9 +140,9 @@ void AutoReplacePreferences::slotAddCouple() // edit the selected item void AutoReplacePreferences::slotEditCouple() { - QString k = preferencesDialog->m_key->text(); - QString v = preferencesDialog->m_value->text(); - QListViewItem * lvi; + TQString k = preferencesDialog->m_key->text(); + TQString v = preferencesDialog->m_value->text(); + TQListViewItem * lvi; if ( ( lvi = preferencesDialog->m_list->selectedItem() ) && !k.isEmpty() && !k.isNull() && !v.isEmpty() && !v.isNull() ) { lvi->setText( 0, k ); @@ -163,7 +163,7 @@ void AutoReplacePreferences::slotRemoveCouple() slotWidgetModified(); } -void AutoReplacePreferences::slotEnableAddEdit( const QString & keyText ) +void AutoReplacePreferences::slotEnableAddEdit( const TQString & keyText ) { preferencesDialog->m_add->setEnabled( !keyText.isEmpty() ); preferencesDialog->m_edit->setEnabled( !keyText.isEmpty() && preferencesDialog->m_list->selectedItem() ); @@ -171,7 +171,7 @@ void AutoReplacePreferences::slotEnableAddEdit( const QString & keyText ) void AutoReplacePreferences::slotSelectionChanged() { - QListViewItem *selection = 0; + TQListViewItem *selection = 0; if ( ( selection = preferencesDialog->m_list->selectedItem() ) ) { // enable the remove button @@ -203,7 +203,7 @@ void AutoReplacePreferences::defaults() for ( it = map.begin(); it != map.end(); ++it ) { // notice: insertItem is called automatically by the constructor - new QListViewItem( preferencesDialog->m_list, it.key(), it.data() ); + new TQListViewItem( preferencesDialog->m_list, it.key(), it.data() ); } m_wordListChanged = true; slotWidgetModified(); diff --git a/kopete/plugins/autoreplace/autoreplacepreferences.h b/kopete/plugins/autoreplace/autoreplacepreferences.h index a08b2ba2..00638bfa 100644 --- a/kopete/plugins/autoreplace/autoreplacepreferences.h +++ b/kopete/plugins/autoreplace/autoreplacepreferences.h @@ -25,7 +25,7 @@ class AutoReplaceConfig; // TODO // add button enabled only when k and v are present - // remove button enabled only when a QListViewItem is selected + // remove button enabled only when a TQListViewItem is selected // signal/slot when map changes (needed?) // capital letter not just at the beginning but always after ". ", "! "... @@ -34,7 +34,7 @@ class AutoReplacePreferences : public KCAutoConfigModule Q_OBJECT public: - AutoReplacePreferences( QWidget *parent = 0, const char *name = 0, const QStringList &args = QStringList() ); + AutoReplacePreferences( TQWidget *parent = 0, const char *name = 0, const TQStringList &args = TQStringList() ); ~AutoReplacePreferences(); virtual void save(); @@ -46,7 +46,7 @@ private slots: void slotAddCouple(); void slotEditCouple(); void slotRemoveCouple(); - void slotEnableAddEdit( const QString & ); + void slotEnableAddEdit( const TQString & ); void slotSelectionChanged(); protected slots: -- cgit v1.2.1