Some typos, show polls.

This commit is contained in:
Martin Rotter 2017-10-10 07:38:28 +02:00
parent 3a3c7157b9
commit ca2934806b
5 changed files with 22 additions and 13 deletions

View File

@ -170,6 +170,7 @@ int main(int argc, char* argv[]) {
qApp->system()->checkForUpdates(); qApp->system()->checkForUpdates();
} }
qApp->showPolls();
qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->loadAllExpandStates(); qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->loadAllExpandStates();
// Enter global event loop. // Enter global event loop.

View File

@ -83,6 +83,12 @@ Application::~Application() {
qDebug("Destroying Application instance."); qDebug("Destroying Application instance.");
} }
void Application::showPolls() const {
if (isFirstRun(APP_VERSION)) {
web()->openUrlInExternalBrowser(QSL("https://goo.gl/forms/7bJNr33Ii22Q1c3k2"));
}
}
FeedReader* Application::feedReader() { FeedReader* Application::feedReader() {
return m_feedReader; return m_feedReader;
} }
@ -99,11 +105,11 @@ QList<QAction*> Application::userActions() {
return m_userActions; return m_userActions;
} }
bool Application::isFirstRun() { bool Application::isFirstRun() const {
return settings()->value(GROUP(General), SETTING(General::FirstRun)).toBool(); return settings()->value(GROUP(General), SETTING(General::FirstRun)).toBool();
} }
bool Application::isFirstRun(const QString& version) { bool Application::isFirstRun(const QString& version) const {
if (version == APP_VERSION) { if (version == APP_VERSION) {
// Check this only if checked version is equal to actual version. // Check this only if checked version is equal to actual version.
return settings()->value(GROUP(General), QString(General::FirstRun) + QL1C('_') + version, true).toBool(); return settings()->value(GROUP(General), QString(General::FirstRun) + QL1C('_') + version, true).toBool();
@ -113,7 +119,7 @@ bool Application::isFirstRun(const QString& version) {
} }
} }
WebFactory* Application::web() { WebFactory* Application::web() const {
return m_webFactory; return m_webFactory;
} }
@ -162,7 +168,7 @@ DownloadManager* Application::downloadManager() {
return m_downloadManager; return m_downloadManager;
} }
Settings* Application::settings() { Settings* Application::settings() const {
return m_settings; return m_settings;
} }

View File

@ -64,6 +64,8 @@ class Application : public QtSingleApplication {
explicit Application(const QString& id, int& argc, char** argv); explicit Application(const QString& id, int& argc, char** argv);
virtual ~Application(); virtual ~Application();
void showPolls() const;
FeedReader* feedReader(); FeedReader* feedReader();
void setFeedReader(FeedReader* feed_reader); void setFeedReader(FeedReader* feed_reader);
@ -72,19 +74,19 @@ class Application : public QtSingleApplication {
QList<QAction*> userActions(); QList<QAction*> userActions();
// Check whether this application starts for the first time (ever). // Check whether this application starts for the first time (ever).
bool isFirstRun(); bool isFirstRun() const;
// Check whether GIVEN VERSION of the application starts for the first time. // Check whether GIVEN VERSION of the application starts for the first time.
bool isFirstRun(const QString& version); bool isFirstRun(const QString& version) const;
WebFactory* web(); WebFactory* web() const;
SystemFactory* system(); SystemFactory* system();
SkinFactory* skins(); SkinFactory* skins();
Localization* localization(); Localization* localization();
DatabaseFactory* database(); DatabaseFactory* database();
IconFactory* icons(); IconFactory* icons();
DownloadManager* downloadManager(); DownloadManager* downloadManager();
Settings* settings(); Settings* settings() const;
Mutex* feedUpdateLock(); Mutex* feedUpdateLock();
FormMain* mainForm(); FormMain* mainForm();
QWidget* mainFormWidget(); QWidget* mainFormWidget();

View File

@ -62,7 +62,7 @@ bool WebFactory::sendMessageViaEmail(const Message& message) {
} }
} }
bool WebFactory::openUrlInExternalBrowser(const QString& url) { bool WebFactory::openUrlInExternalBrowser(const QString& url) const {
if (qApp->settings()->value(GROUP(Browser), SETTING(Browser::CustomExternalBrowserEnabled)).toBool()) { if (qApp->settings()->value(GROUP(Browser), SETTING(Browser::CustomExternalBrowserEnabled)).toBool()) {
const QString browser = qApp->settings()->value(GROUP(Browser), SETTING(Browser::CustomExternalBrowserExecutable)).toString(); const QString browser = qApp->settings()->value(GROUP(Browser), SETTING(Browser::CustomExternalBrowserExecutable)).toString();
const QString arguments = qApp->settings()->value(GROUP(Browser), SETTING(Browser::CustomExternalBrowserArguments)).toString(); const QString arguments = qApp->settings()->value(GROUP(Browser), SETTING(Browser::CustomExternalBrowserArguments)).toString();
@ -88,7 +88,7 @@ QString WebFactory::stripTags(QString text) {
QString WebFactory::escapeHtml(const QString& html) { QString WebFactory::escapeHtml(const QString& html) {
if (m_escapes.isEmpty()) { if (m_escapes.isEmpty()) {
genereteEscapes(); generateEscapes();
} }
QString output = html; QString output = html;
@ -211,7 +211,7 @@ QAction* WebFactory::createEngineSettingsAction(const QString& title, QWebEngine
#endif #endif
void WebFactory::genereteEscapes() { void WebFactory::generateEscapes() {
m_escapes[QSL("&lt;")] = QL1C('<'); m_escapes[QSL("&lt;")] = QL1C('<');
m_escapes[QSL("&gt;")] = QL1C('>'); m_escapes[QSL("&gt;")] = QL1C('>');
m_escapes[QSL("&amp;")] = QL1C('&'); m_escapes[QSL("&amp;")] = QL1C('&');

View File

@ -54,7 +54,7 @@ class WebFactory : public QObject {
#endif #endif
public slots: public slots:
bool openUrlInExternalBrowser(const QString& url); bool openUrlInExternalBrowser(const QString& url) const;
bool sendMessageViaEmail(const Message& message); bool sendMessageViaEmail(const Message& message);
#if defined (USE_WEBENGINE) #if defined (USE_WEBENGINE)
@ -68,7 +68,7 @@ class WebFactory : public QObject {
#endif #endif
private: private:
void genereteEscapes(); void generateEscapes();
void generateDeescapes(); void generateDeescapes();
QMap<QString, QString> m_escapes; QMap<QString, QString> m_escapes;