Commit 3bf623f8 authored by Christian Loose's avatar Christian Loose

Crash less when we couldn't start the cvs DCOP service.

svn path=/trunk/kdesdk/cervisia/; revision=230167
parent 528aed08
......@@ -98,11 +98,10 @@ CervisiaPart::CervisiaPart( QWidget *parentWidget, const char *widgetName,
// we can't start the cvs DCOP service
KMessageBox::sorry(0, "Starting cvsservice failed with message: " +
error, "Cervisia");
return;
}
// create a reference to the service
cvsService = new CvsService_stub(appId, "CvsService");
else
// create a reference to the service
cvsService = new CvsService_stub(appId, "CvsService");
// Create UI
KConfig *conf = config();
......@@ -150,7 +149,8 @@ CervisiaPart::CervisiaPart( QWidget *parentWidget, const char *widgetName,
CervisiaPart::~CervisiaPart()
{
// stop the cvs DCOP service and delete reference
cvsService->quit();
if( cvsService )
cvsService->quit();
delete cvsService;
writeSettings();
......@@ -1540,6 +1540,10 @@ void CervisiaPart::slotJobFinished()
bool CervisiaPart::openSandbox(const QString &dirname)
{
// Do we have a cvs service?
if( !cvsService )
return false;
Repository_stub cvsRepository(cvsService->app(), "CvsRepository");
// change the working copy directory for the cvs DCOP service
......
......@@ -180,10 +180,15 @@ void CervisiaShell::writeSettings()
KConfig* config = KGlobal::config();
config->setGroup("Session");
config->writeEntry("Current Directory", part->url().path());
// Save current working directory (if part was created)
if( part )
{
config->writeEntry("Current Directory", part->url().path());
// write to disk
config->sync();
// write to disk
config->sync();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment