~ubuntu-branches/ubuntu/vivid/smb4k/vivid

« back to all changes in this revision

Viewing changes to core/smb4kprint.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-06-15 16:27:38 UTC
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: package-import@ubuntu.com-20140615162738-t1426an8s5beix1b
Tags: upstream-1.1.2
ImportĀ upstreamĀ versionĀ 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
    smb4kprint  -  The (new) printing core class.
3
3
                             -------------------
4
4
    begin                : Son Feb 20 2011
5
 
    copyright            : (C) 2011 by Alexander Reinholdt
 
5
    copyright            : (C) 2011-2012 by Alexander Reinholdt
6
6
    email                : alexander.reinholdt@kdemail.net
7
7
 ***************************************************************************/
8
8
 
23
23
 *   MA 02110-1335, USA                                                    *
24
24
 ***************************************************************************/
25
25
 
 
26
#ifdef HAVE_CONFIG_H
 
27
#include <config.h>
 
28
#endif
 
29
 
 
30
// application specific includes
 
31
#include "smb4kprint.h"
 
32
#include "smb4kprint_p.h"
 
33
#include "smb4kshare.h"
 
34
#include "smb4knotification.h"
 
35
#include "smb4kauthinfo.h"
 
36
#include "smb4kwalletmanager.h"
 
37
#include "smb4kglobal.h"
 
38
 
26
39
// Qt includes
27
40
#include <QTimer>
28
41
#include <QDebug>
32
45
#include <kglobal.h>
33
46
#include <kstandarddirs.h>
34
47
 
35
 
// application specific includes
36
 
#include <smb4kprint.h>
37
 
#include <smb4kprint_p.h>
38
 
#include <smb4kshare.h>
39
 
#include <smb4knotification.h>
40
 
#include <smb4kauthinfo.h>
41
 
#include <smb4kwalletmanager.h>
42
 
 
43
 
K_GLOBAL_STATIC( Smb4KPrintPrivate, p );
44
 
 
45
 
 
46
 
Smb4KPrint::Smb4KPrint() : KCompositeJob( 0 )
 
48
using namespace Smb4KGlobal;
 
49
 
 
50
 
 
51
K_GLOBAL_STATIC( Smb4KPrintStatic, p );
 
52
 
 
53
 
 
54
Smb4KPrint::Smb4KPrint( QObject *parent )
 
55
: KCompositeJob( parent )
47
56
{
48
57
  setAutoDelete( false );
 
58
 
 
59
  if ( !coreIsInitialized() )
 
60
  {
 
61
    setDefaultSettings();
 
62
  }
 
63
  else
 
64
  {
 
65
    // Do nothing
 
66
  }
49
67
  
50
 
  connect( QCoreApplication::instance(), SIGNAL( aboutToQuit() ), SLOT( slotAboutToQuit() ) );
 
68
  connect( QCoreApplication::instance(), SIGNAL(aboutToQuit()), SLOT(slotAboutToQuit()) );
51
69
}
52
70
 
53
71
 
82
100
  job->setObjectName( QString( "PrintJob_%1" ).arg( printer->unc() ) );
83
101
  job->setupPrinting( printer, parent );
84
102
  
85
 
  connect( job, SIGNAL( result( KJob * ) ), SLOT( slotJobFinished( KJob * ) ) );
86
 
  connect( job, SIGNAL( authError( Smb4KPrintJob * ) ), SLOT( slotAuthError( Smb4KPrintJob * ) ) );
87
 
  connect( job, SIGNAL( aboutToStart( Smb4KShare * ) ), SIGNAL( aboutToStart( Smb4KShare * ) ) );
88
 
  connect( job, SIGNAL( finished( Smb4KShare * ) ), SIGNAL( finished( Smb4KShare * ) ) );
 
103
  connect( job, SIGNAL(result(KJob*)), SLOT(slotJobFinished(KJob*)) );
 
104
  connect( job, SIGNAL(authError(Smb4KPrintJob*)), SLOT(slotAuthError(Smb4KPrintJob*)) );
 
105
  connect( job, SIGNAL(aboutToStart(Smb4KShare*)), SIGNAL(aboutToStart(Smb4KShare*)) );
 
106
  connect( job, SIGNAL(finished(Smb4KShare*)), SIGNAL(finished(Smb4KShare*)) );
89
107
  
90
108
  addSubjob( job );
91
109
  
95
113
 
96
114
bool Smb4KPrint::isRunning()
97
115
{
98
 
  return !subjobs().isEmpty();
 
116
  return hasSubjobs();
99
117
}
100
118
 
101
119
 
148
166
 
149
167
void Smb4KPrint::start()
150
168
{
151
 
  QTimer::singleShot( 0, this, SLOT( slotStartJobs() ) );
 
169
  QTimer::singleShot( 0, this, SLOT(slotStartJobs()) );
152
170
}
153
171
 
154
172