[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdepim/kpilot/lib
From: Adriaan de Groot <groot () kde ! org>
Date: 2004-09-30 22:23:26
Message-ID: 20040930222326.69FC49908 () office ! kde ! org
[Download RAW message or body]
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<PilotLocalDatabase*>(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 "<<name<<"! "<<endl;
#endif
+ if (retrieved) *retrieved = false;
return false;
}
@@ -190,5 +193,6 @@ bool ConduitAction::openDatabases_(const
QFileInfo fi(dbpath);
QString path(QFileInfo(dbpath).dir(TRUE).absPath());
- if (!KStandardDirs::exists(path)) {
+ if (!KStandardDirs::exists(path))
+ {
KStandardDirs::makeDir(path);
}
@@ -198,16 +202,19 @@ bool ConduitAction::openDatabases_(const
DEBUGCONDUIT << fname << ": Could not retrieve database \
"<<name<<" from the handheld."<<endl; #endif
+ if (retrieved) *retrieved = false;
return false;
}
- fLocalDatabase = new PilotLocalDatabase(name, true);
- if (!fLocalDatabase || !fLocalDatabase->isDBOpen())
+ localDB = new PilotLocalDatabase(name, true);
+ if (!localDB || !localDB->isDBOpen())
{
#ifdef DEBUG
DEBUGCONDUIT << fname << ": local backup of database \
"<<name<<" could not be initialized."<<endl; #endif
+ if (retrieved) *retrieved = false;
return false;
}
if (retrieved) *retrieved=true;
}
+ fLocalDatabase = localDB;
// These latin1()'s are ok, since database names are latin1-coded.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic