[Kde-pim] Text formatting stripped from text pasted into kmail composer.

Stephen Kelly steveire at gmail.com
Thu Apr 3 20:01:31 BST 2008


Thomas McGuire wrote:
> I committed the patch now, and made some adjustments (refer to the commit
> log for details).
> I think it is ready to move to kdelibs now, should I go ahead with the
> move and send a patch to kde-core-devel?
> 
> Regards,
> Thomas

I was going to suggest adding a d-pointer too, but I see you've done that.
Regarding the http:// by default, we could put in a check to see if it's an
email address either. I think it a bigger issue for it to fail
on 'www.google.com' than to fail on 'obscureprotocol\£>someurl'.
'www.google.com' should work.

Thanks for putting the finishing touches on the patch. If k-c-d approves I
think it's ready to go in. I can still add the icon to the statusbar later,
right?

Regards,

Steve.

 QString KLinkDialog::linkUrl() const
 {
-    return d->linkUrlLineEdit->text();
+    QString linkText = d->linkUrlLineEdit->text();
+
+    if ( linkText.contains(":/") ) {
+        return linkText;
+    }
+    else if (linkText.contains("@"){
+        return "mailto:" + linkText;
+    }
+    else if (!linkText.trimmed().isEmpty()) {
+        return "http://" + linkText;
+    }
+    else {
+        return QString();
+    }
 }

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list