[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://github.com/walokra/sailimgur</param>
<param name="branch">master</param>
- <param name="revision">0df7bc5caf44129e39b11d0056cfb84608771dd0</param>
+ <param name="revision">a9700df494c39ed0dd4678645c659ab2fc186313</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/main.cpp
^
|
@@ -45,6 +45,8 @@
SimpleCrypt *crypto = new SimpleCrypt();
crypto->setKey(0xd2fa13b37d936b07);
+ //QString secret = crypto->encryptToString(QString(""));
+ //qDebug() << "secret:" << secret;
QString client_secret = crypto->decryptToString(QString(CLIENT_SECRET));
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/components/imgur.js
^
|
@@ -24,7 +24,7 @@
var ENDPOINT_ALBUM = BASEURL + "/album/";
var ENDPOINT_IMAGE = BASEURL + "/image/";
-var IMGUR_IMG_URL = "http://i.imgur.com/";
+var IMGUR_IMG_URL = "https://i.imgur.com/";
// OAUTH
var AUTHORIZE_URL = "https://api.imgur.com/oauth2/authorize"
@@ -483,9 +483,12 @@
gifv: (output.gifv) ? output.gifv : "",
mp4: (output.mp4) ? output.mp4 : "",
webm: (output.webm) ? output.webm : "",
- looping: (output.looping) ? output.looping : false
+ looping: (output.looping) ? output.looping : false,
+ thumbnail: IMGUR_IMG_URL + output.id+"l.jpg" // s=90x90, b=160x16; t=160x160, m=320x320,l=640x640, h=1024x1024 (aspect)
};
+ //console.debug(JSON.stringify(imageData));
+
model.push(imageData);
}
@@ -507,9 +510,9 @@
model.images_count = (output.images_count) ? output.images_count : 0;
model.is_album = (output.is_album) ? output.is_album : false;
if (output.is_album) {
- model.gallery_page_link = "http://imgur.com/a/" + output.id;
+ model.gallery_page_link = "https://imgur.com/a/" + output.id;
} else {
- model.gallery_page_link = "http://imgur.com/" + output.id;
+ model.gallery_page_link = "https://imgur.com/" + output.id;
}
var total = 0;
@@ -672,29 +675,29 @@
}
}
-function processGalleryMode(query, model, page, settings, onSuccess, onFailure) {
+function processGalleryMode(query, model, pageNo, settings, onSuccess, onFailure) {
// Global accesor used to use the correct URL base for getGalleryImage()
redditModeActive = false;
if (query) {
- getGallerySearch(query, model, page, settings, onSuccess, onFailure);
+ getGallerySearch(query, model, pageNo, settings, onSuccess, onFailure);
}
else if (settings.mode === "main" || settings.mode === "user" || settings.mode === "score") {
- getGallery(model, page, settings, onSuccess, onFailure);
+ getGallery(model, pageNo, settings, onSuccess, onFailure);
} else if (settings.mode === "random") {
- getRandomGalleryImages(model, page, onSuccess, onFailure);
+ getRandomGalleryImages(model, pageNo, onSuccess, onFailure);
} else if (settings.mode === "memes") {
- getMemesSubGallery(model, page, settings, onSuccess, onFailure);
+ getMemesSubGallery(model, pageNo, settings, onSuccess, onFailure);
} else if (settings.mode === "reddit") {
redditModeActive = true;
- getRedditSubGallery(model, page, settings, onSuccess, onFailure);
+ getRedditSubGallery(model, pageNo, settings, onSuccess, onFailure);
} else if (settings.mode === "favorites") {
getFavorites(model, onSuccess, onFailure);
} else if (settings.mode === "albums") {
- getAlbums(model, page, onSuccess, onFailure);
+ getAlbums(model, pageNo, onSuccess, onFailure);
} else if (settings.mode === "images") {
- getImages(model, page, onSuccess, onFailure);
+ getImages(model, pageNo, onSuccess, onFailure);
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/main.qml
^
|
@@ -8,7 +8,7 @@
property Page currentPage: pageStack.currentPage
- property int page : 0;
+ property int pageNo : 0;
property int currentIndex : 0;
property bool loggedIn : false;
@@ -48,7 +48,7 @@
Rectangle {
id: infoBanner;
- y: Theme.paddingSmall;
+ y: 4 * Theme.paddingMedium;
z: 1;
width: parent.width;
@@ -65,7 +65,7 @@
width: parent.width - 2 * Theme.paddingSmall
anchors.top: parent.top;
anchors.topMargin: Theme.paddingMedium;
- y: Theme.paddingSmall;
+ y: 4 * Theme.paddingMedium;
horizontalAlignment: Text.AlignHCenter;
wrapMode: Text.WrapAnywhere;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/pages/AccountPage.qml
^
|
@@ -275,7 +275,7 @@
function setCommonValues() {
currentIndex = 0;
- page = 0;
+ pageNo = 0;
galleryModel.query = "";
galleryModel.clear();
galleryModel.processGalleryMode();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/pages/GalleryContentDelegate.qml
^
|
@@ -21,23 +21,17 @@
// webm = video/x-vp8, video/x-h264
// "No decoder available for type 'video/x-vp8'
function activateLoader() {
- //console.debug("link=", link, "; size=",size, "type=",type, "; mp4=",mp4, "; gifv=",gifv, "; webm=",webm);
- //console.debug("vWidth=" + vWidth + "; vHeight="+vHeight)
+ //console.debug("link=",link, "; size=",size, "type=",type, "; animated=",animated, "; mp4=",mp4, "; gifv=",gifv, "; thumbnail=",thumbnail);
imageLoader.active = false;
videoLoader.active = false;
- if (animated === false) {
+ if (!animated) {
imageLoader.active = true;
- } else if ((type === "image/gif" || type === "video/mp4" || (mp4 !== "")) && settings.useVideoLoader === true) {
- // If gifv video is under maxGifSize, use animatedImage (smoother)
- if (size && size.indexOf("MiB") > -1) {
- var sizeNo = size.replace(" MiB", "");
- if (parseInt(sizeNo) > settings.maxGifSize) {
- videoLoader.active = true;
- }
- }
- }
- if (imageLoader.active == false && videoLoader.active == false) {
+ } else if (type === "video/mp4") {
+ videoLoader.active = true;
+ } else if (type === "image/gif") {
+ imageLoader.active = true;
+ } else {
imageLoader.active = true;
}
}
@@ -63,11 +57,10 @@
Drawer {
id: drawer;
anchors.left: parent.left; anchors.right: parent.right;
- dock: page.isPortrait ? Dock.Left : Dock.Bottom;
+ dock: Dock.Bottom;
height: imageColumn.height;
backgroundSize: parent.width / 5;
-// background: Item { }
background: Item {
id: drawerContextMenu;
anchors.left: parent.left; anchors.right: parent.right;
@@ -84,7 +77,7 @@
height: imageTitleText.height + ((imageLoader.active) ? imageLoader.height : videoLoader.height);
spacing: constant.paddingSmall;
- enabled: !drawer.opened;
+ enabled: !drawer.opened;
Label {
id: imageTitleText;
@@ -106,7 +99,7 @@
asynchronous: true;
width: Screen.width;
- height: (active) ? vHeight : 0;
+ height: (active) ? Math.min(vHeight * (Screen.width / vWidth), Screen.height) : 0;
anchors.horizontalCenter: parent.horizontalCenter;
@@ -130,8 +123,6 @@
}
} // Drawer
-// ImageButtons { }
-
Label {
id: imageDescText;
wrapMode: Text.Wrap;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/pages/GalleryContentPage.qml
^
|
@@ -14,7 +14,7 @@
property string galleryContentPageTitle : constant.appName;
- property bool prevEnabled: currentIndex > 0 || page > 0;
+ property bool prevEnabled: currentIndex > 0 || pageNo > 0;
GalleryContentModel {
id: galleryContentModel;
@@ -77,7 +77,7 @@
}
function setPrevButton() {
- if (currentIndex === 0 && page === 0) {
+ if (currentIndex === 0 && pageNo === 0) {
prevEnabled = false;
} else {
prevEnabled = true;
@@ -254,6 +254,30 @@
}
} // galleryContentColumn
+ Column {
+ id: galleryLinkColumn;
+ anchors {
+ left: parent.left;
+ right: parent.right;
+ leftMargin: constant.paddingMedium;
+ topMargin: constant.paddingMedium;
+ }
+ height: childrenRect.height;
+
+ Row {
+ id: linkRow;
+ spacing: Theme.paddingMedium;
+
+ Label {
+ id: linkText;
+ font.pixelSize: constant.fontSizeIgnore;
+ text: "Gallery page: " + galleryContentModel.gallery_page_link;
+ wrapMode: Text.Wrap;
+ color: constant.colorHighlight;
+ }
+ }
+ } // galleryLinkColumn
+
Item {
id: pointsColumn;
anchors {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/pages/GalleryMode.qml
^
|
@@ -276,7 +276,7 @@
function setModeCommon() {
settings.saveSetting("mode", settings.mode);
- page = 0;
+ pageNo = 0;
galleryModel.query = "";
toolbar.searchVisible = false;
galgrid.scrollToTop();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/pages/GalleryModel.qml
^
|
@@ -29,7 +29,7 @@
signInPage.init();
- Imgur.processGalleryMode(query, listModel, page, settings,
+ Imgur.processGalleryMode(query, listModel, pageNo, settings,
onSuccess(),
onFailure()
);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/pages/GalleryNavigation.qml
^
|
@@ -15,17 +15,17 @@
z: 2;
- visible: galleryModel.count > 1 || page > 0;
+ visible: galleryModel.count > 1 || pageNo > 0;
function previous() {
- //console.log("Previous clicked! curr=" + currentIndex + "; page=" + page);
- if (currentIndex > 0 && page >= 0) {
+ //console.log("Previous clicked! curr=" + currentIndex + "; page=" + pageNo);
+ if (currentIndex > 0 && pageNo >= 0) {
currentIndex -= 1;
load();
}
- if (currentIndex === 0 && page >= 1) {
+ if (currentIndex === 0 && pageNo >= 1) {
//console.log("Getting previous list of images");
- page -= 1;
+ pageNo -= 1;
loadingRect.visible = true;
galleryModel.clear();
@@ -36,7 +36,7 @@
}
function next() {
- //console.log("Next clicked! curr=" + currentIndex + "; model=" + galleryModel.count);
+ //console.log("Next clicked! curr=", + currentIndex + "; count=" + galleryModel.count);
if (currentIndex < galleryModel.count - 1) {
//console.log("Getting next image");
currentIndex += 1;
@@ -44,7 +44,7 @@
}
else if (currentIndex === galleryModel.count - 1) {
//console.log("Getting new list of images");
- page += 1;
+ pageNo += 1;
currentIndex = 0;
loadingRect.visible = true;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/pages/ImageComponent.qml
^
|
@@ -12,9 +12,6 @@
height: Math.max(image.height, 3 * loadingImageIndicator.height);
width: Screen.width;
- property int start_x;
- property int start_y;
-
AnimatedImage {
id: image;
@@ -103,31 +100,38 @@
internal.clickPlay();
}
- onPressAndHold: {
- imageColumn.height = (imageColumn.height < drawerContextMenu.height) ? drawerContextMenu.height : imageColumn.height;
- drawer.open = true;
- }
+ MouseArea {
+ property int start_x;
+ property int start_y;
+
+ anchors.fill: parent;
+
+ onPressAndHold: {
+ image.height = (image.height < drawerContextMenu.height) ? drawerContextMenu.height : image.height;
+ drawer.open = true;
+ }
- onPressed: {
- start_x = mouseX;
- start_y = mouseY;
- }
+ onPressed: {
+ start_x = mouseX;
+ start_y = mouseY;
+ }
- onPositionChanged: {
- if (!isSlideshow && pinchArea.curScale == 1.0) {
- var x_diff = mouseX - start_x;
- var y_diff = mouseY - start_y;
-
- var abs_x_diff = Math.abs(x_diff);
- var abs_y_diff = Math.abs(y_diff);
-
- if (abs_x_diff !== abs_y_diff) {
- if (abs_x_diff > abs_y_diff) {
- if (abs_x_diff > 50) {
- if (x_diff > 0) {
- if (prevEnabled) { galleryNavigation.previous(); }
- } else if (x_diff < 0) {
- galleryNavigation.next();
+ onPositionChanged: {
+ if (!isSlideshow && pinchArea.curScale == 1.0) {
+ var x_diff = mouseX - start_x;
+ var y_diff = mouseY - start_y;
+
+ var abs_x_diff = Math.abs(x_diff);
+ var abs_y_diff = Math.abs(y_diff);
+
+ if (abs_x_diff !== abs_y_diff) {
+ if (abs_x_diff > abs_y_diff) {
+ if (abs_x_diff > 50) {
+ if (x_diff > 0) {
+ if (prevEnabled) { galleryNavigation.previous(); }
+ } else if (x_diff < 0) {
+ galleryNavigation.next();
+ }
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/pages/MainPage.qml
^
|
@@ -217,7 +217,7 @@
// if (page > 0) {
// page -= 1;
-// console.log("atYBeginning: " + page);
+// console.log("atYBeginning: " + pageNo);
// statusLabel.text = qsTr("Loading previous page");
// galleryModel.prevPage(galleryModel.query);
// galgrid.scrollToBottom();
@@ -226,7 +226,7 @@
if(atYEnd) {
page += 1;
-// console.log("atYEnd: " + page);
+// console.log("atYEnd: " + pageNo);
statusLabel.text = qsTr("Loading next page");
galleryModel.nextPage(galleryModel.query);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/pages/Toolbar.qml
^
|
@@ -44,7 +44,7 @@
settings.saveSetting("mode", settings.mode);
modeChanged("main");
- page = 0;
+ pageNo = 0;
galleryModel.query = "";
searchPanel.visible = false;
galgrid.scrollToTop();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur-0.11.1.tar.bz2/qml/pages/VideoComponent.qml
^
|
@@ -8,12 +8,9 @@
id: root;
anchors { left: parent.left; right: parent.right; }
- height: Math.max(((video) ? video.height : 0), image.height, 3*loadingVideoIndicator.height);
+ height: Math.max(vHeight * (Screen.width / vWidth), 3*loadingVideoIndicator.height);
width: Screen.width;
- property int start_x;
- property int start_y;
-
Connections {
target: galleryContentPage;
onGgpStatusChanged: {
@@ -35,14 +32,14 @@
}
}
- Image {
+ Image {
id: image;
asynchronous: true;
fillMode: Image.PreserveAspectFit;
- source: link_original;
+ source: thumbnail;
width: parent.width;
- height: sourceSize.height * (Screen.width / sourceSize.width);
+ height: vHeight * (Screen.width / vWidth);
visible: (mediaPlayer) ? mediaPlayer.playbackState == MediaPlayer.StoppedState : true;
}
@@ -50,8 +47,8 @@
VideoOutput {
id: video;
- width: image.width;
- height: image.height;
+ width: Screen.width;
+ height: Math.min(vHeight * (Screen.width / vWidth), Screen.height)
fillMode: VideoOutput.PreserveAspectFit;
@@ -84,10 +81,15 @@
internal.clickPlay();
}
-// onPressAndHold: {
-// imageColumn.height = (imageColumn.height < drawerContextMenu.height) ? drawerContextMenu.height : imageColumn.height;
-// drawer.open = true;
-// }
+ property int start_x;
+ property int start_y;
+
+ anchors.fill: parent;
+
+ onPressAndHold: {
+ video.height = (video.height < drawerContextMenu.height) ? drawerContextMenu.height : video.height;
+ drawer.open = true;
+ }
onPressed: {
start_x = mouseX;
@@ -101,7 +103,7 @@
var abs_x_diff = Math.abs(x_diff);
var abs_y_diff = Math.abs(y_diff);
- if (abs_x_diff !== abs_y_diff) {
+ if (abs_x_diff != abs_y_diff) {
if (abs_x_diff > abs_y_diff) {
if (abs_x_diff > 50) {
if (x_diff > 0) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-sailimgur.yaml
^
|
@@ -1,6 +1,6 @@
Name: harbour-sailimgur
Summary: Sailimgur is an Imgur app for Sailfish OS, powered by Qt and QML
-Version: 0.10.1
+Version: 0.11.1
Release: 1
Group: Applications/Internet
URL: http://ruleoftech.com/lab/sailimgur
|