Don't keep compiling/run if something failed.
[kdevelopdvcssupport.git] / plugins / teamwork / filesynchronizemessage.h
blob4e3e9410832c4f11d2e44413fba2967135e15a32
1 /***************************************************************************
2 Copyright 2006 David Nolden <david.nolden.kdevelop@art-master.de>
3 ***************************************************************************/
5 /***************************************************************************
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 ***************************************************************************/
13 #ifndef FILESYNCHRONIZEMESSAGE_H
14 #define FILESYNCHRONIZEMESSAGE_H
16 #include "filecollaborationmessages.h"
17 #include "qdynamictext.h"
19 class DynamicText;
21 class FileSynchronizeData {
23 public:
24 explicit FileSynchronizeData( const QString& fileName = "", const QDynamicText& text = QDynamicText(), bool sendDynamic = true );
26 template <class Archive>
27 void serialize( Archive& arch, unsigned int /*version*/ ) {
28 try {
29 arch & m_text;
31 catch( const DynamicTextError& err ) {
32 throw Teamwork::NonFatalSerializationError( "FileSynchronizeData::serialize(): " + err.what() );
34 arch & m_fileName;
35 arch & m_fileText;
36 arch & m_state;
39 QString fileName() {
40 return m_fileName;
43 VectorTimestamp state() {
44 return m_state;
47 QDynamicTextPointer createDynamicText();
48 private:
49 QString m_fileText;
50 QString m_fileName;
51 VectorTimestamp m_state;
52 SharedPtr<QDynamicText, BoostSerializationNormal> m_text;
55 EASY_DECLARE_MESSAGE( FileSynchronize, DocumentWrapperMessage, 3, FileSynchronizeData, 3 );
57 BOOST_CLASS_IMPLEMENTATION( FileSynchronizeData, boost::serialization::object_serializable )
59 // kate: space-indent on; indent-width 2; tab-width 2; replace-tabs on
60 ///Eventually think about sending a whole history with a FileSynchronize
62 #endif