[SCM] ktp-send-file packaging branch, master, updated. debian/15.12.1-2-216-g8f07cdf

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:14:16 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-send-file.git;a=commitdiff;h=34b1f6c

The following commit has been merged in the master branch:
commit 34b1f6c9feda5c6d9195c97ef79471931590d98e
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Tue Nov 1 16:59:06 2011 +0100

    Use a busy indicator while loading the preview and display a mimetype icon should loading of the preview fail
---
 mainwindow.cpp | 9 +++++++++
 mainwindow.h   | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/mainwindow.cpp b/mainwindow.cpp
index 31d28e9..fa33a6c 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -29,6 +29,8 @@
 #include <KMimeType>
 #include <KDebug>
 #include <KMessageBox>
+#include <KPixmapSequence>
+#include <KPixmapSequenceOverlayPainter>
 #include <KDE/KIO/PreviewJob>
 
 #include <QAbstractItemDelegate>
@@ -115,6 +117,10 @@ MainWindow::MainWindow(const KUrl &url, QWidget *parent) :
     kDebug() << KApplication::arguments();
 
     ui->fileNameLabel->setText(url.fileName());
+    m_busyOverlay = new KPixmapSequenceOverlayPainter(this);
+    m_busyOverlay->setSequence(KPixmapSequence("process-working", 22));
+    m_busyOverlay->setWidget(ui->filePreview);
+    m_busyOverlay->start();
 
     KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url);
     KIO::PreviewJob* job = KIO::filePreview(KFileItemList() << file, QSize(280, 280), &KIO::PreviewJob::availablePlugins());
@@ -232,9 +238,12 @@ void MainWindow::onPreviewLoaded(const KFileItem& item, const QPixmap& preview)
 {
     Q_UNUSED(item);
     ui->filePreview->setPixmap(preview);
+    m_busyOverlay->stop();
 }
 
 void MainWindow::onPreviewFailed(const KFileItem& item)
 {
     kWarning() << "Loading thumb failed" << item.name();
+    ui->filePreview->setPixmap(KIconLoader::global()->loadIcon(item.iconName(), KIconLoader::Desktop, 128));
+    m_busyOverlay->stop();
 }
diff --git a/mainwindow.h b/mainwindow.h
index 35250dc..210ac02 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -27,6 +27,7 @@
 
 #include <TelepathyQt4/AccountManager>
 
+class KPixmapSequenceOverlayPainter;
 namespace Ui {
     class MainWindow;
 }
@@ -53,6 +54,8 @@ private:
     Ui::MainWindow *ui;
     AccountsModel *m_accountsModel;
     Tp::AccountManagerPtr m_accountManager;
+
+    KPixmapSequenceOverlayPainter *m_busyOverlay;
 };
 
 #endif // MAINWINDOW_H

-- 
ktp-send-file packaging



More information about the pkg-kde-commits mailing list