[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:13:58 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-send-file.git;a=commitdiff;h=0bbe76d
The following commit has been merged in the master branch:
commit 0bbe76dd826f9569f30c56d595749424e2ad036b
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Wed Jun 8 13:30:48 2011 +0100
Use file preview widget instead of dealing with KIO::filePreview ourselves
---
mainwindow.cpp | 31 +++----------------------------
mainwindow.h | 2 --
mainwindow.ui | 17 ++++++-----------
3 files changed, 9 insertions(+), 41 deletions(-)
diff --git a/mainwindow.cpp b/mainwindow.cpp
index e36d02e..ebcb0fe 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -28,22 +28,9 @@ MainWindow::MainWindow(QWidget *parent) :
qDebug() << KApplication::arguments();
- QString fileName = KCmdLineArgs::parsedArgs()->arg(0);
-
- //FIXME if remote make it local.
-
-
- KFileItem file(KUrl(fileName), "image/png", KFileItem::Unknown);
-
- KIO::PreviewJob* job = KIO::filePreview(KFileItemList() << file, ui->filePreviewLabel->size());
-
- ui->fileNameLabel->setText(file.name());
- ui->filePreviewLabel->setText(QString());
-
- connect(job, SIGNAL(gotPreview(KFileItem, QPixmap)),
- this, SLOT(showPreview(KFileItem, QPixmap)));
- connect(job, SIGNAL(failed(KFileItem)),
- this, SLOT(showIcon(KFileItem)));
+ KUrl filePath (KCmdLineArgs::parsedArgs()->arg(0));
+ ui->filePreview->showPreview(filePath);
+ ui->fileNameLabel->setText(filePath.fileName());
Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
@@ -80,18 +67,6 @@ MainWindow::~MainWindow()
delete ui;
}
-void MainWindow::showPreview(const KFileItem &file, const QPixmap &pixmap)
-{
- ui->filePreviewLabel->setMinimumSize(pixmap.size());
- ui->filePreviewLabel->setPixmap(pixmap);
-}
-
-void MainWindow::showIcon(const KFileItem &file)
-{
- //icon is file.iconName();
-
-}
-
void MainWindow::onAccountManagerReady()
{
AccountsModel *model = new AccountsModel(m_accountManager, this);
diff --git a/mainwindow.h b/mainwindow.h
index ff4eda6..2bd1f82 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -21,8 +21,6 @@ public:
~MainWindow();
private slots:
- void showPreview(const KFileItem &file, const QPixmap &pixmap);
- void showIcon(const KFileItem &file);
void onAccountManagerReady();
diff --git a/mainwindow.ui b/mainwindow.ui
index a8d8d26..a15081e 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -54,17 +54,7 @@
</spacer>
</item>
<item>
- <widget class="QLabel" name="filePreviewLabel">
- <property name="minimumSize">
- <size>
- <width>120</width>
- <height>120</height>
- </size>
- </property>
- <property name="text">
- <string>TextLabel</string>
- </property>
- </widget>
+ <widget class="KImageFilePreview" name="filePreview"/>
</item>
<item>
<widget class="QLabel" name="fileNameLabel">
@@ -152,6 +142,11 @@
<extends>QListView</extends>
<header>kcategorizedview.h</header>
</customwidget>
+ <customwidget>
+ <class>KImageFilePreview</class>
+ <extends>QWidget</extends>
+ <header>kimagefilepreview.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>
--
ktp-send-file packaging
More information about the pkg-kde-commits
mailing list