Diffstat (limited to 'core/pim/addressbook/abview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abview.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/pim/addressbook/abview.cpp b/core/pim/addressbook/abview.cpp index 670cdb0..8d61582 100644 --- a/core/pim/addressbook/abview.cpp +++ b/core/pim/addressbook/abview.cpp | |||
@@ -32,100 +32,100 @@ QString addressbookPersonalVCardName() | |||
32 | { | 32 | { |
33 | QString filename = Global::applicationFileName("addressbook", | 33 | QString filename = Global::applicationFileName("addressbook", |
34 | "businesscard.vcf"); | 34 | "businesscard.vcf"); |
35 | return filename; | 35 | return filename; |
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
39 | AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): | 39 | AbView::AbView ( QWidget* parent, const QValueList<int>& ordered ): |
40 | QWidget(parent), | 40 | QWidget(parent), |
41 | mCat(0), | 41 | mCat(0), |
42 | m_inSearch( false ), | 42 | m_inSearch( false ), |
43 | m_inPersonal( false ), | 43 | m_inPersonal( false ), |
44 | m_curr_category( -1 ), | 44 | m_curr_category( -1 ), |
45 | m_curr_View( TableView ), | 45 | m_curr_View( TableView ), |
46 | m_prev_View( TableView ), | 46 | m_prev_View( TableView ), |
47 | m_curr_Contact ( 0 ), | 47 | m_curr_Contact ( 0 ), |
48 | m_contactdb ( 0l ), | 48 | m_contactdb ( 0l ), |
49 | m_storedDB ( 0l ), | 49 | m_storedDB ( 0l ), |
50 | m_viewStack( 0l ), | 50 | m_viewStack( 0l ), |
51 | m_abTable( 0l ), | 51 | m_abTable( 0l ), |
52 | m_orderedFields( ordered ) | 52 | m_orderedFields( ordered ) |
53 | { | 53 | { |
54 | qWarning("AbView::c'tor"); | 54 | qWarning("AbView::c'tor"); |
55 | // Load default database and handle syncing myself.. ! | 55 | // Load default database and handle syncing myself.. ! |
56 | m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ); | 56 | m_contactdb = new OContactAccess ( "addressbook", 0l, 0l, false ); |
57 | m_contactdb -> setReadAhead( 16 ); // Use ReadAhead-Cache if available | 57 | m_contactdb -> setReadAhead( 16 ); // Use ReadAhead-Cache if available |
58 | mCat.load( categoryFileName() ); | 58 | mCat.load( categoryFileName() ); |
59 | 59 | ||
60 | // Create Layout and put WidgetStack into it. | 60 | // Create Layout and put WidgetStack into it. |
61 | QVBoxLayout *vb = new QVBoxLayout( this ); | 61 | QVBoxLayout *vb = new QVBoxLayout( this ); |
62 | m_viewStack = new QWidgetStack( this ); | 62 | m_viewStack = new QWidgetStack( this ); |
63 | vb->addWidget( m_viewStack ); | 63 | vb->addWidget( m_viewStack ); |
64 | 64 | ||
65 | // Creat TableView | 65 | // Creat TableView |
66 | QVBox* tableBox = new QVBox( m_viewStack ); | 66 | QVBox* tableBox = new QVBox( m_viewStack ); |
67 | m_abTable = new AbTable( m_orderedFields, tableBox, "table" ); | 67 | m_abTable = new AbTable( m_orderedFields, tableBox, "table" ); |
68 | m_abTable->setCurrentCell( 0, 0 ); | 68 | m_abTable->setCurrentCell( 0, 0 ); |
69 | m_abTable->setFocus(); | 69 | m_abTable->setFocus(); |
70 | 70 | ||
71 | // Add TableView to WidgetStack and raise it | 71 | // Add TableView to WidgetStack and raise it |
72 | m_viewStack -> addWidget( tableBox , TableView ); | 72 | m_viewStack -> addWidget( tableBox , TableView ); |
73 | 73 | ||
74 | // Create CardView and add it to WidgetStack | 74 | // Create CardView and add it to WidgetStack |
75 | QVBox* cardBox = new QVBox( m_viewStack ); | 75 | QVBox* cardBox = new QVBox( m_viewStack ); |
76 | m_ablabel = new AbLabel( cardBox, "CardView"); | 76 | m_ablabel = new AbLabel( cardBox, "CardView"); |
77 | m_viewStack -> addWidget( cardBox , CardView ); | 77 | m_viewStack -> addWidget( cardBox , CardView ); |
78 | 78 | ||
79 | // Connect views to me | 79 | // Connect views to me |
80 | connect ( m_abTable, SIGNAL( signalSwitch( void ) ), | 80 | connect ( m_abTable, SIGNAL( signalSwitch(void) ), |
81 | this, SLOT( slotSwitch( void ) ) ); | 81 | this, SLOT( slotSwitch(void) ) ); |
82 | connect ( m_ablabel, SIGNAL( signalOkPressed( void ) ), | 82 | connect ( m_ablabel, SIGNAL( signalOkPressed(void) ), |
83 | this, SLOT( slotSwitch( void ) ) ); | 83 | this, SLOT( slotSwitch(void) ) ); |
84 | 84 | ||
85 | load(); | 85 | load(); |
86 | } | 86 | } |
87 | 87 | ||
88 | AbView::~AbView() | 88 | AbView::~AbView() |
89 | { | 89 | { |
90 | m_contactdb -> save(); | 90 | m_contactdb -> save(); |
91 | delete m_contactdb; | 91 | delete m_contactdb; |
92 | 92 | ||
93 | if ( m_storedDB ){ | 93 | if ( m_storedDB ){ |
94 | m_storedDB -> save(); | 94 | m_storedDB -> save(); |
95 | delete m_storedDB; | 95 | delete m_storedDB; |
96 | } | 96 | } |
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
100 | void AbView::setView( Views view ) | 100 | void AbView::setView( Views view ) |
101 | { | 101 | { |
102 | qWarning("AbView::setView( Views view )"); | 102 | qWarning("AbView::setView( Views view )"); |
103 | m_curr_View = view; | 103 | m_curr_View = view; |
104 | load(); | 104 | load(); |
105 | } | 105 | } |
106 | 106 | ||
107 | void AbView::addEntry( const OContact &newContact ) | 107 | void AbView::addEntry( const OContact &newContact ) |
108 | { | 108 | { |
109 | qWarning("abview:AddContact"); | 109 | qWarning("abview:AddContact"); |
110 | m_contactdb->add ( newContact ); | 110 | m_contactdb->add ( newContact ); |
111 | load(); | 111 | load(); |
112 | 112 | ||
113 | } | 113 | } |
114 | void AbView::removeEntry( const int UID ) | 114 | void AbView::removeEntry( const int UID ) |
115 | { | 115 | { |
116 | qWarning("abview:RemoveContact"); | 116 | qWarning("abview:RemoveContact"); |
117 | m_contactdb->remove( UID ); | 117 | m_contactdb->remove( UID ); |
118 | load(); | 118 | load(); |
119 | } | 119 | } |
120 | 120 | ||
121 | void AbView::replaceEntry( const OContact &contact ) | 121 | void AbView::replaceEntry( const OContact &contact ) |
122 | { | 122 | { |
123 | qWarning("abview:ReplaceContact"); | 123 | qWarning("abview:ReplaceContact"); |
124 | m_contactdb->replace( contact ); | 124 | m_contactdb->replace( contact ); |
125 | load(); | 125 | load(); |
126 | 126 | ||
127 | } | 127 | } |
128 | 128 | ||
129 | OContact AbView::currentEntry() | 129 | OContact AbView::currentEntry() |
130 | { | 130 | { |
131 | OContact currentContact; | 131 | OContact currentContact; |