Bug 73039 - cvs tools may crash kdevelop
Summary: cvs tools may crash kdevelop
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: cvs (show other bugs)
Version: 0.9.94
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-20 17:14 UTC by tnagy
Modified: 2010-12-16 19:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.