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 "<