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