make KFileItem KF5 ready

parent 898c8d3e
......@@ -43,7 +43,8 @@ ManageCapturesDialog::ManageCapturesDialog(const QList<QUrl> &files, QWidget * p
foreach(const QUrl &url, files) {
QStringList text;
text << url.fileName();
KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url, true);
KFileItem file(url);
file.setDelayedMimeTypes(true);
text << KIO::convertSize(file.size());
QTreeWidgetItem *item = new QTreeWidgetItem(m_view.treeWidget, text);
item->setData(0, Qt::UserRole, url.path());
......
......@@ -960,7 +960,8 @@ void RecMonitor::manageCapturedFiles()
foreach(const QString & name, result) {
QUrl url = QUrl(dir.filePath(name));
if (QFile::exists(url.path())) {
KFileItem file(KFileItem::Unknown, KFileItem::Unknown, url, true);
KFileItem file(url);
file.setDelayedMimeTypes(true);
if (file.time(KFileItem::ModificationTime) > m_captureTime) {
// The file was captured in the last batch
if (url.fileName().contains(':')) {
......
......@@ -269,7 +269,8 @@ ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps
ClipType t = m_clip->clipType();
if (props.contains("proxy") && props.value("proxy") != "-") {
KFileItem f(KFileItem::Unknown, KFileItem::Unknown, QUrl(props.value("proxy")), true);
KFileItem f(QUrl(props.value("proxy")));
f.setDelayedMimeTypes(true);
QFrame* line = new QFrame();
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
......@@ -469,7 +470,8 @@ ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps
}
if (t != SlideShow && t != Color) {
KFileItem f(KFileItem::Unknown, KFileItem::Unknown, url, true);
KFileItem f(url);
f.setDelayedMimeTypes(true);
m_view.clip_filesize->setText(KIO::convertSize(f.size()));
} else {
m_view.clip_filesize->setHidden(true);
......
......@@ -21,12 +21,12 @@
#include "kdenlivesettings.h"
#include <QDebug>
#include <KFileItem>
#include <QFontDatabase>
#include <KFileItem>
#include <kdeversion.h>
#include <QDebug>
#include <QFontDatabase>
#include <QDir>
#include <QStandardPaths>
......@@ -227,17 +227,15 @@ void SlideshowClip::slotGenerateThumbs()
if (item) {
QString path = item->data(Qt::UserRole).toString();
if (!path.isEmpty()) {
fileList.append(KFileItem(KFileItem::Unknown, KFileItem::Unknown, QUrl(path)));
QUrl url(path);
KFileItem f(url);
f.setDelayedMimeTypes(true);
fileList.append(f);
}
}
}
#if KDE_IS_VERSION(4,7,0)
m_thumbJob = new KIO::PreviewJob(fileList, QSize(50, 50));
m_thumbJob->setScaleType(KIO::PreviewJob::Scaled);
#else
m_thumbJob = new KIO::PreviewJob(fileList, 50, 0, 0, 0, true, false, 0);
#endif
m_thumbJob->setAutoDelete(false);
connect(m_thumbJob, SIGNAL(gotPreview(KFileItem,QPixmap)), this, SLOT(slotSetPixmap(KFileItem,QPixmap)));
m_thumbJob->start();
......
......@@ -1732,7 +1732,7 @@ void ProjectList::slotAddClip(const QList <QUrl> &givenList, const QString &grou
QUrl url = list.at(0);
QString fileName = url.fileName().section('.', 0, -2);
if (fileName.at(fileName.size() - 1).isDigit()) {
KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url);
KFileItem item(url);
if (item.mimetype().startsWith(QLatin1String("image"))) {
// import as sequence if we found more than one image in the sequence
QStringList list;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment