1
/***************************************************************************
2
smb4ksynchronizer_p - This file contains private helper classes for
3
the Smb4KSynchronizer class.
6
copyright : (C) 2008-2011 by Alexander Reinholdt
7
email : alexander.reinholdt@kdemail.net
8
***************************************************************************/
10
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
* This program is distributed in the hope that it will be useful, but *
17
* WITHOUT ANY WARRANTY; without even the implied warranty of *
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19
* General Public License for more details. *
21
* You should have received a copy of the GNU General Public License *
22
* along with this program; if not, write to the *
23
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
25
***************************************************************************/
27
#ifndef SMB4KSYNCHRONIZER_P_H
28
#define SMB4KSYNCHRONIZER_P_H
36
#include <kurlrequester.h>
38
#include <kuiserverjobtracker.h>
40
// application specific includes
41
#include <smb4ksynchronizer.h>
42
#include <smb4kprocess.h>
45
class Smb4KSyncJob : public KJob
53
Smb4KSyncJob( QObject *parent = 0 );
61
* Returns TRUE if the job was started and FALSE
64
* @returns TRUE if the job was started
66
bool isStarted() { return m_started; }
69
* Starts the synchronization
74
* Setup the synchronization process. You need to set the share, the parent
77
* This function must be called before start() is run.
79
* @param src The source
81
* @param dest The destination
83
void setupSynchronization( Smb4KShare *share,
84
QWidget *parent = 0 );
87
* Returns the source directory.
89
* @returns the source directory.
91
const KUrl &source() { return m_src; }
94
* Returns the destination directory.
96
* @returns the destination directory.
98
const KUrl &destination() { return m_dest; }
102
* This signal is emitted when a job is started. The emitted path
103
* is the one of the destination.
105
* @param dest The destination's URL
107
void aboutToStart( const QString &dest );
110
* This signal is emitted when a job has finished. The emitted
111
* URL is the one of the destination.
113
* @param dest The destination's URL
115
void finished( const QString &dest );
119
* Reimplemented from KJob. Kills the internal process and
120
* then the job itself.
125
void slotStartSynchronization();
126
void slotReadStandardOutput();
127
void slotReadStandardError();
128
void slotProcessFinished( int exitCode, QProcess::ExitStatus status );
133
QWidget *m_parent_widget;
136
Smb4KProcess *m_proc;
137
KUiServerJobTracker *m_job_tracker;
141
class Smb4KSynchronizationDialog : public KDialog
149
* @param share The share item
151
* @param parent The parent widget
153
Smb4KSynchronizationDialog( Smb4KShare *share, QWidget *parent = 0 );
158
~Smb4KSynchronizationDialog();
166
* The destination URL
168
const KUrl destination();
172
* This slot is called when the User1 button is clicked.
173
* It initializes the synchronization.
175
void slotUser1Clicked();
178
* This slot is called when the User2 button is clicked.
179
* It swaps the source and destination.
181
void slotUser2Clicked();
184
* This slot is called when the Cancel button is clicked.
185
* It aborts any action the synchronizer is performing.
187
void slotUser3Clicked();
191
* A pointer to the share object
196
* The source URL requester
198
KUrlRequester *m_source;
201
* The destination URL requester
203
KUrlRequester *m_destination;
207
class Smb4KSynchronizerPrivate
210
Smb4KSynchronizerPrivate() {};
211
~Smb4KSynchronizerPrivate() {};
212
Smb4KSynchronizer instance;