Changeset View
Changeset View
Standalone View
Standalone View
dataengines/soliddevice/soliddeviceengine.cpp
Show First 20 Lines • Show All 566 Lines • ▼ Show 20 Line(s) | 553 | if (!m_paths.contains(path)) { | |||
---|---|---|---|---|---|
567 | connect(job, &KIO::FileSystemFreeSpaceJob::result, timer, &QTimer::deleteLater); | 567 | connect(job, &KIO::FileSystemFreeSpaceJob::result, timer, &QTimer::deleteLater); | ||
568 | 568 | | |||
569 | // collect and process info | 569 | // collect and process info | ||
570 | connect(job, &KIO::FileSystemFreeSpaceJob::result, this, | 570 | connect(job, &KIO::FileSystemFreeSpaceJob::result, this, | ||
571 | [this, timer, path, udi](KIO::Job *job, KIO::filesize_t size, KIO::filesize_t available) { | 571 | [this, timer, path, udi](KIO::Job *job, KIO::filesize_t size, KIO::filesize_t available) { | ||
572 | timer->stop(); | 572 | timer->stop(); | ||
573 | 573 | | |||
574 | if (!job->error()) { | 574 | if (!job->error()) { | ||
575 | setData(udi, I18N_NOOP("Free Space"), QVariant(available)); | 575 | setData(udi, I18N_NOOP("Free Space"), QVariant(available).toDouble()); | ||
576 | setData(udi, I18N_NOOP("Free Space Text"), KFormat().formatByteSize(available)); | 576 | setData(udi, I18N_NOOP("Free Space Text"), KFormat().formatByteSize(available)); | ||
577 | setData(udi, I18N_NOOP("Size"), QVariant(size)); | 577 | setData(udi, I18N_NOOP("Size"), QVariant(size).toDouble()); | ||
578 | setData(udi, I18N_NOOP("Size Text"), KFormat().formatByteSize(size)); | ||||
578 | } | 579 | } | ||
579 | 580 | | |||
580 | m_paths.remove(path); | 581 | m_paths.remove(path); | ||
581 | }); | 582 | }); | ||
582 | 583 | | |||
583 | // start timer: after 15 seconds we will get an error | 584 | // start timer: after 15 seconds we will get an error | ||
584 | timer->start(15000); | 585 | timer->start(15000); | ||
585 | } | 586 | } | ||
▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines |