mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-27 08:25:53 -04:00
Adding a link from the browser now starts RetroShare when it is not running.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4157 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
20fa00c40e
commit
099cc6c11c
5 changed files with 19 additions and 17 deletions
|
@ -43,6 +43,7 @@
|
|||
#include "idle/idle.h"
|
||||
#include "gui/common/Emoticons.h"
|
||||
#include "util/EventReceiver.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
|
||||
/*** WINDOWS DON'T LIKE THIS - REDEFINES VER numbers.
|
||||
#include <gui/qskinobject/qskinobject.h>
|
||||
|
@ -108,12 +109,15 @@ int main(int argc, char *argv[])
|
|||
Rshare rshare(args, argc, argv,
|
||||
QString::fromStdString(RsInit::RsConfigDirectory()));
|
||||
|
||||
std::string link = RsInit::getRetroShareLink();
|
||||
if (!link.empty()) {
|
||||
std::string url = RsInit::getRetroShareLink();
|
||||
if (!url.empty()) {
|
||||
/* start with RetroShare link */
|
||||
EventReceiver eventReceiver;
|
||||
eventReceiver.sendRetroShareLink(QString::fromStdString(link));
|
||||
return 0;
|
||||
if (eventReceiver.sendRetroShareLink(QString::fromStdString(url))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Start RetroShare */
|
||||
}
|
||||
|
||||
QSplashScreen splashScreen(QPixmap(":/images/splash.png")/* , Qt::WindowStaysOnTopHint*/);
|
||||
|
@ -247,6 +251,14 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
if (!url.empty()) {
|
||||
/* Now use link from the command line, because no RetroShare was running */
|
||||
RetroShareLink link(QString::fromStdString(url));
|
||||
if (link.valid()) {
|
||||
w->linkActivated(link.toUrl());
|
||||
}
|
||||
}
|
||||
|
||||
// I'm using a signal to transfer the hashing info to the mainwindow, because Qt schedules signals properly to
|
||||
// avoid clashes between infos from threads.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue