~ubuntu-branches/ubuntu/precise/gwenview/precise-proposed

« back to all changes in this revision

Viewing changes to lib/document/loadingjob.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:54 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20111215141754-z043hyx69dulbggf
Tags: upstream-4.7.90
Import upstream version 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// vim: set tabstop=4 shiftwidth=4 noexpandtab:
 
1
// vim: set tabstop=4 shiftwidth=4 expandtab:
2
2
/*
3
3
Gwenview: an image viewer
4
4
Copyright 2010 Aurélien Gâteau <agateau@kde.org>
30
30
 
31
31
// Local
32
32
 
33
 
namespace Gwenview {
34
 
 
35
 
 
36
 
void LoadingJob::doStart() {
37
 
        Document::LoadingState state = document()->loadingState();
38
 
        if (state == Document::Loaded || state == Document::LoadingFailed) {
39
 
                setError(NoError);
40
 
                emitResult();
41
 
        } else {
42
 
                connect(document().data(), SIGNAL(loaded(const KUrl&)), SLOT(slotLoaded()));
43
 
                connect(document().data(), SIGNAL(loadingFailed(const KUrl&)), SLOT(slotLoadingFailed()));
44
 
        }
45
 
}
46
 
 
47
 
 
48
 
void LoadingJob::slotLoaded() {
49
 
        setError(NoError);
50
 
        emitResult();
51
 
}
52
 
 
53
 
 
54
 
void LoadingJob::slotLoadingFailed() {
55
 
        setError(UserDefinedError + 1);
56
 
        setErrorText(i18n("Could not load document %1", document()->url().pathOrUrl()));
57
 
        emitResult();
58
 
}
59
 
 
 
33
namespace Gwenview
 
34
{
 
35
 
 
36
void LoadingJob::doStart()
 
37
{
 
38
    Document::LoadingState state = document()->loadingState();
 
39
    if (state == Document::Loaded || state == Document::LoadingFailed) {
 
40
        setError(NoError);
 
41
        emitResult();
 
42
    } else {
 
43
        connect(document().data(), SIGNAL(loaded(KUrl)), SLOT(slotLoaded()));
 
44
        connect(document().data(), SIGNAL(loadingFailed(KUrl)), SLOT(slotLoadingFailed()));
 
45
    }
 
46
}
 
47
 
 
48
void LoadingJob::slotLoaded()
 
49
{
 
50
    setError(NoError);
 
51
    emitResult();
 
52
}
 
53
 
 
54
void LoadingJob::slotLoadingFailed()
 
55
{
 
56
    setError(UserDefinedError + 1);
 
57
    setErrorText(i18n("Could not load document %1", document()->url().pathOrUrl()));
 
58
    emitResult();
 
59
}
60
60
 
61
61
} // namespace