| 1 | /* smplayer, GUI front-end for mplayer.
|
|---|
| 2 | Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
|
|---|
| 3 |
|
|---|
| 4 | This program is free software; you can redistribute it and/or modify
|
|---|
| 5 | it under the terms of the GNU General Public License as published by
|
|---|
| 6 | the Free Software Foundation; either version 2 of the License, or
|
|---|
| 7 | (at your option) any later version.
|
|---|
| 8 |
|
|---|
| 9 | This program is distributed in the hope that it will be useful,
|
|---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 12 | GNU General Public License for more details.
|
|---|
| 13 |
|
|---|
| 14 | You should have received a copy of the GNU General Public License
|
|---|
| 15 | along with this program; if not, write to the Free Software
|
|---|
| 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | #include "sharedata.h"
|
|---|
| 20 | #include "links.h"
|
|---|
| 21 | #include <QObject>
|
|---|
| 22 |
|
|---|
| 23 | QUrl ShareData::donateUrl() {
|
|---|
| 24 | return QUrl(URL_DONATE);
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | QUrl ShareData::facebookUrl() {
|
|---|
| 28 | QString share_url = URL_HOMEPAGE;
|
|---|
| 29 | return QUrl("http://www.facebook.com/sharer.php?u=" + share_url);
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
| 32 | QUrl ShareData::twitterUrl() {
|
|---|
| 33 | QString share_url = URL_HOMEPAGE;
|
|---|
| 34 |
|
|---|
| 35 | /*
|
|---|
| 36 | QString text = QObject::tr("SMPlayer is a free media player for PC. It plays all formats and can even download Youtube videos.",
|
|---|
| 37 | "This text is to be published on twitter and the translation should not be more than 99 characters long");
|
|---|
| 38 | */
|
|---|
| 39 |
|
|---|
| 40 | QString text = QObject::tr("SMPlayer is my favorite media player for my PC. Check it out!",
|
|---|
| 41 | "This text is to be published on twitter and the translation should not be more than 99 characters long");
|
|---|
| 42 |
|
|---|
| 43 | qDebug("ShareData::twitterUrl: length: %d", text.length());
|
|---|
| 44 | if (text.length() > 99) {
|
|---|
| 45 | qDebug("ShareData::twitterUrl: the translation text is too long (%d), it shouldn't be longer than 99 characters. Using the English text.", text.length());
|
|---|
| 46 | text = "SMPlayer is a free media player for PC. It plays all formats and can even download Youtube videos.";
|
|---|
| 47 | }
|
|---|
| 48 | text = text.replace("SMPlayer", "#SMPlayer");
|
|---|
| 49 | text = text.replace("media player", "#mediaplayer");
|
|---|
| 50 | text = QUrl::toPercentEncoding(text);
|
|---|
| 51 | QString url = "http://twitter.com/intent/tweet?text=" + text + "&url=" + QUrl::toPercentEncoding(share_url);
|
|---|
| 52 | /* url += "/&via=smplayer_dev"; */
|
|---|
| 53 | return QUrl::fromEncoded(url.toLatin1());
|
|---|
| 54 | }
|
|---|
| 55 |
|
|---|