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

@ -126,7 +126,6 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi
connect(ui.actionSave_Chat_History, SIGNAL(triggered()), this, SLOT(fileSaveAs()));
connect(ui.actionClearOfflineMessages, SIGNAL(triggered()), this, SLOT(clearOfflineMessages()));
connect(ui.textBrowser, SIGNAL(anchorClicked(const QUrl &)), SLOT(anchorClicked(const QUrl &)));
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(const QString&, int)), this, SLOT(updateStatus(const QString&, int)));
connect(NotifyQt::getInstance(), SIGNAL(peerHasNewCustomStateString(const QString&, const QString&)), this, SLOT(updatePeersCustomStateString(const QString&, const QString&)));
@ -138,9 +137,6 @@ PopupChatDialog::PopupChatDialog(const std::string &id, const QString &name, QWi
// Create the status bar
resetStatusBar();
//ui.textBrowser->setOpenExternalLinks ( false );
//ui.textBrowser->setOpenLinks ( false );
ui.textboldButton->setIcon(QIcon(QString(":/images/edit-bold.png")));
ui.textunderlineButton->setIcon(QIcon(QString(":/images/edit-underline.png")));
ui.textitalicButton->setIcon(QIcon(QString(":/images/edit-italic.png")));
@ -1002,7 +998,7 @@ void PopupChatDialog::fileHashingFinished(AttachFileItem* file)
message+= RetroShareLink(QString::fromUtf8(file->FileName().c_str()),file->FileSize(),QString::fromStdString(file->FileHash())).toHtmlSize();
#ifdef CHAT_DEBUG
std::cerr << "PopupChatDialog::anchorClicked message : " << message.toStdString() << std::endl;
std::cerr << "PopupChatDialog::fileHashingFinished message : " << message.toStdString() << std::endl;
#endif
std::wstring msg = message.toStdWString();
@ -1013,16 +1009,6 @@ void PopupChatDialog::fileHashingFinished(AttachFileItem* file)
}
}
void PopupChatDialog::anchorClicked (const QUrl& link )
{
#ifdef CHAT_DEBUG
std::cerr << "PopupChatDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
#endif
std::list<std::string> srcIds;
RetroShareLink::processUrl(link, RSLINK_PROCESS_NOTIFY_ALL);
}
void PopupChatDialog::dropEvent(QDropEvent *event)
{
if (!(Qt::CopyAction & event->possibleActions()))