[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [Konversation] 51f8645: Always use KDE default for mailto: URLs.
From:       Gary Cramblitt <garycramblitt () comcast ! net>
Date:       2010-07-01 13:27:15
Message-ID: 20100701132715.CC008BB556A () projects ! kde ! org
[Download RAW message or body]

commit 51f864596175a24feace02042d581f6945d81b93
Author: Gary Cramblitt <garycramblitt@comcast.net>
Date:   Fri Jan 9 20:05:35 2004 +0000

    Always use KDE default for mailto: URLs.
    
    svn path=/trunk/kdeextragear-2/konversation/; revision=278245

diff --git a/konversation/ircview.cpp b/konversation/ircview.cpp
index 30da77a..b50afe1 100644
--- a/konversation/ircview.cpp
+++ b/konversation/ircview.cpp
@@ -37,6 +37,7 @@
 #include <kbookmarkmanager.h>
 #include <kdeversion.h>
 #include <kstandarddirs.h>
+#include <krun.h>
 #include <kprocess.h>
 #include <kshell.h>
 
@@ -187,18 +188,26 @@ void IRCView::urlClickSlot(const QString &url)
 {
   if (!url.isEmpty())
   {
-    QString cmd = KonversationApplication::preferences.getWebBrowserCmd();
-    cmd.replace("%u", url);
-    KProcess *proc = new KProcess;
-    QStringList cmdAndArgs = KShell::splitArgs(cmd);
-    kdDebug() << "IRCView::urlClickSlot(): cmd = " << cmdAndArgs << endl;
-    *proc << cmdAndArgs;
-//    This code will also work, but starts an extra shell process.
-//    kdDebug() << "IRCView::urlClickSlot(): cmd = " << cmd << endl;
-//    *proc << cmd;
-//    proc->setUseShell(true);
-    proc->start(KProcess::DontCare);
-    delete proc;
+    // Always use KDE default mailer.
+    if (url.startsWith("mailto:", false))
+    {
+      new KRun(url);
+    }
+    else
+    {
+      QString cmd = KonversationApplication::preferences.getWebBrowserCmd();
+      cmd.replace("%u", url);
+      KProcess *proc = new KProcess;
+      QStringList cmdAndArgs = KShell::splitArgs(cmd);
+      kdDebug() << "IRCView::urlClickSlot(): cmd = " << cmdAndArgs << endl;
+      *proc << cmdAndArgs;
+//      This code will also work, but starts an extra shell process.
+//      kdDebug() << "IRCView::urlClickSlot(): cmd = " << cmd << endl;
+//      *proc << cmd;
+//      proc->setUseShell(true);
+      proc->start(KProcess::DontCare);
+      delete proc;
+    }
   }
 }
 
diff --git a/konversation/urlcatcher.cpp b/konversation/urlcatcher.cpp
index 135507a..02cc8a1 100644
--- a/konversation/urlcatcher.cpp
+++ b/konversation/urlcatcher.cpp
@@ -93,11 +93,13 @@ void UrlCatcher::addUrl(const QString& who,const QString& url)
 
 void UrlCatcher::openUrl(QListViewItem* item)
 {
-  if (KonversationApplication::preferences.getWebBrowserUseKdeDefault())
-    new KRun(item->text(1));
+  QString url = item->text(1);
+  if (KonversationApplication::preferences.getWebBrowserUseKdeDefault() || \
url.startsWith("mailto:", false) ) +  {
+    new KRun(url);
+  }
   else
   {
-    QString url = item->text(1);
     QString cmd = KonversationApplication::preferences.getWebBrowserCmd();
     cmd.replace("%u", url);
     KProcess *proc = new KProcess;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic