Commit ff8ecee3 authored by Vincent Pinon's avatar Vincent Pinon

Gardening: fix GCC warnings (3)

parent fa77da17
......@@ -355,7 +355,7 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, const QStringList
}
item->setData(0, Qt::UserRole + 1, slideImages);
item->setData(0, Qt::UserRole + 3, totalSize);
m_requestedSize += totalSize;
m_requestedSize += static_cast<KIO::filesize_t>(totalSize);
} else {
// pattern url (like clip%.3d.png)
QStringList result = dir.entryList(QDir::Files);
......@@ -378,7 +378,7 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, const QStringList
}
item->setData(0, Qt::UserRole + 1, slideImages);
item->setData(0, Qt::UserRole + 3, totalSize);
m_requestedSize += totalSize;
m_requestedSize += static_cast<KIO::filesize_t>(totalSize);
}
} else if (filesList.contains(fileName)) {
// we have 2 files with same name
......@@ -397,7 +397,7 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, const QStringList
item->setIcon(0, QIcon::fromTheme(QStringLiteral("edit-delete")));
m_missingClips++;
} else {
m_requestedSize += fileSize;
m_requestedSize += static_cast<KIO::filesize_t>(fileSize);
item->setData(0, Qt::UserRole + 3, fileSize);
}
filesList << fileName;
......@@ -439,7 +439,7 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, const QMap<QStrin
}
item->setData(0, Qt::UserRole + 1, slideImages);
item->setData(0, Qt::UserRole + 3, totalSize);
m_requestedSize += totalSize;
m_requestedSize += static_cast<KIO::filesize_t>(totalSize);
} else {
// pattern url (like clip%.3d.png)
QStringList result = dir.entryList(QDir::Files);
......@@ -458,7 +458,7 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, const QMap<QStrin
}
item->setData(0, Qt::UserRole + 1, slideImages);
item->setData(0, Qt::UserRole + 3, totalSize);
m_requestedSize += totalSize;
m_requestedSize += static_cast<KIO::filesize_t>(totalSize);
}
} else if (filesList.contains(fileName)) {
// we have 2 files with same name
......@@ -477,7 +477,7 @@ void ArchiveWidget::generateItems(QTreeWidgetItem *parentItem, const QMap<QStrin
item->setIcon(0, QIcon::fromTheme(QStringLiteral("edit-delete")));
m_missingClips++;
} else {
m_requestedSize += fileSize;
m_requestedSize += static_cast<KIO::filesize_t>(fileSize);
item->setData(0, Qt::UserRole + 3, fileSize);
}
filesList << fileName;
......@@ -617,7 +617,7 @@ bool ArchiveWidget::slotStartArchiving(bool firstPass)
m_duplicateFiles.remove(startJobSrc);
KIO::CopyJob *job = KIO::copyAs(startJobSrc, startJobDst, KIO::HideProgressInfo);
connect(job, SIGNAL(result(KJob *)), this, SLOT(slotArchivingFinished(KJob *)));
connect(job, SIGNAL(processedSize(KJob *, qulonglong)), this, SLOT(slotArchivingProgress(KJob *, qulonglong)));
connect(job, SIGNAL(processedSize(KJob *, KIO::filesize_t)), this, SLOT(slotArchivingProgress(KJob *, KIO::filesize_t)));
}
return true;
}
......@@ -637,7 +637,7 @@ bool ArchiveWidget::slotStartArchiving(bool firstPass)
}
m_copyJob = KIO::copy(files, destUrl, KIO::HideProgressInfo);
connect(m_copyJob, SIGNAL(result(KJob *)), this, SLOT(slotArchivingFinished(KJob *)));
connect(m_copyJob, SIGNAL(processedSize(KJob *, qulonglong)), this, SLOT(slotArchivingProgress(KJob *, qulonglong)));
connect(m_copyJob, SIGNAL(processedSize(KJob *, KIO::filesize_t)), this, SLOT(slotArchivingProgress(KJob *, KIO::filesize_t)));
}
if (firstPass) {
progressBar->setValue(0);
......@@ -681,9 +681,9 @@ void ArchiveWidget::slotArchivingFinished(KJob *job, bool finished)
}
}
void ArchiveWidget::slotArchivingProgress(KJob *, qulonglong size)
void ArchiveWidget::slotArchivingProgress(KJob *, KIO::filesize_t size)
{
progressBar->setValue(100 * size / m_requestedSize);
progressBar->setValue(static_cast<int>(100 * size / m_requestedSize));
}
bool ArchiveWidget::processProjectFile()
......@@ -777,8 +777,8 @@ bool ArchiveWidget::processProjectFile()
QDomDocument titleXML;
titleXML.setContent(src);
QDomNodeList images = titleXML.documentElement().elementsByTagName(QLatin1String("item"));
for (int i = 0; i < images.count(); i++) {
QDomNode n = images.at(i);
for (int j = 0; j < images.count(); ++j) {
QDomNode n = images.at(j);
QDomElement url = n.firstChildElement(QLatin1String("content"));
if (!url.isNull() && url.hasAttribute(QLatin1String("url"))) {
QUrl srcUrl = QUrl::fromLocalFile(url.attribute(QLatin1String("url")));
......@@ -937,7 +937,7 @@ void ArchiveWidget::slotStartExtracting()
return;
}
QFileInfo f(m_extractUrl.toLocalFile());
m_requestedSize = f.size();
m_requestedSize = static_cast<KIO::filesize_t>(f.size());
QDir dir(archive_url->url().toLocalFile());
if (!dir.mkpath(QStringLiteral("."))) {
KMessageBox::sorry(this, i18n("Cannot create directory %1", archive_url->url().toLocalFile()));
......@@ -958,7 +958,7 @@ void ArchiveWidget::slotGotProgress(KJob *job)
{
if (!job->error()) {
KIO::DirectorySizeJob *j = static_cast <KIO::DirectorySizeJob *>(job);
progressBar->setValue((int) 100 * j->totalSize() / m_requestedSize);
progressBar->setValue(static_cast<int>(100 * j->totalSize() / m_requestedSize));
}
job->deleteLater();
}
......@@ -1075,7 +1075,7 @@ void ArchiveWidget::slotProxyOnly(int onlyProxy)
for (int j = 0; j < items; ++j) {
if (!parentItem->child(j)->isDisabled()) {
m_requestedSize += parentItem->child(j)->data(0, Qt::UserRole + 3).toInt();
m_requestedSize += static_cast<KIO::filesize_t>(parentItem->child(j)->data(0, Qt::UserRole + 3).toInt());
if (isSlideshow) {
total += parentItem->child(j)->data(0, Qt::UserRole + 1).toStringList().count();
} else {
......
......@@ -59,7 +59,7 @@ private slots:
void slotCheckSpace();
bool slotStartArchiving(bool firstPass = true);
void slotArchivingFinished(KJob *job = nullptr, bool finished = false);
void slotArchivingProgress(KJob *, qulonglong);
void slotArchivingProgress(KJob *, KIO::filesize_t);
void done(int r) Q_DECL_OVERRIDE;
bool closeAccepted();
void createArchive();
......
......@@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "utils/KoIconUtils.h"
#include <KLocalizedString>
#include <KIO/DirectorySizeJob>
#include <KMessageBox>
#include <QVBoxLayout>
......@@ -229,7 +228,7 @@ void TemporaryData::updateDataInfo()
if (ok) {
preview.setNameFilters(m_proxies);
const QFileInfoList fList = preview.entryInfoList();
qint64 size = 0;
KIO::filesize_t size = 0;
for (const QFileInfo &info : fList) {
size += info.size();
}
......@@ -254,7 +253,7 @@ void TemporaryData::updateDataInfo()
void TemporaryData::gotPreviewSize(KJob *job)
{
KIO::DirectorySizeJob *sourceJob = static_cast<KIO::DirectorySizeJob *>(job);
qulonglong total = sourceJob->totalSize();
KIO::filesize_t total = sourceJob->totalSize();
if (sourceJob->totalFiles() == 0) {
total = 0;
}
......@@ -268,7 +267,7 @@ void TemporaryData::gotPreviewSize(KJob *job)
updateTotal();
}
void TemporaryData::gotProxySize(qint64 total)
void TemporaryData::gotProxySize(KIO::filesize_t total)
{
QLayoutItem *button = m_grid->itemAtPosition(1, 4);
if (button && button->widget()) {
......@@ -283,7 +282,7 @@ void TemporaryData::gotProxySize(qint64 total)
void TemporaryData::gotAudioSize(KJob *job)
{
KIO::DirectorySizeJob *sourceJob = static_cast<KIO::DirectorySizeJob *>(job);
qulonglong total = sourceJob->totalSize();
KIO::filesize_t total = sourceJob->totalSize();
if (sourceJob->totalFiles() == 0) {
total = 0;
}
......@@ -300,7 +299,7 @@ void TemporaryData::gotAudioSize(KJob *job)
void TemporaryData::gotThumbSize(KJob *job)
{
KIO::DirectorySizeJob *sourceJob = static_cast<KIO::DirectorySizeJob *>(job);
qulonglong total = sourceJob->totalSize();
KIO::filesize_t total = sourceJob->totalSize();
if (sourceJob->totalFiles() == 0) {
total = 0;
}
......@@ -322,11 +321,11 @@ void TemporaryData::updateTotal()
button->widget()->setEnabled(m_totalCurrent > 0);
}
QList<int> segments;
foreach (qulonglong size, mCurrentSizes) {
foreach (KIO::filesize_t size, mCurrentSizes) {
if (m_totalCurrent == 0) {
segments << 0;
} else {
segments << size * 360 / m_totalCurrent;
segments << static_cast<int>(size * 360 / m_totalCurrent);
}
}
m_currentPie->setSegments(segments);
......@@ -513,7 +512,7 @@ void TemporaryData::processglobalDirectories()
void TemporaryData::gotFolderSize(KJob *job)
{
KIO::DirectorySizeJob *sourceJob = static_cast<KIO::DirectorySizeJob *>(job);
qulonglong total = sourceJob->totalSize();
KIO::filesize_t total = sourceJob->totalSize();
if (sourceJob->totalFiles() == 0) {
total = 0;
}
......@@ -560,7 +559,7 @@ void TemporaryData::gotFolderSize(KJob *job)
void TemporaryData::refreshGlobalPie()
{
QList<QTreeWidgetItem *> list = m_listWidget->selectedItems();
qulonglong currentSize = 0;
KIO::filesize_t currentSize = 0;
foreach (QTreeWidgetItem *current, list) {
if (current) {
currentSize += current->data(1, Qt::UserRole).toULongLong();
......
......@@ -26,9 +26,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QWidget>
#include <QDir>
#include <KIO/DirectorySizeJob>
class KdenliveDoc;
class KJob;
class QPaintEvent;
class QLabel;
class QGridLayout;
......@@ -106,10 +106,10 @@ private:
QWidget *m_globalPage;
QTreeWidget *m_listWidget;
QGridLayout *m_grid;
qulonglong m_totalCurrent;
qulonglong m_totalGlobal;
QList<qulonglong> mCurrentSizes;
QList<qulonglong> mGlobalSizes;
KIO::filesize_t m_totalCurrent;
KIO::filesize_t m_totalGlobal;
QList<KIO::filesize_t> mCurrentSizes;
QList<KIO::filesize_t> mGlobalSizes;
QStringList m_globalDirectories;
QString m_processingDirectory;
QDir m_globalDir;
......@@ -123,7 +123,7 @@ private:
private slots:
void gotPreviewSize(KJob *job);
void gotProxySize(qint64 total);
void gotProxySize(KIO::filesize_t total);
void gotAudioSize(KJob *job);
void gotThumbSize(KJob *job);
void gotFolderSize(KJob *job);
......
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