diff --git a/QuiteRSS.qrc b/QuiteRSS.qrc index 50bb6c4ca..e989565b6 100644 --- a/QuiteRSS.qrc +++ b/QuiteRSS.qrc @@ -166,5 +166,6 @@ images/share/vk.png images/share/instapaper.png images/share/reddit.ico + images/share/hackernews.png diff --git a/images/share/hackernews.png b/images/share/hackernews.png new file mode 100644 index 000000000..76b38a791 Binary files /dev/null and b/images/share/hackernews.png differ diff --git a/src/application/mainwindow.cpp b/src/application/mainwindow.cpp index 39a85256b..6b0d3dcf2 100644 --- a/src/application/mainwindow.cpp +++ b/src/application/mainwindow.cpp @@ -1447,6 +1447,12 @@ void MainWindow::createActions() redditShareAct_->setIcon(QIcon(":/share/images/share/reddit.ico")); shareGroup_->addAction(redditShareAct_); + hackerNewsShareAct_ = new QAction(this); + hackerNewsShareAct_->setObjectName("hackerNewsShareAct"); + hackerNewsShareAct_->setText("HackerNews"); + hackerNewsShareAct_->setIcon(QIcon(":/share/images/share/hackernews.png")); + shareGroup_->addAction(hackerNewsShareAct_); + this->addActions(shareGroup_->actions()); connect(shareGroup_, SIGNAL(triggered(QAction*)), this, SLOT(slotShareNews(QAction*))); diff --git a/src/application/mainwindow.h b/src/application/mainwindow.h index 3245a5560..3f538e796 100644 --- a/src/application/mainwindow.h +++ b/src/application/mainwindow.h @@ -164,6 +164,7 @@ class MainWindow : public QMainWindow QAction *printfriendlyShareAct_; QAction *instapaperShareAct_; QAction *redditShareAct_; + QAction *hackerNewsShareAct_; QAction *copyLinkAct_; QAction *pageUpWebViewAct_; QAction *pageDownWebViewAct_; diff --git a/src/newstabwidget.cpp b/src/newstabwidget.cpp index 77d74d3b1..7cf19f478 100644 --- a/src/newstabwidget.cpp +++ b/src/newstabwidget.cpp @@ -2759,6 +2759,17 @@ void NewsTabWidget::slotShareNews(QAction *action) #else url.addQueryItem("url", linkString); url.addQueryItem("title", title); +#endif + } else if (action->objectName() == "hackerNewsShareAct") { + url.setUrl("http://news.ycombinator.com/submitlink"); +#ifdef HAVE_QT5 + QUrlQuery urlQuery; + urlQuery.addQueryItem("u", linkString); + urlQuery.addQueryItem("t", title); + url.setQuery(urlQuery); +#else + url.addQueryItem("u", linkString); + url.addQueryItem("t", title); #endif }