summaryrefslogtreecommitdiffstats
path: root/vcs/cvsservice/cvsoptions.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /vcs/cvsservice/cvsoptions.h
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'vcs/cvsservice/cvsoptions.h')
-rw-r--r--vcs/cvsservice/cvsoptions.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/vcs/cvsservice/cvsoptions.h b/vcs/cvsservice/cvsoptions.h
new file mode 100644
index 00000000..222a34c7
--- /dev/null
+++ b/vcs/cvsservice/cvsoptions.h
@@ -0,0 +1,102 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Mario Scalas *
+ * mario.scalas@libero.it *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef CVSOPTIONS_H
+#define CVSOPTIONS_H
+
+#include <qstring.h>
+#include <qdom.h>
+
+class CvsServicePart;
+class KConfig;
+class KDevProject;
+
+/* This class represents the command line options for the used cvs commands.
+ * It uses the singleton pattern.
+ * @author Mario Scalas <mario.scalas@libero.it>
+*/
+class CvsOptions
+{
+public:
+ static CvsOptions *instance();
+
+ static QString invalidLocation;
+
+ virtual ~CvsOptions();
+
+ void save( KDevProject *project );
+ /// \FIXME parameter should be const!!
+ void load( KDevProject *project );
+
+ void setRecursiveWhenCommitRemove( bool b );
+ bool recursiveWhenCommitRemove() const;
+
+ void setPruneEmptyDirsWhenUpdate( bool b );
+ bool pruneEmptyDirsWhenUpdate() const;
+
+ void setRecursiveWhenUpdate( bool b );
+ bool recursiveWhenUpdate() const;
+
+ void setCreateDirsWhenUpdate( bool b );
+ bool createDirsWhenUpdate() const;
+
+ void setDiffOptions( const QString &p );
+ QString diffOptions();
+
+ void setRevertOptions( const QString &p );
+ QString revertOptions();
+
+ void setCvsRshEnvVar( const QString &p );
+ QString cvsRshEnvVar();
+
+ /**
+ * Will try to determine location by using CVS/Root file
+ */
+ QString guessLocation( const QString &projectDir ) const;
+
+ /**
+ * Set server path string (this should be called by the part when a new project
+ * is created or imported)
+ * @param p (i.e. :pserver:marios@cvs.kde.org:/home/kde)
+ */
+ void setLocation( const QString &p );
+ /**
+ * @result remote path (i.e. :pserver:marios@cvs.kde.org:/home/kde)
+ */
+ QString location();
+
+ void setContextLines( unsigned int contextLines );
+ unsigned int contextLines() const;
+
+ void setCompressionLevel( unsigned int compressionLevel = 0 );
+ unsigned int compressionLevel() const;
+
+private:
+ // Cache
+ bool m_recursiveWhenCommitRemove;
+ bool m_pruneEmptyDirsWhenUpdate;
+ bool m_recursiveWhenUpdate;
+ bool m_createDirsWhenUpdate;
+ QString m_revertOptions;
+ QString m_diffOptions;
+ QString m_cvsRshEnvVar;
+ QString m_location;
+ unsigned int m_compressionLevel;
+ unsigned int m_contextLines;
+ //! So we can access cvssservice configuration (repositories first of all)
+ KConfig *m_serviceConfig;
+
+ static CvsOptions *m_instance;
+ CvsOptions();
+};
+
+#endif // CVSOPTIONS_H
+