[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdevelop/vcs/subversion
From:       Tobias Gläßer <tobi.web () gmx ! de>
Date:       2004-06-30 22:39:07
Message-ID: 20040630223907.A41AF9447 () office ! kde ! org
[Download RAW message or body]

CVS commit by tobgle: 

Implemented isValidDirectory() and made the SVN context menu working only, if there \
is really a svn repository in the project.


  M +11 -1     subversion_part.cpp   1.19


--- kdevelop/vcs/subversion/subversion_part.cpp  #1.18:1.19
@@ -168,8 +168,18 @@ KDevVCSFileInfoProvider * subversionPart
 
 bool subversionPart::isValidDirectory( const QString& dirPath) {
-        return true;
+    QString svn = "/.svn/";
+    QDir svndir( dirPath + svn );
+    QString entriesFileName = dirPath + svn + "entries";
+
+    return svndir.exists() &&
+        QFile::exists( entriesFileName );
 }
 
 void subversionPart::contextMenu( QPopupMenu *popup, const Context *context ) {
+// If the current project doesn't support SVN, we don't
+// want to confuse the user with a SVN popup menu.
+if(!isValidDirectory(project()->projectDirectory()))
+  return;
+  
         kdDebug() << "contextMenu()" << endl;
         if (context->hasType( Context::FileContext ) ||


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic