Skip to content
Browse files

Fix translators' webpage links

  • Loading branch information...
1 parent ab3ad7a commit 9645e509dd1040600530e9174ee8647dfaeed64d @amoskvin amoskvin committed Jan 11, 2013
Showing with 6 additions and 5 deletions.
  1. +6 −5 libraries/razorqt/translatorsinfo/translatorsinfo.cpp
View
11 libraries/razorqt/translatorsinfo/translatorsinfo.cpp
@@ -30,6 +30,7 @@
#include <QtCore/QSettings>
#include <QtCore/QStringList>
#include <QtCore/QTextCodec>
+#include <QtGui/QTextDocument>
void fillLangguages(QMap<QString, QString> *languages)
{
@@ -400,8 +401,6 @@ Translator::Translator(const QString &englishName, const QString &nativeName, co
mNativeName = nativeName;
mContact = contact;
- mContact = mContact.remove("mailto:");
- mContact = mContact.remove("http:");
if (mNativeName.isEmpty())
mInfo = QString("%1").arg(mEnglishName);
@@ -410,10 +409,12 @@ Translator::Translator(const QString &englishName, const QString &nativeName, co
if (!mContact.isEmpty())
{
- if (contact.contains("@"))
- mInfo = QString(" <a href='mailto:%1'>%2</a>").arg(contact, mInfo);
+ if (mContact.contains(QRegExp("^(https?|mailto):")))
+ mInfo = QString(" <a href='%1'>%2</a>").arg(contact, Qt::escape(mInfo));
+ else if (contact.contains("@") || contact.contains("<"))
+ mInfo = QString(" <a href='mailto:%1'>%2</a>").arg(contact, Qt::escape(mInfo));
else
- mInfo = QString(" <a href='http:%1'>%2</a>").arg(contact, mInfo);
+ mInfo = QString(" <a href='http://%1'>%2</a>").arg(contact, Qt::escape(mInfo));
}
}

0 comments on commit 9645e50

Please sign in to comment.
Something went wrong with that request. Please try again.