static int ShowLogDialog(const QString& fileName) { KConfig* config = new KConfig("cervisiapartrc"); LogDialog* dlg = new LogDialog(*config); // get directory for file const QFileInfo fi(fileName); QString directory = fi.absolutePath(); // start the cvs DCOP service OrgKdeCervisiaCvsserviceCvsserviceInterface* cvsService = StartDBusService(directory); if( dlg->parseCvsLog(cvsService, fi.fileName()) ) dlg->show(); else delete dlg; int result = qApp->exec(); // stop the cvs D-Bus service cvsService->quit(); delete cvsService; delete config; return result; }
static int ShowLogDialog(const QString& fileName) { KConfig* config = new KConfig("cervisiapartrc"); LogDialog* dlg = new LogDialog(*config); kapp->setMainWidget(dlg); // get directory for file const QFileInfo fi(fileName); QString directory = fi.dirPath(true); // start the cvs DCOP service CvsService_stub* cvsService = StartDCOPService(directory); if( dlg->parseCvsLog(cvsService, fi.fileName()) ) dlg->show(); else delete dlg; int result = kapp->exec(); // stop the cvs DCOP service cvsService->quit(); delete cvsService; delete config; return result; }