diff options
author | Arno <am@disconnect.de> | 2013-06-23 05:47:10 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-06-23 05:47:10 +0200 |
commit | 1e247c6fea51dab6815e3a15f22cd08e56039e89 (patch) | |
tree | 3bba38aa28dfdc4b4f6b0440accab7d83a16ad75 /archiveview.cpp | |
parent | 5dbcc16c289d7067132d133b374a9b7dcd2c7fd2 (diff) | |
download | SheMov-1e247c6fea51dab6815e3a15f22cd08e56039e89.tar.gz SheMov-1e247c6fea51dab6815e3a15f22cd08e56039e89.tar.bz2 SheMov-1e247c6fea51dab6815e3a15f22cd08e56039e89.zip |
Make the archive cache useful
Read the cache if there is one, if not, read it in another thread and
update the view when it's done.
Diffstat (limited to 'archiveview.cpp')
-rw-r--r-- | archiveview.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/archiveview.cpp b/archiveview.cpp index 263bc41..166be89 100644 --- a/archiveview.cpp +++ b/archiveview.cpp @@ -23,13 +23,8 @@ ArchiveView::ArchiveView(QWidget *parent) : QWidget(parent), mConstructing(true) { QSettings s; mArchiveModel = static_cast<ArchiveModel*>(SmGlobals::instance()->model("ArchiveModel")); - connect(mArchiveModel->collector(), SIGNAL(started()), this, SLOT(collectorStarted())); - connect(mArchiveModel->collector(), SIGNAL(finished()), this, SLOT(collectorFinished())); connect(mArchiveModel, SIGNAL(needRefresh()), this, SLOT(refreshArchive())); connect(mArchiveModel, SIGNAL(databaseError(QString)), this, SLOT(showDatabaseError(QString))); - mProgress = new ArchiveProgressDialog(this); - mProgress->setHidden(true); - connect(mArchiveModel->collector(), SIGNAL(message(QString)), mProgress, SLOT(setMessage(QString))); mProxy = new ArchiveProxy; mProxy->setSourceModel(mArchiveModel); @@ -104,10 +99,6 @@ void ArchiveView::writeSettings() { s.setValue("archivemodel/expandeditems", expandedItems); } -QWidget *ArchiveView::progressDialog(){ - return qobject_cast<QWidget *>(mProgress); -} - void ArchiveView::refreshArchive(){ writeSettings(); mArchiveModel->refresh(); @@ -137,18 +128,6 @@ void ArchiveView::clearFilter(){ mTree->collapseAll(); } -void ArchiveView::collectorStarted(){ - if(mConstructing){ - return; - } - mProgress->show(); -} - -void ArchiveView::collectorFinished(){ - mProgress->hide(); - setExpanded(); -} - void ArchiveView::showDatabaseError(const QString &errorMsg){ QMessageBox::critical(this, tr("Database Error"), errorMsg); } @@ -201,18 +180,6 @@ void ArchiveTree::impossible(const QString msg){ QMessageBox::critical(this, tr("Error"), msg); } -ArchiveProgressDialog::ArchiveProgressDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f){ - QHBoxLayout *mainLayout = new QHBoxLayout; - mMessage = new QLabel; - mainLayout->addWidget(mMessage); - setLayout(mainLayout); -} - -void ArchiveProgressDialog::setMessage(const QString &msg){ - QString message = QString(tr("<b>Gathering data... please wait!</b><br/><ul><li>%1</li></ul>")).arg(msg); - mMessage->setText(message); -} - ArchiveFiles::ArchiveFiles(QWidget *parent) : SmTreeView(parent){ } |