From kde-commits Thu Sep 30 22:23:26 2004 From: Adriaan de Groot Date: Thu, 30 Sep 2004 22:23:26 +0000 To: kde-commits Subject: kdepim/kpilot/lib Message-Id: <20040930222326.69FC49908 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=109658301631964 CVS commit by adridg: Fewer casts and dicking about M +22 -15 plugin.cc 1.33 --- kdepim/kpilot/lib/plugin.cc #1.32:1.33 @@ -148,7 +148,8 @@ bool ConduitAction::openDatabases_(const #endif - fLocalDatabase = new PilotLocalDatabase(name, true); + KPILOT_DELETE(fLocalDatabase); + PilotLocalDatabase *localDB = new PilotLocalDatabase(name, true); - if (!fLocalDatabase) + if (!localDB) { kdWarning() << k_funcinfo @@ -156,12 +157,13 @@ bool ConduitAction::openDatabases_(const << name << "\"" << endl; + if (retrieved) *retrieved = false; return false; } // if there is no backup db yet, fetch it from the palm, open it and set the full sync flag. - if (!fLocalDatabase->isDBOpen() ) + if (!localDB->isDBOpen() ) { - QString dbpath(dynamic_cast(fLocalDatabase)->dbPathName()); - KPILOT_DELETE(fLocalDatabase); + QString dbpath(localDB->dbPathName()); + KPILOT_DELETE(localDB); #ifdef DEBUG DEBUGCONDUIT << fname @@ -175,4 +177,5 @@ bool ConduitAction::openDatabases_(const << ": Could not get DBInfo for "<isDBOpen()) + localDB = new PilotLocalDatabase(name, true); + if (!localDB || !localDB->isDBOpen()) { #ifdef DEBUG DEBUGCONDUIT << fname << ": local backup of database "<