00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #include <QVPropertyContainerChange>
00026 #include <QVPropertyContainer>
00027
00028
00029 QVPropertyContainerChange::QVPropertyContainerChange(const QVPropertyContainer * container, const ChangeType type, const QString prop):
00030 QObject(), source(container), sourceName(""), origName(""), destName(""), changeType(type), propName(prop), destPropName(""), sinchronous(FALSE)
00031 {
00032 if (container != NULL)
00033 sourceName = container->getName();
00034 }
00035
00036 QVPropertyContainerChange::QVPropertyContainerChange( const QVPropertyContainer * container,
00037 const ChangeType type,
00038 const QString contOrig,
00039 const QString propOrig,
00040 const QString contDest,
00041 const QString propDest,
00042 const bool sinc):
00043 QObject(), source(container), sourceName(""), origName(contOrig), destName(contDest), changeType(type), propName(propOrig), destPropName(propDest),
00044 sinchronous(sinc)
00045 {
00046 if (container != NULL)
00047 sourceName = container->getName();
00048 }
00049
00050
00051 QString QVPropertyContainerChange::toString() const
00052 {
00053 QString result("Change emited from ");
00054 result+= sourceName;
00055 result += ", of type ";
00056
00057 switch (changeType) {
00058 case Name:
00059 result += "Name";
00060 break;
00061
00062
00063
00064 case ContainerDel:
00065 result += "ContainerDel";
00066 break;
00067 case PropertyAdd:
00068 result += "PropertyAdd: ";
00069 result += propName;
00070 break;
00071 case PropertyDel:
00072 result += "PropertyDel: ";
00073 result += propName;
00074 break;
00075 case PropertyValue:
00076 result += "PropertyValue: ";
00077 result += propName;
00078 break;
00079 case LinkAdd:
00080 result += "LinkAdd: ";
00081 result += origName;
00082 result += "[";
00083 result += propName;
00084 result += "] => ";
00085 result += destName;
00086 result += "[";
00087 result += destPropName;
00088 result += "]";
00089 break;
00090 case LinkDel:
00091 result += "LinkDel: ";
00092 result += origName;
00093 result += "[";
00094 result += propName;
00095 result += "] => ";
00096 result += destName;
00097 result += "[";
00098 result += destPropName;
00099 result += "]";
00100 break;
00101 case All:
00102 result += "All";
00103 break;
00104 default:
00105 result += "None";
00106 break;
00107 }
00108 result += ".";
00109
00110 return result;
00111 }
00112