summaryrefslogtreecommitdiff
authoreilers <eilers>2002-10-16 10:55:17 (UTC)
committer eilers <eilers>2002-10-16 10:55:17 (UTC)
commit2bfae6336f88a460311abaf727256c3413b27f67 (patch) (side-by-side diff)
treef554fcecb260ef506a839f4d7994f427ad184555
parentf9756ca203a06fa60413ef1a96416d87b9dc1a6b (diff)
downloadopie-2bfae6336f88a460311abaf727256c3413b27f67.zip
opie-2bfae6336f88a460311abaf727256c3413b27f67.tar.gz
opie-2bfae6336f88a460311abaf727256c3413b27f67.tar.bz2
Fixed reload after sync- bug
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/TODO8
-rw-r--r--core/pim/addressbook/abtable.cpp21
-rw-r--r--core/pim/addressbook/abtable.h5
-rw-r--r--core/pim/addressbook/addressbook.cpp56
4 files changed, 25 insertions, 65 deletions
diff --git a/core/pim/addressbook/TODO b/core/pim/addressbook/TODO
index 32d2838..7bc906d 100644
--- a/core/pim/addressbook/TODO
+++ b/core/pim/addressbook/TODO
@@ -2,5 +2,6 @@ Stuff todo:
Urgent:
-- Syncing: abtable not reloaded after sync.
+
+- Font menu is invisible using german translation
Important:
@@ -21,6 +22,7 @@ Less important:
-Should be Fixed:
+Should be Fixed (not absolute sure, need validation):
- "Nonenglish" translation bug has to be fixed.
-Fixed: \ No newline at end of file
+Fixed:
+- Syncing: abtable not reloaded after sync.
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index 70c070f..91a7171 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -471,15 +471,14 @@ void AbTable::resizeRows() {
-bool AbTable::save( const QString& /* fn */ )
+bool AbTable::save()
{
// QTime t;
// t.start();
qWarning("abtable:Save data");
- m_contactdb.save();
-
- return true;
+
+ return m_contactdb.save();
}
-void AbTable::load( const QString& /* fn */ )
+void AbTable::load()
{
setSorting( false );
@@ -495,13 +494,17 @@ void AbTable::load( const QString& /* fn */ )
insertIntoTable( *it, row++ );
- resort();
-
setUpdatesEnabled( TRUE );
-
+
setSorting( true );
- //resort();
+ resort();
}
+void AbTable::reload()
+{
+ m_contactdb.reload();
+ load();
+}
+
void AbTable::realignTable( int row )
{
diff --git a/core/pim/addressbook/abtable.h b/core/pim/addressbook/abtable.h
index 84aef1e..80c3ca0 100644
--- a/core/pim/addressbook/abtable.h
+++ b/core/pim/addressbook/abtable.h
@@ -78,6 +78,7 @@ public:
void loadFields();
void refresh();
- bool save( const QString &fn );
- void load( const QString &fn );
+ bool save();
+ void load();
+ void reload();
// addresspicker mode
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 @@
#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()
@@ -203,19 +191,4 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
// 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 );
@@ -231,9 +204,5 @@ 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 );
@@ -710,5 +679,5 @@ void AddressbookWindow::reload()
syncing = FALSE;
abList->clear();
- abList->load( addressbookXMLFilename() );
+ abList->reload();
}
@@ -716,5 +685,5 @@ void AddressbookWindow::flush()
{
syncing = TRUE;
- abList->save( addressbookXMLFilename() );
+ abList->save();
}
@@ -756,7 +725,6 @@ 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"
@@ -769,18 +737,4 @@ bool AddressbookWindow::save()
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;