diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/plugins/autoreplace/autoreplaceplugin.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/plugins/autoreplace/autoreplaceplugin.cpp')
-rw-r--r-- | kopete/plugins/autoreplace/autoreplaceplugin.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
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<AutoReplacePlugin> 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(); |