[Pkg-owncloud-commits] [owncloud-client] 82/484: Thumbnailjob fixes

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:17 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 4441053b1c246b37f67229daf28c8b47041b7bd7
Author: Roeland Jago Douma <rullzer at owncloud.com>
Date:   Thu Oct 15 22:18:22 2015 +0200

    Thumbnailjob fixes
    
    * Comments
    * Use the path of the abstractnetworkjob
---
 src/gui/thumbnailjob.cpp |  6 ++----
 src/gui/thumbnailjob.h   | 17 +++++++++++++++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/gui/thumbnailjob.cpp b/src/gui/thumbnailjob.cpp
index 43d4b77..a75f56a 100644
--- a/src/gui/thumbnailjob.cpp
+++ b/src/gui/thumbnailjob.cpp
@@ -19,16 +19,14 @@
 namespace OCC {
 
 ThumbnailJob::ThumbnailJob(const QString &path, AccountPtr account, QObject* parent)
-: AbstractNetworkJob(account, "", parent)
+: AbstractNetworkJob(account, QLatin1String("index.php/apps/files/api/v1/thumbnail/150/150/") + path, parent)
 {
-    _url = Account::concatUrlPath(account->url(), QLatin1String("index.php/apps/files/api/v1/thumbnail/150/150/") + path);
     setIgnoreCredentialFailure(true);
 }
 
 void ThumbnailJob::start()
 {
-    qDebug() << Q_FUNC_INFO;
-    setReply(getRequest(_url));
+    setReply(getRequest(Account::concatUrlPath(account()->url(), path())));
     setupConnections(reply());
     AbstractNetworkJob::start();
 }
diff --git a/src/gui/thumbnailjob.h b/src/gui/thumbnailjob.h
index 7c58f24..2711164 100644
--- a/src/gui/thumbnailjob.h
+++ b/src/gui/thumbnailjob.h
@@ -19,6 +19,13 @@
 
 namespace OCC {
 
+/**
+ * @brief Job to fetch a thumbnail for a file
+ * @ingroup gui
+ *
+ * Job that allows fetching a preview (of 150x150 for now) of a given file.
+ * Once the job finished the jobFinished signal will be emitted.
+ */
 class ThumbnailJob : public AbstractNetworkJob {
     Q_OBJECT
 public:
@@ -26,11 +33,17 @@ public:
 public slots:
     void start() Q_DECL_OVERRIDE;
 signals:
+    /**
+     * @param statusCode the HTTP status code
+     * @param reply the content of the reply
+     *
+     * Signal that the job is done. If the statusCode is 200 (success) reply
+     * will contain the image data in PNG. If the status code is different the content
+     * of reply is undefined.
+     */
     void jobFinished(int statusCode, QByteArray reply);
 private slots:
     virtual bool finished() Q_DECL_OVERRIDE;
-private:
-    QUrl _url;
 };
 
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list