[Konversation-devel] [Bug 88533] Allow defining multiple commands

Dario Abatianni eisfuchs at tigress.com
Sat Jan 14 02:58:48 CET 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=88533         
eisfuchs tigress com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From eisfuchs tigress com  2006-01-14 02:58 -------
SVN commit 497864 by abatianni:

BUG:88533 - make multi line aliases work, use %n as separator

 M  +34 -32    channel.cpp  
 M  +21 -14    query.cpp  
 M  +16 -10    statuspanel.cpp  


--- trunk/extragear/network/konversation/src/channel.cpp #497863:497864
 @ -821,35 +821,42  @
 void Channel::sendChannelText(const QString& sendLine)
 {
     // create a work copy
-    QString output(sendLine);
+    QString outputAll(sendLine);
     // replace aliases and wildcards
-    if(m_server->getOutputFilter()->replaceAliases(output))
+    if(m_server->getOutputFilter()->replaceAliases(outputAll))
     {
-        output = m_server->parseWildcards(output,m_server->getNickname(),getName(),getKey(),
+        outputAll = m_server->parseWildcards(outputAll,m_server->getNickname(),getName(),getKey(),
             getSelectedNickList(),QString::null);
     }
 
-    // encoding stuff is done in Server()
-    Konversation::OutputFilterResult result = m_server->getOutputFilter()->parse(m_server->getNickname(),output,getName());
+    // Send all strings, one after another
+    QStringList outList=QStringList::split('\n',outputAll);
+    for(unsigned int index=0;index<outList.count();index++)
+    {
+        QString output(outList[index]);
 
-    // Is there something we need to display for ourselves?
-    if(!result.output.isEmpty())
-    {
-        if(result.type == Konversation::Action) appendAction(m_server->getNickname(), result.output);
-        else if(result.type == Konversation::Command) appendCommandMessage(result.typeString, result.output);
-        else if(result.type == Konversation::Program) appendServerMessage(result.typeString, result.output);
-        else if(result.type == Konversation::Query) appendQuery(result.typeString, result.output);
-        else append(m_server->getNickname(), result.output);
-    }
-    // Send anything else to the server
-    if(!result.toServer.isEmpty())
-    {
-        m_server->queue(result.toServer);
-    }
-    else
-    {
-        m_server->queueList(result.toServerList);
-    }
+        // encoding stuff is done in Server()
+        Konversation::OutputFilterResult result = m_server->getOutputFilter()->parse(m_server->getNickname(),output,getName());
+
+        // Is there something we need to display for ourselves?
+        if(!result.output.isEmpty())
+        {
+            if(result.type == Konversation::Action) appendAction(m_server->getNickname(), result.output);
+            else if(result.type == Konversation::Command) appendCommandMessage(result.typeString, result.output);
+            else if(result.type == Konversation::Program) appendServerMessage(result.typeString, result.output);
+            else if(result.type == Konversation::Query) appendQuery(result.typeString, result.output);
+            else append(m_server->getNickname(), result.output);
+        }
+        // Send anything else to the server
+        if(!result.toServer.isEmpty())
+        {
+            m_server->queue(result.toServer);
+        }
+        else
+        {
+            m_server->queueList(result.toServerList);
+        }
+    } // for
 }
 
 void Channel::setNickname(const QString& newNickname)
 @ -948,18 +955,13  @
 {
     // parse wildcards (toParse,nickname,channelName,nickList,queryName,parameter)
     QString out=m_server->parseWildcards(buttonText,m_server->getNickname(),getName(),getKey(),getSelectedNickList(),QString::null);
+
     // are there any newlines in the definition?
     if(out.find('\n')!=-1)
-    {
-        // Send all strings, one after another
-        QStringList outList=QStringList::split('\n',out);
-        for(unsigned int index=0;index<outList.count();index++)
-        {
-            sendChannelText(outList[index]);
-        }
-    }
+        sendChannelText(out);
     // single line without newline needs to be copied into input line
-    else channelInput->setText(out);
+    else
+        channelInput->setText(out);
 }
 
 void Channel::addNickname(ChannelNickPtr channelnick)
--- trunk/extragear/network/konversation/src/query.cpp #497863:497864
 @ -179,26 +179,33  @
 void Query::sendQueryText(const QString& sendLine)
 {
     // create a work copy
-    QString output(sendLine);
+    QString outputAll(sendLine);
     // replace aliases and wildcards
-    if(m_server->getOutputFilter()->replaceAliases(output))
+    if(m_server->getOutputFilter()->replaceAliases(outputAll))
     {
-        output = m_server->parseWildcards(output, m_server->getNickname(), getName(), QString::null, QString::null, QString::null);
+        outputAll = m_server->parseWildcards(outputAll, m_server->getNickname(), getName(), QString::null, QString::null, QString::null);
     }
 
-    // encoding stuff is done in Server()
-    Konversation::OutputFilterResult result = m_server->getOutputFilter()->parse(m_server->getNickname(), output, getName());
-
-    if(!result.output.isEmpty())
+    // Send all strings, one after another
+    QStringList outList=QStringList::split('\n',outputAll);
+    for(unsigned int index=0;index<outList.count();index++)
     {
-        if(result.type == Konversation::Action) appendAction(m_server->getNickname(), result.output);
-        else if(result.type == Konversation::Command) appendCommandMessage(result.typeString, result.output);
-        else if(result.type == Konversation::Program) appendServerMessage(result.typeString, result.output);
-        else if(!result.typeString.isEmpty()) appendQuery(result.typeString, result.output);
-        else appendQuery(m_server->getNickname(), result.output);
-    }
+        QString output(outList[index]);
 
-    m_server->queue(result.toServer);
+        // encoding stuff is done in Server()
+        Konversation::OutputFilterResult result = m_server->getOutputFilter()->parse(m_server->getNickname(), output, getName());
+
+        if(!result.output.isEmpty())
+        {
+            if(result.type == Konversation::Action) appendAction(m_server->getNickname(), result.output);
+            else if(result.type == Konversation::Command) appendCommandMessage(result.typeString, result.output);
+            else if(result.type == Konversation::Program) appendServerMessage(result.typeString, result.output);
+            else if(!result.typeString.isEmpty()) appendQuery(result.typeString, result.output);
+            else appendQuery(m_server->getNickname(), result.output);
+        }
+
+        m_server->queue(result.toServer);
+    } // for
 }
 
 void Query::updateAppearance()
