From 2bfae6336f88a460311abaf727256c3413b27f67 Mon Sep 17 00:00:00 2001 From: eilers Date: Wed, 16 Oct 2002 10:55:17 +0000 Subject: Fixed reload after sync- bug --- (limited to 'core/pim/addressbook/addressbook.cpp') 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 @@ -67,18 +67,6 @@ #include #include "picker.h" -static QString addressbookOldXMLFilename() -{ - QString filename = QPEApplication::documentDir() + "addressbook.xml"; - return filename; -} - -static QString addressbookXMLFilename() -{ - QString filename = Global::applicationFileName("addressbook", - "addressbook.xml"); - return filename; -} static QString addressbookPersonalVCardName() { @@ -202,21 +190,6 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, a->addTo( edit ); // Create Views - - // This is safe to call without checking to see if it exists... - // not to mention it also does the necessary stuff for the - // journaling... - QString str = addressbookXMLFilename(); - if ( str.isNull() ) { - QMessageBox::warning( - this, - tr("Out of Space"), - tr("There is not enough space to create\n" - "neccessary startup files.\n" - "\nFree up some space before\nentering data!") - ); - } - listContainer = new QWidget( this ); QVBoxLayout *vb = new QVBoxLayout( listContainer ); @@ -230,11 +203,7 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, mView = 0; - abList->load( addressbookXMLFilename() ); - if ( QFile::exists(addressbookOldXMLFilename()) ) { - abList->load( addressbookOldXMLFilename() ); - QFile::remove(addressbookOldXMLFilename()); - } + abList->load(); pLabel = new LetterPicker( listContainer ); connect(pLabel, SIGNAL(letterClicked(char)), this, SLOT(slotSetLetter(char))); @@ -709,13 +678,13 @@ void AddressbookWindow::reload() { syncing = FALSE; abList->clear(); - abList->load( addressbookXMLFilename() ); + abList->reload(); } void AddressbookWindow::flush() { syncing = TRUE; - abList->save( addressbookXMLFilename() ); + abList->save(); } @@ -755,9 +724,8 @@ void AddressbookWindow::closeEvent( QCloseEvent *e ) bool AddressbookWindow::save() { - QString str = addressbookXMLFilename(); - if ( str.isNull() ) { - if ( QMessageBox::critical( 0, tr("Out of space"), + if ( !abList->save() ) { + if ( QMessageBox::critical( 0, tr( "Out of space" ), tr("Unable to save information.\n" "Free up some space\n" "and try again.\n" @@ -768,20 +736,6 @@ bool AddressbookWindow::save() return TRUE; else return FALSE; - } else { - if ( !abList->save( str ) ) { - if ( QMessageBox::critical( 0, tr( "Out of space" ), - tr("Unable to save information.\n" - "Free up some space\n" - "and try again.\n" - "\nQuit anyway?"), - QMessageBox::Yes|QMessageBox::Escape, - QMessageBox::No|QMessageBox::Default ) - != QMessageBox::No ) - return TRUE; - else - return FALSE; - } } return TRUE; } -- cgit v0.9.0.2