~ubuntu-branches/ubuntu/lucid/konversation/lucid-updates

« back to all changes in this revision

Viewing changes to src/dcc/transfer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Modestas Vainius
  • Date: 2009-05-15 11:24:24 UTC
  • mfrom: (1.15.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 47.
  • Revision ID: james.westby@ubuntu.com-20090515112424-b74i26lciabf4qnk
Tags: 1.1.75+svn968012-1
* New upstream development snapshot:
  - Last Changed Author: hein
  - Last Changed Rev: 968012
  - Last Changed Date: 2009-05-14 21:03:55 +0300
* Update README.source.
* Use dh --quilt instead of custom patch handling, build depend on
  quilt 0.46-7~.
* Update patches to upstream changes.
* Update konversation.install: remove docs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
*/
13
13
 
14
14
#include "transfer.h" ////// header renamed
 
15
#include "application.h" ////// header renamed
 
16
#include "connectionmanager.h"
 
17
#include "notificationhandler.h"
15
18
#include "preferences.h"
16
19
 
17
20
#include <qfileinfo.h>
137
140
    updateTransferMeters();
138
141
}
139
142
 
 
143
void DccTransfer::cleanUp()
 
144
{
 
145
}
 
146
 
 
147
// just for convenience
 
148
void DccTransfer::failed( const QString& errorMessage )
 
149
{
 
150
    cleanUp();
 
151
    KonversationApplication* konv_app = KonversationApplication::instance();
 
152
    Server* server = konv_app->getConnectionManager()->getServerByConnectionId( m_connectionId );
 
153
    if (server)
 
154
    {
 
155
        kDebug() << "notification:" << errorMessage;
 
156
        konv_app->notificationHandler()->dccError(server->getStatusView(), errorMessage);
 
157
    }
 
158
    setStatus( Failed, errorMessage );
 
159
    emit done( this );
 
160
}
 
161
 
140
162
void DccTransfer::setStatus( DccStatus status, const QString& statusDetail )
141
163
{
142
164
    bool changed = ( status != m_status );
147
169
    {
148
170
        emit statusChanged( this, m_status, oldStatus );
149
171
    }
 
172
 
 
173
    if (m_status == Done)
 
174
    {
 
175
        KonversationApplication* konv_app = KonversationApplication::instance();
 
176
        Server* server = konv_app->getConnectionManager()->getServerByConnectionId( m_connectionId );
 
177
        if (server)
 
178
        {
 
179
            kDebug() << "notification:" << m_fileName;
 
180
            konv_app->notificationHandler()->dccTransferDone(server->getStatusView(), m_fileName);
 
181
        }
 
182
    }
150
183
}
151
184
 
152
185
void DccTransfer::updateTransferMeters()