diff options
-rw-r--r-- | filecopier.cpp | 2 | ||||
-rw-r--r-- | filecopier.h | 2 | ||||
-rw-r--r-- | shemovcleaner.cpp | 12 | ||||
-rw-r--r-- | shemovcleaner.h | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/filecopier.cpp b/filecopier.cpp index dd3f679..a77e051 100644 --- a/filecopier.cpp +++ b/filecopier.cpp @@ -25,7 +25,7 @@ void FileCopier::run(){ mAddJobMutex.unlock(); QString msg = QString(tr("Copy: %1 (%2/%3)")).arg(source).arg(QString::number(mCopied + 1)).arg(QString::number(mTotal)); QString cmsg = QString("%1/%2").arg(QString::number(mCopied + 1)).arg(QString::number(mTotal)); - emit copying(true, cmsg); + emit copying(cmsg); emit message(msg); QFile sFile(source); if(sFile.copy(dest)){ diff --git a/filecopier.h b/filecopier.h index 8836749..36f0d6c 100644 --- a/filecopier.h +++ b/filecopier.h @@ -15,7 +15,7 @@ class FileCopier : public QThread { signals: void message(const QString &msg); - void copying(bool copying, const QString &msg); + void copying(const QString &msg); private: QHash<QString, QString> mJobs; diff --git a/shemovcleaner.cpp b/shemovcleaner.cpp index 634eaf4..32b9d01 100644 --- a/shemovcleaner.cpp +++ b/shemovcleaner.cpp @@ -38,7 +38,6 @@ ShemovCleaner::ShemovCleaner(QWidget *parent, Qt::WindowFlags f) : QMainWindow(p splash.show(); qApp->processEvents(); openDatabase(); - createStatusBar(); createGlobalActions(); splash.showMessage(tr("Reading torrents..."), Qt::AlignHCenter, Qt::darkGreen); @@ -56,6 +55,7 @@ ShemovCleaner::ShemovCleaner(QWidget *parent, Qt::WindowFlags f) : QMainWindow(p qApp->processEvents(); mTab->addTab(mTorrentTab, tr("&Torrents")); mTab->addTab(mFileTab, tr("Fi&les")); + createStatusBar(); setCentralWidget(mTab); connect(mTorrentTab, &TorrentWidget::statusMessage, this, &ShemovCleaner::statusBarMessage); @@ -68,10 +68,10 @@ ShemovCleaner::ShemovCleaner(QWidget *parent, Qt::WindowFlags f) : QMainWindow(p connect(mTab, &QTabWidget::currentChanged, this, &ShemovCleaner::tabChanged); connect(this, &ShemovCleaner::configurationChanged, mFileTab, &FileWidget::readSettings); connect(mFileTab->fileCopier(), &FileCopier::copying, this, &ShemovCleaner::updateCopying); - connect(mFileTab->fileCopier(), &FileCopier::finished, [=] { updateCopying(false, QString());} ); + connect(mFileTab->fileCopier(), &FileCopier::finished, [=] { updateCopying(QString());} ); connect(mFileTab->fileCopier(), &FileCopier::finished, mFileTab, &FileWidget::gatherData); mCopying->installEventFilter(this); - updateCopying(false, QString()); + updateCopying(QString()); QMenu *helpMenu = new QMenu(tr("&Help")); QAction *aboutThisA = new QAction(tr("About ShemovCleaner..."), this); @@ -134,9 +134,9 @@ void ShemovCleaner::updateFreeSpace(const QString &path){ mFree->setPixmap(QPixmap::fromImage(img)); } -void ShemovCleaner::updateCopying(bool inProgress, const QString &count){ +void ShemovCleaner::updateCopying(const QString &count){ QImage img(mCopying->size(), QImage::Format_ARGB32); - if(inProgress){ + if(mFileTab->fileCopier()->isRunning()){ img.fill(Qt::red); QPainter p(&img); QFont f(qApp->font()); @@ -236,7 +236,7 @@ void ShemovCleaner::createStatusBar(){ statusBar()->addPermanentWidget(mDuration); statusBar()->addPermanentWidget(mDrive); statusBar()->addPermanentWidget(mFree); - updateCopying(false, QString()); + updateCopying(QString()); } void ShemovCleaner::createGlobalActions(){ diff --git a/shemovcleaner.h b/shemovcleaner.h index db6399f..4553df8 100644 --- a/shemovcleaner.h +++ b/shemovcleaner.h @@ -21,7 +21,7 @@ class ShemovCleaner : public QMainWindow { void setSelectionCount(const QString &msg); void setDuration(const QString &msg); void updateFreeSpace(const QString &path); - void updateCopying(bool inProgress, const QString &count); + void updateCopying(const QString &count); void configure(); void tabChanged(int idx); void aboutThisProgram(); |