Added new url handler to QDesktopServices for the handling of RetroShare-Links application (RetroShare) wide.

Removed all connects of the signal anchorClicked of the QTextBrowser instances.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3814 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-11-18 01:18:31 +00:00
parent 7a1cd7841c
commit 8c2f06d963
14 changed files with 22 additions and 65 deletions

View file

@ -25,6 +25,8 @@
#include <QIcon>
#include <QPixmap>
#include <QColorDialog>
#include <QDesktopServices>
#include <QUrl>
#ifdef BLOGS
#include "gui/unfinished/blogs/BlogsDialog.h"
@ -51,6 +53,7 @@
#include "bwgraph/bwgraph.h"
#include "help/browser/helpbrowser.h"
#include "chat/PopupChatDialog.h"
#include "RetroShareLink.h"
#ifdef UNFINISHED
#include "unfinished/ApplicationWindow.h"
@ -155,6 +158,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
setWindowTitle(tr("RetroShare %1 a secure decentralised communication platform").arg(retroshareVersion()));
/* add url handler for RetroShare links */
QDesktopServices::setUrlHandler("retroshare", this, "linkActivated");
// Setting icons
this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
@ -1181,3 +1187,8 @@ void MainWindow::statusChangedComboBox(int index)
/* no object known */
setStatus(NULL, statusComboBox->itemData(index, Qt::UserRole).toInt());
}
void MainWindow::linkActivated(const QUrl &url)
{
RetroShareLink::processUrl(url, RSLINK_PROCESS_NOTIFY_ALL);
}