summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp54
1 files changed, 4 insertions, 50 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 2eb9ddf..93581e8 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -68,16 +68,4 @@
68 68
69#include "picker.h" 69#include "picker.h"
70static QString addressbookOldXMLFilename()
71{
72 QString filename = QPEApplication::documentDir() + "addressbook.xml";
73 return filename;
74}
75
76static QString addressbookXMLFilename()
77{
78 QString filename = Global::applicationFileName("addressbook",
79 "addressbook.xml");
80 return filename;
81}
82 70
83static QString addressbookPersonalVCardName() 71static QString addressbookPersonalVCardName()
@@ -203,19 +191,4 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
203 191
204 // Create Views 192 // Create Views
205
206 // This is safe to call without checking to see if it exists...
207 // not to mention it also does the necessary stuff for the
208 // journaling...
209 QString str = addressbookXMLFilename();
210 if ( str.isNull() ) {
211 QMessageBox::warning(
212 this,
213 tr("Out of Space"),
214 tr("There is not enough space to create\n"
215 "neccessary startup files.\n"
216 "\nFree up some space before\nentering data!")
217 );
218 }
219
220 listContainer = new QWidget( this ); 193 listContainer = new QWidget( this );
221 194
@@ -231,9 +204,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
231 mView = 0; 204 mView = 0;
232 205
233 abList->load( addressbookXMLFilename() ); 206 abList->load();
234 if ( QFile::exists(addressbookOldXMLFilename()) ) {
235 abList->load( addressbookOldXMLFilename() );
236 QFile::remove(addressbookOldXMLFilename());
237 }
238 207
239 pLabel = new LetterPicker( listContainer ); 208 pLabel = new LetterPicker( listContainer );
@@ -710,5 +679,5 @@ void AddressbookWindow::reload()
710 syncing = FALSE; 679 syncing = FALSE;
711 abList->clear(); 680 abList->clear();
712 abList->load( addressbookXMLFilename() ); 681 abList->reload();
713} 682}
714 683
@@ -716,5 +685,5 @@ void AddressbookWindow::flush()
716{ 685{
717 syncing = TRUE; 686 syncing = TRUE;
718 abList->save( addressbookXMLFilename() ); 687 abList->save();
719} 688}
720 689
@@ -756,6 +725,5 @@ void AddressbookWindow::closeEvent( QCloseEvent *e )
756bool AddressbookWindow::save() 725bool AddressbookWindow::save()
757{ 726{
758 QString str = addressbookXMLFilename(); 727 if ( !abList->save() ) {
759 if ( str.isNull() ) {
760 if ( QMessageBox::critical( 0, tr("Out of space"), 728 if ( QMessageBox::critical( 0, tr("Out of space"),
761 tr("Unable to save information.\n" 729 tr("Unable to save information.\n"
@@ -769,18 +737,4 @@ bool AddressbookWindow::save()
769 else 737 else
770 return FALSE; 738 return FALSE;
771 } else {
772 if ( !abList->save( str ) ) {
773 if ( QMessageBox::critical( 0, tr( "Out of space" ),
774 tr("Unable to save information.\n"
775 "Free up some space\n"
776 "and try again.\n"
777 "\nQuit anyway?"),
778 QMessageBox::Yes|QMessageBox::Escape,
779 QMessageBox::No|QMessageBox::Default )
780 != QMessageBox::No )
781 return TRUE;
782 else
783 return FALSE;
784 }
785 } 739 }
786 return TRUE; 740 return TRUE;