Bug 73039

Summary: cvs tools may crash kdevelop
Product: [Developer tools] kdevplatform Reporter: tnagy <tnagy256>
Component: cvsAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 0.9.94   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description tnagy 2004-01-20 17:14:26 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:          Linux

Open a file (html, picture, try with /etc/fstab, etc) then try "tools" -> "version control" -> "cvs" -> "ignore this file when doing cvs operation" : kdevelop will crash (it also works with "do not ignore this file when doing cvs operation" but not in the subversion section)
Comment 1 Jens Dagerbo 2004-01-20 17:42:14 UTC
Confirmed. This happens with both cvsclient and cvsservice plugins if the operations are invoked without a project loaded.

I've got it plugged locally and will commit shortly.. but shouldn't the whole "Version Control" menu be disabled when no project is loaded? Or does it make sense to do VCS operations on just any loaded file? 

Mario? :)
Comment 2 Jens Dagerbo 2004-01-20 19:38:08 UTC
Subject: kdevelop/vcs

CVS commit by dagerbo: 

Quick fix for bug 73039.

CCMAIL: 73039-done@bugs.kde.org


  M +4 -0      cvsclient/cvspart.cpp   1.71
  M +1 -1      cvsservice/cvspartimpl.cpp   1.23


--- kdevelop/vcs/cvsclient/cvspart.cpp  #1.70:1.71
@@ -977,4 +977,6 @@ void CvsPart::tag( const KURL::List& url
 void CvsPart::addToIgnoreList( const KURL::List& urlList )
 {
+        if ( !project() ) return;
+
     CvsUtils::addToIgnoreList( project()->projectDirectory(), urlList );
 }
@@ -984,4 +986,6 @@ void CvsPart::addToIgnoreList( const KUR
 void CvsPart::removeFromIgnoreList( const KURL::List& urlList )
 {
+        if ( !project() ) return;
+
     CvsUtils::removeFromIgnoreList( project()->projectDirectory(), urlList );
 }

--- kdevelop/vcs/cvsservice/cvspartimpl.cpp  #1.22:1.23
@@ -317,5 +317,5 @@ KDevMainWindow *CvsServicePartImpl::main
 QString CvsServicePartImpl::projectDirectory() const
 {
-    return m_part->project()->projectDirectory();
+    return m_part->project() ? m_part->project()->projectDirectory() : QString::null;
 }
 


Comment 3 Jens Dagerbo 2004-01-20 19:44:07 UTC
Should be backported to KDE_3_2_BRANCH.