summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2011-04-17 13:14:16 +0200
committerTomas Chvatal <scarabeus@gentoo.org>2011-04-17 13:14:21 +0200
commitf808bae6e4e16b3842aa6a84d75f07059022fc29 (patch)
tree8c52ab93f1836afaecd93ec28eaed20eae1c801a
parentb68254443af69a07bc917d7cc4bcaf88f9ef61dc (diff)
downloadkde-f808bae6e4e16b3842aa6a84d75f07059022fc29.tar.gz
kde-f808bae6e4e16b3842aa6a84d75f07059022fc29.tar.bz2
kde-f808bae6e4e16b3842aa6a84d75f07059022fc29.zip
[kde-base/kmail] Add patch to fix from/to encodings in kmail.
-rw-r--r--kde-base/kmail/files/4.5.95-encodings.patch87
-rw-r--r--kde-base/kmail/kmail-4.5.95-r1.ebuild (renamed from kde-base/kmail/kmail-4.5.95.ebuild)4
2 files changed, 91 insertions, 0 deletions
diff --git a/kde-base/kmail/files/4.5.95-encodings.patch b/kde-base/kmail/files/4.5.95-encodings.patch
new file mode 100644
index 00000000000..343aee26bc0
--- /dev/null
+++ b/kde-base/kmail/files/4.5.95-encodings.patch
@@ -0,0 +1,87 @@
+From: Thomas McGuire <mcguire@kde.org>
+Date: Sat, 16 Apr 2011 19:24:01 +0000
+Subject: Handle mailto URLs with non-ASCII names correctly.
+X-Git-Url: http://quickgit.kde.org/?p=kdepim.git&amp;a=commitdiff&amp;h=115954932f961a1d9ef5f1c3a1230a750ecb4750
+---
+Handle mailto URLs with non-ASCII names correctly.
+
+The problem was the conversion from QUrl to QString, which made it
+impossible to re-parse the URL later.
+Avoid this conversion.
+
+BUG: 270560
+---
+
+
+--- a/messageviewer/mailwebview.h
++++ b/messageviewer/mailwebview.h
+@@ -100,7 +100,7 @@ Q_SIGNALS:
+ /// Emitted when the user right-clicks somewhere
+ /// @param url if an URL was under the cursor, this parameter contains it. Otherwise empty
+ /// @param point position where the click happened, in local coordinates
+- void popupMenu( const QString &url, const QPoint &point );
++ void popupMenu( const QUrl &url, const QPoint &point );
+
+ void linkHovered( const QString & link, const QString & title=QString(), const QString & textContent=QString() );
+ #ifdef KDEPIM_NO_WEBKIT
+
+--- a/messageviewer/mailwebview_webkit.cpp
++++ b/messageviewer/mailwebview_webkit.cpp
+@@ -73,7 +73,7 @@ bool MailWebView::event( QEvent *event )
+ #ifdef Q_OS_WINCE
+ if ( !hit.linkUrl().isEmpty() )
+ #endif
+- emit popupMenu( hit.linkUrl().toString(), mapToGlobal( contextMenuEvent->pos() ) );
++ emit popupMenu( hit.linkUrl(), mapToGlobal( contextMenuEvent->pos() ) );
+ event->accept();
+ return true;
+ }
+
+--- a/messageviewer/viewer_p.cpp
++++ b/messageviewer/viewer_p.cpp
+@@ -943,8 +943,8 @@ void ViewerPrivate::initHtmlWidget()
+ this, SLOT(slotUrlOn(QString,QString,QString)) );
+ connect( mViewer, SIGNAL(linkClicked(QUrl)),
+ this, SLOT(slotUrlOpen(QUrl)), Qt::QueuedConnection );
+- connect( mViewer, SIGNAL(popupMenu(QString,QPoint) ),
+- SLOT(slotUrlPopup(QString,QPoint)) );
++ connect( mViewer, SIGNAL(popupMenu(QUrl,QPoint) ),
++ SLOT(slotUrlPopup(QUrl,QPoint)) );
+ }
+
+ bool ViewerPrivate::eventFilter( QObject *, QEvent *e )
+@@ -1772,7 +1772,11 @@ void ViewerPrivate::slotUrlOn(const QStr
+ {
+ Q_UNUSED(title)
+ Q_UNUSED(textContent)
+- const KUrl url(link);
++
++ // The "link" we get here is not URL-encoded, and therefore there is no way the KUrl or QUrl could
++ // parse it correctly. To workaround that, we use QWebFrame::hitTestContent() on the mouse position
++ // to get the URL before WebKit managed to mangle it.
++ KUrl url( mViewer->linkOrImageUrlAt( QCursor::pos() ) );
+ if ( url.protocol() == "kmail" || url.protocol() == "x-kmail" || url.protocol() == "attachment" ||
+ ( url.protocol().isEmpty() && url.path().isEmpty() ) ) {
+ mViewer->setAcceptDrops( false );
+@@ -1799,7 +1803,7 @@ void ViewerPrivate::slotUrlOn(const QStr
+ emit showStatusBarMessage( msg );
+ }
+
+-void ViewerPrivate::slotUrlPopup(const QString &aUrl, const QPoint& aPos)
++void ViewerPrivate::slotUrlPopup(const QUrl &aUrl, const QPoint& aPos)
+ {
+ const KUrl url( aUrl );
+ mClickedUrl = url;
+
+--- a/messageviewer/viewer_p.h
++++ b/messageviewer/viewer_p.h
+@@ -465,7 +465,7 @@ public slots:
+ void slotUrlOn(const QString & link, const QString & title, const QString & textContent);
+
+ /** The user presses the right mouse button on an URL. */
+- void slotUrlPopup(const QString &, const QPoint& mousePos);
++ void slotUrlPopup(const QUrl &, const QPoint& mousePos);
+
+ /** The user selected "Find" from the menu. */
+ void slotFind();
+
diff --git a/kde-base/kmail/kmail-4.5.95.ebuild b/kde-base/kmail/kmail-4.5.95-r1.ebuild
index a4c86799ad6..f829b494492 100644
--- a/kde-base/kmail/kmail-4.5.95.ebuild
+++ b/kde-base/kmail/kmail-4.5.95-r1.ebuild
@@ -54,6 +54,10 @@ KMEXTRA="
KMLOADLIBS="kdepim-common-libs"
+PATCHES=(
+ "${FILESDIR}/${PV}-encodings.patch"
+)
+
src_configure() {
# Bug 308903
use ppc64 && append-flags -mminimal-toc