kitchensync
profile.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <kapplication.h>
00023
00024 #include "profile.h"
00025
00026 using namespace KSync;
00027
00028 Profile::Profile()
00029 {
00030
00031 m_uid =kapp->randomString( 8 );
00032 }
00033
00034 Profile::Profile( const Profile& prof )
00035 {
00036 (*this) = prof;
00037 }
00038
00039 Profile::~Profile()
00040 {
00041 }
00042
00043 QString Profile::name() const
00044 {
00045 return m_name;
00046 }
00047
00048 QString Profile::uid() const
00049 {
00050 return m_uid;
00051 }
00052
00053 QString Profile::pixmap() const
00054 {
00055 return m_pixmap;
00056 }
00057
00058 bool Profile::confirmDelete() const
00059 {
00060 return m_confirmDelete;
00061 }
00062
00063 bool Profile::confirmSync() const
00064 {
00065 return m_confirmSync;
00066 }
00067
00068 void Profile::setName( const QString &name )
00069 {
00070 m_name = name;
00071 }
00072
00073 void Profile::setPixmap( const QString &pixmap )
00074 {
00075 m_pixmap = pixmap;
00076 }
00077
00078 void Profile::setUid( const QString &uid )
00079 {
00080 m_uid = uid;
00081 }
00082
00083 void Profile::setActionParts( const ActionPartService::List &list )
00084 {
00085 m_actionPartServices = list;
00086 }
00087
00088 ActionPartService::List Profile::actionParts() const
00089 {
00090 return m_actionPartServices;
00091 }
00092
00093 QMap<QString,QString> Profile::paths() const
00094 {
00095 return m_map;
00096 }
00097
00098 void Profile::setPaths(const QMap<QString, QString>& map )
00099 {
00100 m_map = map;
00101 }
00102
00103 void Profile::setPath( const QString& partName, const QString& path )
00104 {
00105 m_map.replace( partName, path );
00106 }
00107
00108 void Profile::setConfirmSync( bool b )
00109 {
00110 m_confirmSync = b;
00111 }
00112
00113 void Profile::setConfirmDelete( bool b )
00114 {
00115 m_confirmDelete = b;
00116 }
00117
00118 QString Profile::path( const QString &partName ) const
00119 {
00120 QMap<QString, QString>::ConstIterator it;
00121 QString path;
00122 it = m_map.find( partName );
00123 if ( it != m_map.end() )
00124 path = it.data();
00125
00126 return path;
00127 }
00128
00129 Profile &Profile::operator=( const Profile &prof )
00130 {
00131 if (&prof == this ) return *this;
00132
00133 m_name = prof.m_name;
00134 m_uid = prof.m_uid;
00135 m_pixmap = prof.m_pixmap;
00136 m_actionPartServices = prof.m_actionPartServices;
00137 m_map = prof.m_map;
00138 m_confirmSync = prof.m_confirmSync;
00139 m_confirmDelete = prof.m_confirmDelete;
00140 return *this;
00141 }
00142
00143 bool Profile::operator==( const Profile &prof2 ) {
00144 if ( uid() == prof2.uid() &&
00145 name() == prof2.name() &&
00146 pixmap() == prof2.pixmap() )
00147 return true;
00148 else return false;
00149
00150 }
00151
00152
00153
00154
00155
|