Skip to content

Commit

Permalink
Refactor handling constants and add anonymous client id for OBS
Browse files Browse the repository at this point in the history
  • Loading branch information
walokra committed Nov 6, 2021
1 parent 1d841a4 commit 20799a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#include "src/imageuploader.h"
#include "src/sailimgur.h"

#define CLIENT_ID "44f3bd95ad7db12"
#define CLIENT_SECRET ""

/**
* Clears the web cache, because Qt 5.2 WebView chokes on caches from older Qt versions.
*/
Expand Down Expand Up @@ -52,6 +55,9 @@ int main(int argc, char *argv[])
view->rootContext()->setContextProperty("APP_VERSION", APP_VERSION);
view->rootContext()->setContextProperty("APP_RELEASE", APP_RELEASE);

view->rootContext()->setContextProperty("CLIENT_ID", CLIENT_ID);
view->rootContext()->setContextProperty("CLIENT_SECRET", CLIENT_SECRET);

Sailimgur mgr;
view->rootContext()->setContextProperty("sailimgurMgr", &mgr);

Expand Down
4 changes: 2 additions & 2 deletions qml/pages/Constant.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ QtObject {
// imgur API key/secret
// The OAuth2 key/secret pair below are only for testing
// Release version in Jolla Store / OpenRepos has a different key pair
property string clientId : "";
property string clientSecret : "";
property string clientId : CLIENT_ID;
property string clientSecret : CLIENT_SECRET;

property string userAgent : appName + " " + APP_VERSION + "-" + APP_RELEASE + "(Jolla; Qt; SailfishOS)";

Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-sailimgur.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Name: harbour-sailimgur
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Sailimgur is an Imgur app for Sailfish OS, powered by Qt and QML
Version: 0.10.0
Version: 0.10.1
Release: 1
Group: Applications/Internet
License: GPLv3
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-sailimgur.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: harbour-sailimgur
Summary: Sailimgur is an Imgur app for Sailfish OS, powered by Qt and QML
Version: 0.10.0
Version: 0.10.1
Release: 1
Group: Applications/Internet
URL: http://ruleoftech.com/lab/sailimgur
Expand Down

0 comments on commit 20799a7

Please sign in to comment.