Commit 8f09a251 authored by Harald Hvaal's avatar Harald Hvaal
Browse files

Error messages from listing jobs will now reach the gui

svn path=/trunk/KDE/kdeutils/ark/; revision=850438
parent 38250503
......@@ -46,6 +46,9 @@ namespace Kerfuffle
// TODO: connects
connect( job, SIGNAL( entry( const ArchiveEntry& ) ),
this, SIGNAL( newEntry( const ArchiveEntry & ) ) );
connect( job, SIGNAL( error( const QString&, const QString& ) ),
this, SLOT( onError( const QString&, const QString& ) ) );
connect(job, SIGNAL(entry(const ArchiveEntry&)),
this, SLOT(onNewEntry(const ArchiveEntry&)));
connect( job, SIGNAL( done( ThreadWeaver::Job* ) ),
......@@ -80,10 +83,16 @@ namespace Kerfuffle
}
}
void ListJob::onError(const QString& errorMessage, const QString& details)
{
Q_UNUSED(details);
setErrorText(errorMessage);
}
void ListJob::done( ThreadWeaver::Job *job )
{
Q_UNUSED(job );
setError(!job->success());
emitResult();
}
......
......@@ -62,6 +62,7 @@ namespace Kerfuffle
void done( ThreadWeaver::Job* );
void progress( double );
void onNewEntry(const ArchiveEntry&);
void onError(const QString& errorMessage, const QString& details);
private:
ReadOnlyArchiveInterface *m_archive;
......
......@@ -564,7 +564,7 @@ void ArchiveModel::setArchive( Kerfuffle::Archive *archive )
this, SLOT( slotNewEntry( const ArchiveEntry& ) ) );
connect( job, SIGNAL( result( KJob * ) ),
this, SIGNAL( loadingFinished() ) );
this, SIGNAL( loadingFinished(KJob *) ) );
if ( m_jobTracker )
{
......
......@@ -72,7 +72,7 @@ class ArchiveModel: public QAbstractItemModel
signals:
void loadingStarted();
void loadingFinished();
void loadingFinished(KJob *);
void extractionFinished( bool success );
void error( const QString& error, const QString& details );
void droppedFiles(const QStringList& files);
......
......@@ -83,8 +83,8 @@ Part::Part( QWidget *parentWidget, QObject *parent, const QStringList& args )
connect( m_model, SIGNAL( loadingStarted() ),
this, SLOT( slotLoadingStarted() ) );
connect( m_model, SIGNAL( loadingFinished() ),
this, SLOT( slotLoadingFinished() ) );
connect( m_model, SIGNAL( loadingFinished(KJob *) ),
this, SLOT( slotLoadingFinished(KJob *) ) );
connect( m_model, SIGNAL( droppedFiles(const QStringList&) ),
this, SLOT( slotAddFiles(const QStringList&) ) );
connect( m_model, SIGNAL( error( const QString&, const QString& ) ),
......@@ -327,8 +327,10 @@ void Part::slotLoadingStarted()
emit busy();
}
void Part::slotLoadingFinished()
void Part::slotLoadingFinished(KJob *job)
{
if (job->error())
kDebug( 1601 ) << "Job returned error: " << job->errorText() ;
QApplication::restoreOverrideCursor();
m_busy = false;
m_view->resizeColumnToContents( 0 );
......
......@@ -59,7 +59,7 @@ class Part: public KParts::ReadWritePart, public Interface
private slots:
void slotLoadingStarted();
void slotLoadingFinished();
void slotLoadingFinished(KJob *job);
void slotPreview();
void slotPreview( const QModelIndex & index );
void slotPreviewExtracted( KJob* );
......
......@@ -105,6 +105,7 @@ bool LibArchiveInterface::list()
if ( result != ARCHIVE_EOF )
{
error(QString("The archive reading failed with message: %1").arg( archive_error_string(arch) ));
return false;
}
......
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