--- trunk/extragear/network/konversation/src/statuspanel.cpp #497863:497864
 @ -103,22 +103,28  @
 void StatusPanel::sendStatusText(const QString& sendLine)
 {
     // create a work copy
-    QString output(sendLine);
+    QString outputAll(sendLine);
     // replace aliases and wildcards
-    if(m_server->getOutputFilter()->replaceAliases(output))
+    if(m_server->getOutputFilter()->replaceAliases(outputAll))
     {
-        output = m_server->parseWildcards(output, m_server->getNickname(), QString::null, QString::null, QString::null, QString::null);
+        outputAll = m_server->parseWildcards(outputAll, m_server->getNickname(), QString::null, QString::null, QString::null, QString::null);
     }
 
-    // encoding stuff is done in Server()
-    Konversation::OutputFilterResult result = m_server->getOutputFilter()->parse(m_server->getNickname(), output, QString::null);
-
-    if(!result.output.isEmpty())
+    // Send all strings, one after another
+    QStringList outList=QStringList::split('\n',outputAll);
+    for(unsigned int index=0;index<outList.count();index++)
     {
-        appendServerMessage(result.typeString, result.output);
-    }
+        QString output(outList[index]);
 
-    m_server->queue(result.toServer);
+        // encoding stuff is done in Server()
+        Konversation::OutputFilterResult result = m_server->getOutputFilter()->parse(m_server->getNickname(), output, QString::null);
+
+        if(!result.output.isEmpty())
+        {
+            appendServerMessage(result.typeString, result.output);
+        }
+        m_server->queue(result.toServer);
+    } // for
 }
 
 void StatusPanel::statusTextEntered()


More information about the Konversation-devel mailing list