grandmas-svn-commit Mailing List for Grandma's SVN (Page 7)
Brought to you by:
matthiasmiller
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(7) |
Jun
|
Jul
(3) |
Aug
(15) |
Sep
(8) |
Oct
(36) |
Nov
(26) |
Dec
(51) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(18) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <hig...@us...> - 2006-08-10 04:20:45
|
Revision: 17 Author: highjinx Date: 2006-08-09 21:20:34 -0700 (Wed, 09 Aug 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=17&view=rev Log Message: ----------- More extensive unit testing for Modifications class, as well as fixing several bugs exposed by tests Modified Paths: -------------- trunk/grandmas_svn.kdevelop trunk/grandmas_svn.pro trunk/include/svn/modification.h trunk/include/svn/revision.h trunk/src/dialogs/util.cpp trunk/src/main.cpp trunk/src/svn/modification.cpp trunk/tests/commandlinetest.cpp trunk/tests/tests.cpp Added Paths: ----------- trunk/tests/svn_test.cpp trunk/tests/svn_test.h Modified: trunk/grandmas_svn.kdevelop =================================================================== --- trunk/grandmas_svn.kdevelop 2006-08-10 00:17:12 UTC (rev 16) +++ trunk/grandmas_svn.kdevelop 2006-08-10 04:20:34 UTC (rev 17) @@ -10,6 +10,10 @@ <keyword>Qt</keyword> </keywords> <ignoreparts/> + <projectdirectory>.</projectdirectory> + <absoluteprojectpath>false</absoluteprojectpath> + <description></description> + <versioncontrol/> </general> <kdevfileview> <groups> @@ -65,34 +69,52 @@ </kdevdoctreeview> <kdevdebugger> <general> - <dbgshell/> + <dbgshell></dbgshell> <breakpoints/> - <programargs/> + <programargs>-t</programargs> <gdbpath>/usr/bin/</gdbpath> <breakonloadinglibs>true</breakonloadinglibs> <separatetty>false</separatetty> <floatingtoolbar>false</floatingtoolbar> + <configGdbScript></configGdbScript> + <runShellScript></runShellScript> + <runGdbScript></runGdbScript> </general> <display> <staticmembers>false</staticmembers> <demanglenames>true</demanglenames> + <outputradix>10</outputradix> </display> <breakpoints/> </kdevdebugger> <kdevtrollproject> <run> - <mainprogram>./bin/grandmas_svn</mainprogram> - <programargs/> - <directoryradio>executable</directoryradio> + <mainprogram>bin/grandmas-svn</mainprogram> + <programargs>-t</programargs> + <directoryradio>build</directoryradio> + <customdirectory>/</customdirectory> + <terminal>false</terminal> + <autocompile>true</autocompile> + <envvars/> </run> <general> <activedir></activedir> </general> + <make> + <abortonerror>true</abortonerror> + <runmultiplejobs>false</runmultiplejobs> + <numberofjobs>1</numberofjobs> + <dontact>false</dontact> + <makebin></makebin> + <prio>0</prio> + <envvars/> + </make> </kdevtrollproject> <workspace> <openfiles/> </workspace> <kdevfilecreate> + <filetypes/> <useglobaltypes> <type ext="ui" /> <type ext="cpp" /> @@ -102,13 +124,14 @@ </kdevfilecreate> <kdevdocumentation> <projectdoc> - <docsystem>Doxygen Documentation Collection</docsystem> - <docurl>grandmas_svn.tag</docurl> + <docsystem/> + <docurl/> + <usermanualurl/> </projectdoc> </kdevdocumentation> <substmap> - <APPNAME>grandmas_svn</APPNAME> - <APPNAMELC>grandmas_svn</APPNAMELC> + <APPNAME>grandmas-svn</APPNAME> + <APPNAMELC>grandmas-svn</APPNAMELC> <APPNAMESC>Grandmas_svn</APPNAMESC> <APPNAMEUC>GRANDMAS_SVN</APPNAMEUC> <AUTHOR>Matthias Miller</AUTHOR> @@ -133,5 +156,28 @@ <argumentsHintDelay>400</argumentsHintDelay> <headerCompletionDelay>250</headerCompletionDelay> </codecompletion> + <qt> + <used>true</used> + <version>4</version> + <root></root> + </qt> + <creategettersetter> + <prefixGet></prefixGet> + <prefixSet>set</prefixSet> + <prefixVariable>m_,_</prefixVariable> + <parameterName>theValue</parameterName> + <inlineGet>true</inlineGet> + <inlineSet>true</inlineSet> + </creategettersetter> </kdevcppsupport> + <cppsupportpart> + <filetemplates> + <interfacesuffix>.h</interfacesuffix> + <implementationsuffix>.cpp</implementationsuffix> + </filetemplates> + </cppsupportpart> + <ctagspart> + <customArguments/> + <customTagfilePath/> + </ctagspart> </kdevelop> Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-08-10 00:17:12 UTC (rev 16) +++ trunk/grandmas_svn.pro 2006-08-10 04:20:34 UTC (rev 17) @@ -136,14 +136,14 @@ HEADERS += include/commandline.h \ include/debug.h \ include/dialogs/commit.h \ + include/dialogs/mainwindow.h \ include/dialogs/move.h \ include/dialogs/open.h \ - include/dialogs/mainwindow.h \ include/dialogs/util.h \ include/settings/userpaths.h \ - include/svn/server_access.h \ include/svn/modification.h \ include/svn/revision.h \ + include/svn/server_access.h \ src/grandmas_svn.h SOURCES += src/commandline.cpp \ @@ -152,13 +152,13 @@ src/dialogs/mainwindow.cpp \ src/dialogs/move.cpp \ src/dialogs/open.cpp \ + src/settings/userpaths.cpp \ + src/svn/modification.cpp \ + src/svn/revision.cpp \ + src/svn/server_access.cpp \ src/dialogs/util.cpp \ src/grandmas_svn.cpp \ src/main.cpp \ - src/settings/userpaths.cpp \ - src/svn/server_access.cpp \ - src/svn/modification.cpp \ - src/svn/revision.cpp # UNIT TESTS @@ -169,8 +169,10 @@ contains(DEFINES, GSVN_TESTS) { CONFIG += qtestlib HEADERS += tests/commandlinetest.h \ + tests/svn_test.h \ tests/tests.h SOURCES += tests/commandlinetest.cpp \ + tests/svn_test.cpp \ tests/tests.cpp LIBS += -lsvn_repos-1 } Modified: trunk/include/svn/modification.h =================================================================== --- trunk/include/svn/modification.h 2006-08-10 00:17:12 UTC (rev 16) +++ trunk/include/svn/modification.h 2006-08-10 04:20:34 UTC (rev 17) @@ -18,6 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#ifndef _MODIFICATION_H_ +#define _MODIFICATION_H_ + #include "revision.h" #include <QList> @@ -46,7 +49,8 @@ Type_Conflicting, }; - QString getFilePath(); + QString getFilePath() { return mFilePath; } + Type getType() { return mType; } // Only use for move and copy mods QString getDestFilePath(); @@ -92,55 +96,4 @@ static svn_error_t* infoCallback(void *baton, const char *path, const svn_info_t *info, apr_pool_t *pool); }; - - -#include <svn/server_access.h> - -#include <svn_repos.h> - -#include <QDir> -#include <QObject> -#include <QtTest/QtTest> - -class NoOperationStatus : public SvnOperationStatus -{ -public: - virtual ~NoOperationStatus() {} - virtual void update(QString textToAdd) { textToAdd=textToAdd; } - - virtual bool shouldCancel() { return false; } -}; - -class NoAuthentication : public SvnAuthentication -{ -protected: - virtual bool getAuthentication(QString& /*rUsername*/, QString& /*rPassword*/) { return false; } -}; - -class ModificationsTester : public QObject, SvnOperation -{ - Q_OBJECT - -public: - ModificationsTester(); - ~ModificationsTester(); - -private: - QString getRepoPath() { return QDir::convertSeparators(QDir::tempPath()+"/gsvn_repo"); } - QString getWcPath() { return QDir::convertSeparators(QDir::tempPath()+"/gsvn_wc"); } - - bool createRepos(); - bool commitChanges(); - bool addFile(QString relFilePath); - bool touchFile(QString relFilePath, QString fileText); // fails if the file exists - -private slots: - void initTestCase(); - void cleanupTestCase(); - -private: - NoOperationStatus mStatus; - NoAuthentication mAuthentication; - SvnOperationContext* mpContext; - svn_client_ctx_t* mpCtx; -}; +#endif Modified: trunk/include/svn/revision.h =================================================================== --- trunk/include/svn/revision.h 2006-08-10 00:17:12 UTC (rev 16) +++ trunk/include/svn/revision.h 2006-08-10 04:20:34 UTC (rev 17) @@ -18,6 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#ifndef _REVISION_H_ +#define _REVISION_H_ + #include <Qt> #include <svn_wc.h> @@ -43,3 +46,4 @@ int mCommittedRevision; }; +#endif Modified: trunk/src/dialogs/util.cpp =================================================================== --- trunk/src/dialogs/util.cpp 2006-08-10 00:17:12 UTC (rev 16) +++ trunk/src/dialogs/util.cpp 2006-08-10 04:20:34 UTC (rev 17) @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "util.h" +#include <dialogs/util.h> #include "debug.h" #include <QBoxLayout> #include <QWidget> Modified: trunk/src/main.cpp =================================================================== --- trunk/src/main.cpp 2006-08-10 00:17:12 UTC (rev 16) +++ trunk/src/main.cpp 2006-08-10 04:20:34 UTC (rev 17) @@ -59,18 +59,20 @@ int main(int argc, char** argv) { + GrandmasSVNApp app(argc, argv); + // This information is used for the QSettings object. QCoreApplication::setOrganizationName("grandmas-svn.org"); QCoreApplication::setOrganizationDomain("grandmas-svn.org"); QCoreApplication::setApplicationName("Grandma's SVN"); + + apr_status_t rv = apr_initialize(); + if (rv != APR_SUCCESS) + return 1; // BEGIN TEST CODE if (false) { - apr_status_t rv = apr_initialize(); - if (rv != APR_SUCCESS) - return -1; - apr_pool_t* pool; apr_pool_create(&pool, NULL); @@ -92,8 +94,6 @@ apr_pool_destroy(pool); } // END TEST CODE - - GrandmasSVNApp app(argc, argv); CommandLine cmd; #ifdef GSVN_TESTS @@ -101,6 +101,7 @@ #endif QString error; + if (!cmd.parse(argc, argv, error)) { fputs(error.toAscii(), stderr); Modified: trunk/src/svn/modification.cpp =================================================================== --- trunk/src/svn/modification.cpp 2006-08-10 00:17:12 UTC (rev 16) +++ trunk/src/svn/modification.cpp 2006-08-10 04:20:34 UTC (rev 17) @@ -77,9 +77,10 @@ bool Modifications::init(SvnOperationContext& rServer, QString path, Revision revision, QString& rError) { + mModifications.clear(); rError = ""; mpContext = &rServer; - mWcPath = path; + mWcPath = svn_path_canonicalize(path.toAscii(), rServer.getAprPool()); svn_client_ctx_t* ctx; svn_client_create_context(&ctx, rServer.getAprPool()); @@ -111,7 +112,8 @@ else { svn_opt_revision_t svnRevision = revision.getSvnRevision(); - pError = svn_client_status2(NULL, path.toAscii(), &svnRevision, + const char* canonPath = svn_path_canonicalize(path.toAscii(), rServer.getAprPool()); + pError = svn_client_status2(NULL, canonPath, &svnRevision, statusCallback, this, true/*recurse*/, @@ -119,7 +121,7 @@ false/*update*/, false /*no_ignore*/, true/*ignore_externals*/, - ctx/*svn_client_ctx_t *ctx*/, + ctx/*svn_client_ctx_t*/, rServer.getAprPool()); } if (pError) @@ -264,78 +266,3 @@ return true; } -ModificationsTester::ModificationsTester() -{ - apr_pool_t* pool; - apr_pool_create(&pool, NULL); - mpContext = new SvnOperationContext(pool, mStatus, mAuthentication); - - svn_client_create_context(&mpCtx, mpContext->getAprPool()); - - QString rIgnoredError; - GSVN_ASSERT(initAuthProviders(mpCtx, *mpContext, rIgnoredError)); - -} - -ModificationsTester::~ModificationsTester() -{ - apr_pool_destroy(mpContext->getAprPool()); - delete mpContext; -} - -bool ModificationsTester::createRepos() -{ - svn_repos_t* pCreatedRepo; - if (svn_repos_create(&pCreatedRepo, getRepoPath().toAscii(), NULL, NULL, NULL, NULL, mpContext->getAprPool())) - return false; - - svn_opt_revision_t revision; - revision.kind = svn_opt_revision_head; - if (svn_client_checkout2(NULL, QString("file://"+getRepoPath()).toAscii(), getWcPath().toAscii(), &revision, &revision, true, false, mpCtx, mpContext->getAprPool())) - return false; - - return true; -} - -bool ModificationsTester::commitChanges() -{ - return false; -} - -bool ModificationsTester::addFile(QString relFilePath) -{ - relFilePath = relFilePath; - return false; -} - -bool ModificationsTester::touchFile(QString relFilePath, QString fileText) -{ - QFile file(QDir::convertSeparators(getWcPath()+relFilePath)); - if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) - return false; - - QTextStream out(&file); - out << fileText; - if (!file.flush()) - return false; - - return true; -} - -void ModificationsTester::initTestCase() -{ - qDebug("called before everything else"); -} - -void ModificationsTester::cleanupTestCase() -{ - qDebug("called after myFirstTest and mySecondTest"); -} - - - - - - - - Modified: trunk/tests/commandlinetest.cpp =================================================================== --- trunk/tests/commandlinetest.cpp 2006-08-10 00:17:12 UTC (rev 16) +++ trunk/tests/commandlinetest.cpp 2006-08-10 04:20:34 UTC (rev 17) @@ -34,8 +34,8 @@ mpCmd = new CommandLine; mpCmd->addAvailableOption('s', NULL, "short parameter (without value)", false); mpCmd->addAvailableOption('S', NULL, "short parameter (with value)", true); - mpCmd->addAvailableOption(NULL, "long", "long parameter (without value)", false); - mpCmd->addAvailableOption(NULL, "long-value", "long parameter (with value)", true); + mpCmd->addAvailableOption(0, "long", "long parameter (without value)", false); + mpCmd->addAvailableOption(0, "long-value", "long parameter (with value)", true); mpCmd->addAvailableOption('b', "both", "both long and short parameter (without value)", false); mpCmd->addAvailableOption('B', "both-value", "both long and short parameter (with value)", true); } @@ -134,7 +134,7 @@ QVERIFY(error.isNull()); QString value; - QVERIFY(mpCmd->checkOption(NULL, "long-value", value)); + QVERIFY(mpCmd->checkOption(0, "long-value", value)); QCOMPARE(value, QString("value")); } @@ -147,7 +147,7 @@ QString error; QVERIFY(mpCmd->parse(args, error)); QVERIFY(error.isNull()); - QVERIFY(mpCmd->checkOption(NULL, "long")); + QVERIFY(mpCmd->checkOption(0, "long")); } void CommandLineTest::testDuplicateLongWithoutValue1() Added: trunk/tests/svn_test.cpp =================================================================== --- trunk/tests/svn_test.cpp (rev 0) +++ trunk/tests/svn_test.cpp 2006-08-10 04:20:34 UTC (rev 17) @@ -0,0 +1,199 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "svn_test.h" + +#include <svn_client.h> +#include <svn_repos.h> +#include <svn_path.h> +#include <svn_pools.h> + +#include <iostream> + +SvnTester::SvnTester() +{ + apr_pool_t* pool; + apr_pool_create(&pool, NULL); + mpContext = new SvnOperationContext(pool, mStatus, mAuthentication); + + svn_client_create_context(&mpCtx, mpContext->getAprPool()); + + QString rIgnoredError; + Q_ASSERT(initAuthProviders(mpCtx, *mpContext, rIgnoredError)); + + mpCtx->log_msg_func = logMsgCallback; + mpCtx->log_msg_baton = this; + +} + +SvnTester::~SvnTester() +{ + apr_pool_destroy(mpContext->getAprPool()); + delete mpContext; +} + +bool SvnTester::commitChanges(QString commitMessage) +{ + mCurrentCommitMsg = commitMessage; + + svn_client_commit_info_t* pCommitInfo; + apr_array_header_t *array = apr_array_make(mpContext->getAprPool(), 1, sizeof(const char*)); + APR_ARRAY_PUSH(array, const char*) = svn_path_canonicalize(getWcPath().toAscii(), mpContext->getAprPool()); + + if (svn_client_commit2(&pCommitInfo, array, true, false, mpCtx, mpContext->getAprPool())) + return false; + + return true; +} + +bool SvnTester::addFile(QString relFilePath) +{ + QString fullPath = QDir::convertSeparators(getWcPath()+relFilePath); + svn_error_t* pError = svn_client_add2(fullPath.toAscii(), true, true, mpCtx, mpContext->getAprPool()); + if (pError) + std::cout << pError->message << "\n"; + return (pError == NULL); +} + +bool SvnTester::touchFile(QString relFilePath, QString fileText) +{ + QFile file(QDir::convertSeparators(getWcPath()+relFilePath)); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) + return false; + + QTextStream out(&file); + out << fileText; + if (!file.flush()) + return false; + + return true; +} + +bool SvnTester::removeDirectory(QString filePath) +{ + QDir dir(filePath); + QFileInfoList entries = dir.entryInfoList(QDir::NoDotAndDotDot|QDir::Hidden|QDir::System|QDir::AllDirs|QDir::Files); + Q_FOREACH(QFileInfo entry, entries) + { + if (entry.isDir()) + { + if (!removeDirectory(entry.absoluteFilePath())) + return false; + } + else + { + if (!QFile::remove(entry.absoluteFilePath())) + return false; + } + } + if (!dir.rmdir(filePath)) + return false; + + return true; +} + +bool SvnTester::updateWc() +{ + apr_array_header_t *array = apr_array_make(mpContext->getAprPool(), 1, sizeof(const char*)); + APR_ARRAY_PUSH(array, const char*) = svn_path_canonicalize(getWcPath().toAscii(), mpContext->getAprPool()); + svn_opt_revision_t revision; + revision.kind = svn_opt_revision_head; + if (svn_client_update2(NULL, array, &revision, true, true, mpCtx, mpContext->getAprPool())) + return false; + + return true; +} + +#define GSVN_VERIFY(command) \ + do { \ + pError = (command); \ + if (pError) {\ + qDebug("Condition failed: " #command "\n");\ + qDebug(pError->message);\ + QVERIFY(false); } \ + } while (0) + +void SvnTester::init() +{ + apr_pool_t* pSubPool = svn_pool_create(mpContext->getAprPool()); + + svn_repos_t* pCreatedRepo; + svn_error_t* pError = NULL; + GSVN_VERIFY(svn_repos_create(&pCreatedRepo, getRepoPath().toAscii(), NULL, NULL, NULL, NULL, pSubPool)); + + apr_pool_destroy(pSubPool); + + svn_opt_revision_t revision; + revision.kind = svn_opt_revision_head; + const char* repoPath = svn_path_canonicalize(QString("file://"+getRepoPath()).toAscii(), mpContext->getAprPool()); + const char* wcPath = svn_path_canonicalize(getWcPath().toAscii(), mpContext->getAprPool()); + GSVN_VERIFY(svn_client_checkout2(NULL, repoPath, wcPath, &revision, &revision, true, false, mpCtx, mpContext->getAprPool())); + + QVERIFY(touchFile("/first.txt", "This is the first file")); + QVERIFY(addFile("/first.txt")); + QVERIFY(commitChanges("First commit")); + QVERIFY(touchFile("/second.txt", "This is the second file")); + QVERIFY(addFile("/second.txt")); + + QVERIFY(updateWc()); +} + +void SvnTester::cleanup() +{ + QVERIFY(removeDirectory(getRepoPath())); + QVERIFY(removeDirectory(getWcPath())); +} + + +svn_error_t* SvnTester::logMsgCallback(const char **log_msg, const char **tmp_file, apr_array_header_t */*commit_items*/, void *baton, apr_pool_t */*pool*/) +{ + SvnTester* pThis = (SvnTester*)baton; + Q_ASSERT(pThis->mCurrentCommitMsg != ""); + *log_msg = (const char*)pThis->mCurrentCommitMsg.toAscii(); + pThis->mCurrentCommitMsg = ""; + tmp_file = NULL; + return NULL; +} + +void SvnTester::testModifications() +{ + Modifications modifications; + QString rError; + Revision rev; + rev.setCommittedRevision(1); + QVERIFY(modifications.init(*mpContext, getWcPath(), rev, rError)); + + QList<Modification> mods; + modifications.getModifications(mods); + + QCOMPARE(mods.size(), 1); + QCOMPARE(mods[0].getFilePath(), QString("/first.txt")); + QCOMPARE(mods[0].getType(), Modification::Type_Add); + + rev.setUncommittedRevision(); + QVERIFY(modifications.init(*mpContext, getWcPath(), rev, rError)); + + modifications.getModifications(mods); + + QCOMPARE(mods.size(), 1); + QCOMPARE(mods[0].getFilePath(), QString("/second.txt")); + QCOMPARE(mods[0].getType(), Modification::Type_Add); +} + Added: trunk/tests/svn_test.h =================================================================== --- trunk/tests/svn_test.h (rev 0) +++ trunk/tests/svn_test.h 2006-08-10 04:20:34 UTC (rev 17) @@ -0,0 +1,86 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <svn/modification.h> +#include <svn/server_access.h> + +#include <svn_repos.h> + +#include <QDir> +#include <QObject> +#include <QtTest/QtTest> + +class SvnOperationContext; +struct svn_wc_status2_t; +struct svn_client_ctx_t; +struct svn_info_t; + +class NoOperationStatus : public SvnOperationStatus +{ +public: + virtual ~NoOperationStatus() {} + virtual void update(QString textToAdd) { textToAdd=textToAdd; } + + virtual bool shouldCancel() { return false; } +}; + +class NoAuthentication : public SvnAuthentication +{ +protected: + virtual bool getAuthentication(QString& /*rUsername*/, QString& /*rPassword*/) { return false; } +}; + +class SvnTester : public QObject, public SvnOperation +{ + Q_OBJECT + +public: + SvnTester(); + ~SvnTester(); + +private: + QString getRepoPath() { return QDir::convertSeparators(QDir::tempPath()+"/gsvn_repo"); } + QString getWcPath() { return QDir::convertSeparators(QDir::tempPath()+"/gsvn_wc"); } + + bool createRepos(); + bool commitChanges(QString commitMessage); + bool addFile(QString relFilePath); + bool touchFile(QString relFilePath, QString fileText); // fails if the file exists + bool updateWc(); + + bool removeDirectory(QString filePath); + +private slots: + void init(); + void cleanup(); + + void testModifications(); + +private: + // Callbacks + static svn_error_t* logMsgCallback(const char **log_msg, const char **tmp_file, apr_array_header_t *commit_items, void *baton, apr_pool_t *pool); +private: + NoOperationStatus mStatus; + NoAuthentication mAuthentication; + SvnOperationContext* mpContext; + svn_client_ctx_t* mpCtx; + + QString mCurrentCommitMsg; +}; Modified: trunk/tests/tests.cpp =================================================================== --- trunk/tests/tests.cpp 2006-08-10 00:17:12 UTC (rev 16) +++ trunk/tests/tests.cpp 2006-08-10 04:20:34 UTC (rev 17) @@ -20,6 +20,7 @@ #include "tests.h" #include "commandlinetest.h" +#include "svn_test.h" #include <QtTest/QtTest> @@ -36,5 +37,6 @@ { int result = 0; TEST(CommandLineTest); + TEST(SvnTester); return result; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-08-10 00:17:22
|
Revision: 16 Author: matthiasmiller Date: 2006-08-09 17:17:12 -0700 (Wed, 09 Aug 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=16&view=rev Log Message: ----------- use #ifdef instead of inheritance to handle OS differences Modified Paths: -------------- trunk/grandmas_svn.pro trunk/include/dialogs/commit.h trunk/include/dialogs/move.h trunk/include/dialogs/open.h trunk/src/dialogs/commit.cpp trunk/src/dialogs/move.cpp trunk/src/dialogs/open.cpp Added Paths: ----------- trunk/include/dialogs/util.h trunk/src/dialogs/util.cpp Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-08-09 19:21:25 UTC (rev 15) +++ trunk/grandmas_svn.pro 2006-08-10 00:17:12 UTC (rev 16) @@ -136,10 +136,10 @@ HEADERS += include/commandline.h \ include/debug.h \ include/dialogs/commit.h \ - include/dialogs/core/base.h \ include/dialogs/move.h \ include/dialogs/open.h \ include/dialogs/mainwindow.h \ + include/dialogs/util.h \ include/settings/userpaths.h \ include/svn/server_access.h \ include/svn/modification.h \ @@ -149,10 +149,10 @@ SOURCES += src/commandline.cpp \ src/debug.cpp \ src/dialogs/commit.cpp \ - src/dialogs/core/base.cpp \ src/dialogs/mainwindow.cpp \ src/dialogs/move.cpp \ src/dialogs/open.cpp \ + src/dialogs/util.cpp \ src/grandmas_svn.cpp \ src/main.cpp \ src/settings/userpaths.cpp \ Modified: trunk/include/dialogs/commit.h =================================================================== --- trunk/include/dialogs/commit.h 2006-08-09 19:21:25 UTC (rev 15) +++ trunk/include/dialogs/commit.h 2006-08-10 00:17:12 UTC (rev 16) @@ -22,19 +22,16 @@ #ifndef DIALOGS_COMMIT_H_ #define DIALOGS_COMMIT_H_ -#include "dialogs/core/base.h" +#include <QDialog> class Ui_CommitDialog; -class CommitDialog : public BaseDialog +class CommitDialog : public QDialog { public: CommitDialog(QWidget* pParent); ~CommitDialog(); -protected: - virtual void initMac(); - private: Ui_CommitDialog* mpUi; }; Modified: trunk/include/dialogs/move.h =================================================================== --- trunk/include/dialogs/move.h 2006-08-09 19:21:25 UTC (rev 15) +++ trunk/include/dialogs/move.h 2006-08-10 00:17:12 UTC (rev 16) @@ -22,11 +22,11 @@ #ifndef DIALOGS_MOVE_H_ #define DIALOGS_MOVE_H_ -#include "dialogs/core/base.h" +#include <QDialog> class Ui_moveDialog; -class MoveDialog : public BaseDialog +class MoveDialog : public QDialog { Q_OBJECT @@ -35,9 +35,6 @@ ~MoveDialog(); private: - virtual void initMac(); - -private: Ui_moveDialog* mpUi; }; Modified: trunk/include/dialogs/open.h =================================================================== --- trunk/include/dialogs/open.h 2006-08-09 19:21:25 UTC (rev 15) +++ trunk/include/dialogs/open.h 2006-08-10 00:17:12 UTC (rev 16) @@ -22,14 +22,14 @@ #ifndef DIALOGS_OPEN_H_ #define DIALOGS_OPEN_H_ -#include "dialogs/core/base.h" +#include <QDialog> class Ui_OpenDialog; class UserPathsModel; class QKeyEvent; class QSettings; -class OpenDialog : public BaseDialog +class OpenDialog : public QDialog { Q_OBJECT @@ -44,9 +44,6 @@ void accept(); void openOther(); -protected: - virtual void initMac(); - private: Ui_OpenDialog* mpUi; UserPathsModel* mpPathsModel; Copied: trunk/include/dialogs/util.h (from rev 15, trunk/templates/h) =================================================================== --- trunk/include/dialogs/util.h (rev 0) +++ trunk/include/dialogs/util.h 2006-08-10 00:17:12 UTC (rev 16) @@ -0,0 +1,24 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +class QBoxLayout; +class QWidget; + +void exchangeWidgets(QBoxLayout* pLayout, QWidget* pFirstWidget, QWidget* pSecondWidget); Modified: trunk/src/dialogs/commit.cpp =================================================================== --- trunk/src/dialogs/commit.cpp 2006-08-09 19:21:25 UTC (rev 15) +++ trunk/src/dialogs/commit.cpp 2006-08-10 00:17:12 UTC (rev 16) @@ -19,14 +19,17 @@ ***************************************************************************/ #include "dialogs/commit.h" +#include "dialogs/util.h" #include "ui_commit.h" -CommitDialog::CommitDialog(QWidget* pParent) : BaseDialog(pParent) +CommitDialog::CommitDialog(QWidget* pParent) : QDialog(pParent) { mpUi = new Ui_CommitDialog(); mpUi->setupUi(this); - init(); +#ifdef Q_WS_MAC + exchangeWidgets(mpUi->hboxLayout, mpUi->okButton, mpUi->cancelButton); +#endif } CommitDialog::~CommitDialog() @@ -34,8 +37,3 @@ delete mpUi; mpUi = NULL; } - -void CommitDialog::initMac() -{ - exchangeWidgets(mpUi->hboxLayout, mpUi->okButton, mpUi->cancelButton); -} Modified: trunk/src/dialogs/move.cpp =================================================================== --- trunk/src/dialogs/move.cpp 2006-08-09 19:21:25 UTC (rev 15) +++ trunk/src/dialogs/move.cpp 2006-08-10 00:17:12 UTC (rev 16) @@ -19,13 +19,17 @@ ***************************************************************************/ #include "dialogs/move.h" +#include "dialogs/util.h" #include "ui_move.h" -MoveDialog::MoveDialog(QWidget* pParent) : BaseDialog(pParent) +MoveDialog::MoveDialog(QWidget* pParent) : QDialog(pParent) { mpUi = new Ui_moveDialog(); mpUi->setupUi(this); - init(); + +#ifdef Q_WS_MAC + exchangeWidgets(mpUi->hboxLayout2, mpUi->okButton, mpUi->cancelButton); +#endif } MoveDialog::~MoveDialog() @@ -33,8 +37,3 @@ delete mpUi; mpUi = NULL; } - -void MoveDialog::initMac() -{ - exchangeWidgets(mpUi->hboxLayout2, mpUi->okButton, mpUi->cancelButton); -} Modified: trunk/src/dialogs/open.cpp =================================================================== --- trunk/src/dialogs/open.cpp 2006-08-09 19:21:25 UTC (rev 15) +++ trunk/src/dialogs/open.cpp 2006-08-10 00:17:12 UTC (rev 16) @@ -19,6 +19,7 @@ ***************************************************************************/ #include "dialogs/open.h" +#include "dialogs/util.h" #include "settings/userpaths.h" #include "ui_open.h" #include <QFileDialog> @@ -33,7 +34,9 @@ mpUi->workingCopyListView->setModel(mpPathsModel); connect(mpUi->otherButton, SIGNAL(clicked()), this, SLOT(openOther())); - init(); +#ifdef Q_WS_MAC + exchangeWidgets(mpUi->hboxLayout, mpUi->okButton, mpUi->cancelButton); +#endif } OpenDialog::~OpenDialog() @@ -66,8 +69,3 @@ mpUi->workingCopyListView->setFocus(); } } - -void OpenDialog::initMac() -{ - exchangeWidgets(mpUi->hboxLayout, mpUi->okButton, mpUi->cancelButton); -} Copied: trunk/src/dialogs/util.cpp (from rev 15, trunk/templates/cpp) =================================================================== --- trunk/src/dialogs/util.cpp (rev 0) +++ trunk/src/dialogs/util.cpp 2006-08-10 00:17:12 UTC (rev 16) @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "util.h" +#include "debug.h" +#include <QBoxLayout> +#include <QWidget> + +void exchangeWidgets(QBoxLayout* pLayout, QWidget* pFirstWidget, QWidget* pSecondWidget) +{ + // If both widgets are in the same layout, it's important to move them in the correct order. + int firstIndex = pLayout->indexOf(pFirstWidget); + int secondIndex = pLayout->indexOf(pSecondWidget); + GSVN_ASSERT(firstIndex != -1); + GSVN_ASSERT(secondIndex != -1); + GSVN_ASSERT(firstIndex < secondIndex); + + pLayout->removeWidget(pSecondWidget); + pLayout->insertWidget(firstIndex, pSecondWidget); + + pLayout->removeWidget(pFirstWidget); + pLayout->insertWidget(secondIndex, pFirstWidget); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-08-09 19:21:32
|
Revision: 15 Author: matthiasmiller Date: 2006-08-09 12:21:25 -0700 (Wed, 09 Aug 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=15&view=rev Log Message: ----------- implement CommandLine::usage Modified Paths: -------------- trunk/include/commandline.h trunk/src/commandline.cpp trunk/src/main.cpp trunk/tests/commandlinetest.cpp Modified: trunk/include/commandline.h =================================================================== --- trunk/include/commandline.h 2006-08-09 14:28:30 UTC (rev 14) +++ trunk/include/commandline.h 2006-08-09 19:21:25 UTC (rev 15) @@ -39,7 +39,7 @@ private: bool setArgByShortName(QChar shortName, QString& rError); bool setArgByLongName(QString longName, QString value, QString& rError); - + struct CommandLineOption { QChar shortName; @@ -52,5 +52,7 @@ }; QList<CommandLineOption> mOptions; + + static QString getUsageArgs(const CommandLineOption& rcOpt); }; Modified: trunk/src/commandline.cpp =================================================================== --- trunk/src/commandline.cpp 2006-08-09 14:28:30 UTC (rev 14) +++ trunk/src/commandline.cpp 2006-08-09 19:21:25 UTC (rev 15) @@ -98,7 +98,30 @@ QString CommandLine::usage() { - return tr(""); + // find the max argument length + int maxArgLen = 0; + Q_FOREACH(CommandLineOption opt, mOptions) + { + int optArgLen = getUsageArgs(opt).length(); + if (maxArgLen < optArgLen) + maxArgLen = optArgLen; + } + + QStringList usage; + Q_FOREACH(CommandLineOption opt, mOptions) + { + QString optUsage = getUsageArgs(opt); + optUsage += QString(maxArgLen - optUsage.length(), ' '); + optUsage += " : "; + optUsage += opt.desc; + usage.push_back(optUsage); + } + + // truncate usage to 80 characters + for (int opt = 0; opt < usage.size(); opt++) + usage[opt] = usage[opt].left(80); + + return usage.join("\n"); } bool CommandLine::checkOption(QChar shortName, QString longName) @@ -194,3 +217,28 @@ rError = tr("Invalid parameter: %1").arg("--"+longName); return false; } + +QString CommandLine::getUsageArgs(const CommandLineOption& rcOpt) +{ + QString arg; + + if (!rcOpt.shortName.isNull()) + { + arg += "-"; + arg += rcOpt.shortName; + } + + if (!rcOpt.longName.isEmpty()) + { + if (arg != "") + arg += " ["; + arg += "--" + rcOpt.longName; + if (arg.contains("[")) + arg += "]"; + } + + if (rcOpt.canHaveValue) + arg += " arg"; + + return arg; +} Modified: trunk/src/main.cpp =================================================================== --- trunk/src/main.cpp 2006-08-09 14:28:30 UTC (rev 14) +++ trunk/src/main.cpp 2006-08-09 19:21:25 UTC (rev 15) @@ -63,45 +63,50 @@ QCoreApplication::setOrganizationName("grandmas-svn.org"); QCoreApplication::setOrganizationDomain("grandmas-svn.org"); QCoreApplication::setApplicationName("Grandma's SVN"); - -// BEGIN TEST CODE - apr_status_t rv = apr_initialize(); - if (rv != APR_SUCCESS) - return -1; - apr_pool_t* pool; - apr_pool_create(&pool, NULL); + // BEGIN TEST CODE + if (false) + { + apr_status_t rv = apr_initialize(); + if (rv != APR_SUCCESS) + return -1; - QSvnOperationStatus status; - QSvnAuthentication auth; - SvnOperationContext context(pool, status, auth);; + apr_pool_t* pool; + apr_pool_create(&pool, NULL); - QString error; - Revision revision; - //revision.setUncommittedRevision(); - revision.setCommittedRevision(5); + QSvnOperationStatus status; + QSvnAuthentication auth; + SvnOperationContext context(pool, status, auth);; - Modifications mods; - if (!mods.init(context, "/home/joshn/projects/gsvn", revision, error)) - { - cout << "Error!: " << (const char*)error.toAscii() << "\n"; - } + QString error; + Revision revision; + //revision.setUncommittedRevision(); + revision.setCommittedRevision(5); - apr_pool_destroy(pool); + Modifications mods; + if (!mods.init(context, "/home/joshn/projects/gsvn", revision, error)) + { + cout << "Error!: " << (const char*)error.toAscii() << "\n"; + } -// END TEST CODE + apr_pool_destroy(pool); + } + // END TEST CODE + GrandmasSVNApp app(argc, argv); CommandLine cmd; #ifdef GSVN_TESTS cmd.addAvailableOption('t', "tests", "run unit tests", false); #endif - + + QString error; if (!cmd.parse(argc, argv, error)) { fputs(error.toAscii(), stderr); + fputs("\n\n", stderr); + fputs(cmd.usage().toAscii(), stderr); fputs("\n", stderr); - fputs(cmd.usage().toAscii(), stderr); return 1; } Modified: trunk/tests/commandlinetest.cpp =================================================================== --- trunk/tests/commandlinetest.cpp 2006-08-09 14:28:30 UTC (rev 14) +++ trunk/tests/commandlinetest.cpp 2006-08-09 19:21:25 UTC (rev 15) @@ -43,8 +43,10 @@ void CommandLineTest::testUsage() { QString usage = mpCmd->usage(); - QVERIFY(usage.contains("-B")); - QVERIFY(usage.contains("--both-value")); + QVERIFY(usage.contains("-S arg")); + QVERIFY(usage.contains("--long")); + QVERIFY(usage.contains("--long-value")); + QVERIFY(usage.contains("-B [--both-value] arg")); QVERIFY(usage.contains("both long and short parameter (with value)")); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-08-09 14:28:40
|
Revision: 14 Author: matthiasmiller Date: 2006-08-09 07:28:30 -0700 (Wed, 09 Aug 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=14&view=rev Log Message: ----------- ignore assertions during unit tests Modified Paths: -------------- trunk/grandmas_svn.pro trunk/src/commandline.cpp trunk/src/dialogs/core/base.cpp trunk/src/settings/userpaths.cpp trunk/src/svn/modification.cpp trunk/src/svn/revision.cpp trunk/tests/commandlinetest.cpp Added Paths: ----------- trunk/include/debug.h trunk/src/debug.cpp Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-08-09 06:35:51 UTC (rev 13) +++ trunk/grandmas_svn.pro 2006-08-09 14:28:30 UTC (rev 14) @@ -115,7 +115,7 @@ UI_DIR = build/ui RCC_DIR = build/rcc -CONFIG += release \ +CONFIG += debug \ warn_on \ qt \ thread \ @@ -134,6 +134,7 @@ RC_FILE = ui/icons/win32.rc HEADERS += include/commandline.h \ + include/debug.h \ include/dialogs/commit.h \ include/dialogs/core/base.h \ include/dialogs/move.h \ @@ -146,6 +147,7 @@ src/grandmas_svn.h SOURCES += src/commandline.cpp \ + src/debug.cpp \ src/dialogs/commit.cpp \ src/dialogs/core/base.cpp \ src/dialogs/mainwindow.cpp \ Copied: trunk/include/debug.h (from rev 13, trunk/templates/h) =================================================================== --- trunk/include/debug.h (rev 0) +++ trunk/include/debug.h 2006-08-09 14:28:30 UTC (rev 14) @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +bool gsvn_allowAssert(); + +#ifndef QT_NO_DEBUG +# define GSVN_ASSERT(cond) do {if(gsvn_allowAssert() && !(cond))qt_assert(#cond,__FILE__,__LINE__);} while (0) +#else +# define GSVN_ASSERT(cond) do{}while(0) +#endif Modified: trunk/src/commandline.cpp =================================================================== --- trunk/src/commandline.cpp 2006-08-09 06:35:51 UTC (rev 13) +++ trunk/src/commandline.cpp 2006-08-09 14:28:30 UTC (rev 14) @@ -19,15 +19,16 @@ ***************************************************************************/ #include "commandline.h" +#include "debug.h" void CommandLine::addAvailableOption(QChar shortName, QString longName, QString desc, bool canHaveValue) { - Q_ASSERT(!shortName.isNull() || !longName.isEmpty()); + GSVN_ASSERT(!shortName.isNull() || !longName.isEmpty()); Q_FOREACH(CommandLineOption opt, mOptions) { // verify uniqueness of names - Q_ASSERT(shortName.isNull() || shortName != opt.shortName); - Q_ASSERT(longName.isEmpty() || longName != opt.longName); + GSVN_ASSERT(shortName.isNull() || shortName != opt.shortName); + GSVN_ASSERT(longName.isEmpty() || longName != opt.longName); } // register the option @@ -108,7 +109,7 @@ return rOpt.isSet; } - Q_ASSERT(false); + GSVN_ASSERT(false); return false; } @@ -118,13 +119,13 @@ { if (rOpt.shortName == shortName && rOpt.longName == longName) { - Q_ASSERT(rOpt.canHaveValue); + GSVN_ASSERT(rOpt.canHaveValue); rValue = rOpt.value; return rOpt.isSet; } } - Q_ASSERT(false); + GSVN_ASSERT(false); return false; } @@ -140,7 +141,7 @@ if (!mOptions[opt].value.isNull()) { - Q_ASSERT(rOpt.isSet); + GSVN_ASSERT(mOptions[opt].isSet); rError = tr("Duplicate parameter: %1").arg(shortName); return false; } @@ -166,7 +167,7 @@ // check for an existing value if (!mOptions[opt].value.isNull()) { - Q_ASSERT(mOptions[opt].isSet); + GSVN_ASSERT(mOptions[opt].isSet); rError = tr("Duplicate parameter: %1").arg("--"+longName); return false; } Copied: trunk/src/debug.cpp (from rev 13, trunk/templates/cpp) =================================================================== --- trunk/src/debug.cpp (rev 0) +++ trunk/src/debug.cpp 2006-08-09 14:28:30 UTC (rev 14) @@ -0,0 +1,27 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "debug.h" +#include <QtTest/QtTest> + +bool gsvn_allowAssert() +{ + return (QTest::currentTestFunction() == NULL); +} Modified: trunk/src/dialogs/core/base.cpp =================================================================== --- trunk/src/dialogs/core/base.cpp 2006-08-09 06:35:51 UTC (rev 13) +++ trunk/src/dialogs/core/base.cpp 2006-08-09 14:28:30 UTC (rev 14) @@ -19,6 +19,7 @@ ***************************************************************************/ #include "dialogs/core/base.h" +#include "debug.h" #include <QBoxLayout> #include <QPushButton> @@ -55,9 +56,9 @@ // If both widgets are in the same layout, it's important to move them in the correct order. int firstIndex = pLayout->indexOf(pFirstWidget); int secondIndex = pLayout->indexOf(pSecondWidget); - Q_ASSERT(firstIndex != -1); - Q_ASSERT(secondIndex != -1); - Q_ASSERT(firstIndex < secondIndex); + GSVN_ASSERT(firstIndex != -1); + GSVN_ASSERT(secondIndex != -1); + GSVN_ASSERT(firstIndex < secondIndex); pLayout->removeWidget(pSecondWidget); pLayout->insertWidget(firstIndex, pSecondWidget); Modified: trunk/src/settings/userpaths.cpp =================================================================== --- trunk/src/settings/userpaths.cpp 2006-08-09 06:35:51 UTC (rev 13) +++ trunk/src/settings/userpaths.cpp 2006-08-09 14:28:30 UTC (rev 14) @@ -19,6 +19,7 @@ ***************************************************************************/ #include "settings/userpaths.h" +#include "debug.h" #include <QDir> #include <QSettings> @@ -124,7 +125,7 @@ QString UserPathsModel::getPath(const QModelIndex& rcIndex) const { - Q_ASSERT(rcIndex.isValid() && rcIndex.row() <= mPaths.size()); + GSVN_ASSERT(rcIndex.isValid() && rcIndex.row() <= mWorkingCopies.size()); return mWorkingCopies.at(rcIndex.row()).getPath(); } @@ -137,7 +138,7 @@ emit layoutChanged(); int offset = qBinaryFind(mWorkingCopies.begin(), mWorkingCopies.end(), WorkingCopy(wc)) - mWorkingCopies.begin(); - Q_ASSERT(offset >= 0); - Q_ASSERT(offset < mWorkingCopies.size()); + GSVN_ASSERT(offset >= 0); + GSVN_ASSERT(offset < mWorkingCopies.size()); return index(offset, 0); } Modified: trunk/src/svn/modification.cpp =================================================================== --- trunk/src/svn/modification.cpp 2006-08-09 06:35:51 UTC (rev 13) +++ trunk/src/svn/modification.cpp 2006-08-09 14:28:30 UTC (rev 14) @@ -20,6 +20,7 @@ #include <svn/modification.h> #include <svn/server_access.h> +#include "debug.h" #include <apr_pools.h> #include <assert.h> @@ -272,7 +273,7 @@ svn_client_create_context(&mpCtx, mpContext->getAprPool()); QString rIgnoredError; - Q_ASSERT(initAuthProviders(mpCtx, *mpContext, rIgnoredError)); + GSVN_ASSERT(initAuthProviders(mpCtx, *mpContext, rIgnoredError)); } Modified: trunk/src/svn/revision.cpp =================================================================== --- trunk/src/svn/revision.cpp 2006-08-09 06:35:51 UTC (rev 13) +++ trunk/src/svn/revision.cpp 2006-08-09 14:28:30 UTC (rev 14) @@ -19,6 +19,7 @@ ***************************************************************************/ #include <svn/revision.h> +#include "debug.h" #include <QtDebug> Revision::Revision() @@ -49,7 +50,7 @@ int Revision::getCommittedRevision() { - Q_ASSERT(mIsCommitted); + GSVN_ASSERT(mIsCommitted); return mCommittedRevision; } Modified: trunk/tests/commandlinetest.cpp =================================================================== --- trunk/tests/commandlinetest.cpp 2006-08-09 06:35:51 UTC (rev 13) +++ trunk/tests/commandlinetest.cpp 2006-08-09 14:28:30 UTC (rev 14) @@ -20,6 +20,7 @@ #include "commandlinetest.h" #include "commandline.h" +#include "debug.h" #include <QtTest/QtTest> CommandLineTest::CommandLineTest() @@ -29,7 +30,7 @@ void CommandLineTest::init() { - Q_ASSERT(mpCmd == NULL); + GSVN_ASSERT(mpCmd == NULL); mpCmd = new CommandLine; mpCmd->addAvailableOption('s', NULL, "short parameter (without value)", false); mpCmd->addAvailableOption('S', NULL, "short parameter (with value)", true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-08-09 06:36:02
|
Revision: 13 Author: matthiasmiller Date: 2006-08-08 23:35:51 -0700 (Tue, 08 Aug 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=13&view=rev Log Message: ----------- add unit tests that can be run from the command-line Modified Paths: -------------- trunk/grandmas_svn.pro trunk/src/main.cpp Added Paths: ----------- trunk/include/commandline.h trunk/src/commandline.cpp trunk/tests/ trunk/tests/commandlinetest.cpp trunk/tests/commandlinetest.h trunk/tests/tests.cpp trunk/tests/tests.h Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-08-09 01:41:08 UTC (rev 12) +++ trunk/grandmas_svn.pro 2006-08-09 06:35:51 UTC (rev 13) @@ -133,26 +133,43 @@ RESOURCES = ui/grandmas-svn.qrc RC_FILE = ui/icons/win32.rc -HEADERS += include/settings/userpaths.h \ +HEADERS += include/commandline.h \ include/dialogs/commit.h \ include/dialogs/core/base.h \ include/dialogs/move.h \ include/dialogs/open.h \ include/dialogs/mainwindow.h \ + include/settings/userpaths.h \ include/svn/server_access.h \ include/svn/modification.h \ include/svn/revision.h \ src/grandmas_svn.h -SOURCES += src/dialogs/commit.cpp \ +SOURCES += src/commandline.cpp \ + src/dialogs/commit.cpp \ src/dialogs/core/base.cpp \ src/dialogs/mainwindow.cpp \ src/dialogs/move.cpp \ src/dialogs/open.cpp \ + src/grandmas_svn.cpp \ + src/main.cpp \ + src/settings/userpaths.cpp \ src/svn/server_access.cpp \ src/svn/modification.cpp \ - src/svn/revision.cpp \ - src/grandmas_svn.cpp \ - src/main.cpp \ - src/settings/userpaths.cpp + src/svn/revision.cpp + +# UNIT TESTS + +debug { + DEFINES += GSVN_TESTS +} +contains(DEFINES, GSVN_TESTS) { + CONFIG += qtestlib + HEADERS += tests/commandlinetest.h \ + tests/tests.h + SOURCES += tests/commandlinetest.cpp \ + tests/tests.cpp + LIBS += -lsvn_repos-1 +} + Added: trunk/include/commandline.h =================================================================== --- trunk/include/commandline.h (rev 0) +++ trunk/include/commandline.h 2006-08-09 06:35:51 UTC (rev 13) @@ -0,0 +1,56 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <QChar> +#include <QList> +#include <QObject> +#include <QStringList> + +class CommandLine : public QObject +{ +public: + void addAvailableOption(QChar shortName, QString longName, QString desc, bool canHaveValue); + + bool parse(int argc, char** argv, QString& rError); + bool parse(const QStringList& rcArgs, QString& rError); + QString usage(); + + // must correspond with addAvailableOption + bool checkOption(QChar shortName, QString longName); + bool checkOption(QChar shortName, QString longName, QString& rValue); + +private: + bool setArgByShortName(QChar shortName, QString& rError); + bool setArgByLongName(QString longName, QString value, QString& rError); + + struct CommandLineOption + { + QChar shortName; + QString longName; + QString desc; + bool canHaveValue; + + bool isSet; + QString value; + }; + + QList<CommandLineOption> mOptions; +}; + Added: trunk/src/commandline.cpp =================================================================== --- trunk/src/commandline.cpp (rev 0) +++ trunk/src/commandline.cpp 2006-08-09 06:35:51 UTC (rev 13) @@ -0,0 +1,195 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "commandline.h" + +void CommandLine::addAvailableOption(QChar shortName, QString longName, QString desc, bool canHaveValue) +{ + Q_ASSERT(!shortName.isNull() || !longName.isEmpty()); + Q_FOREACH(CommandLineOption opt, mOptions) + { + // verify uniqueness of names + Q_ASSERT(shortName.isNull() || shortName != opt.shortName); + Q_ASSERT(longName.isEmpty() || longName != opt.longName); + } + + // register the option + CommandLineOption opt; + opt.shortName = shortName; + opt.longName = longName; + opt.desc = desc; + opt.canHaveValue = canHaveValue; + opt.isSet = false; + Q_UNUSED(opt.value); + mOptions.push_back(opt); +} + +bool CommandLine::parse(int argc, char** argv, QString& rError) +{ + argc--; + argv++; + + QStringList args; + while (args.size() < argc) + args.push_back(argv[args.size()]); + return parse(args, rError); +} + +bool CommandLine::parse(const QStringList& rcArgs, QString& rError) +{ + for (QStringList::const_iterator iter = rcArgs.begin(); iter != rcArgs.end(); iter++) + { + if (iter->startsWith("--")) + { + // long names + QString longName = iter->mid(2); + + QString value; + if (iter+1 != rcArgs.end() && !(iter+1)->startsWith("-")) + { + iter++; + value = *iter; + } + + if (!setArgByLongName(longName, value, rError)) + return false; + } + else if (iter->startsWith("-")) + { + // short names + if (*iter == "-") + { + rError = tr("Invalid parameter: %1").arg(*iter); + return false; + } + for (int i = 1; i < iter->length(); i++) + { + if (!setArgByShortName(iter->at(i), rError)) + return false; + } + } + else + { + rError = tr("Invalid parameter: %1").arg(*iter); + return false; + } + } + + return true; +} + +QString CommandLine::usage() +{ + return tr(""); +} + +bool CommandLine::checkOption(QChar shortName, QString longName) +{ + Q_FOREACH(const CommandLineOption& rOpt, mOptions) + { + if (rOpt.shortName == shortName && rOpt.longName == longName) + return rOpt.isSet; + } + + Q_ASSERT(false); + return false; +} + +bool CommandLine::checkOption(QChar shortName, QString longName, QString& rValue) +{ + Q_FOREACH(const CommandLineOption& rOpt, mOptions) + { + if (rOpt.shortName == shortName && rOpt.longName == longName) + { + Q_ASSERT(rOpt.canHaveValue); + rValue = rOpt.value; + return rOpt.isSet; + } + } + + Q_ASSERT(false); + return false; +} + +bool CommandLine::setArgByShortName(QChar shortName, QString& rError) +{ + for (int opt = 0; opt < mOptions.size(); opt++) + { + if (mOptions[opt].shortName.isNull()) + continue; + + if (mOptions[opt].shortName != shortName) + continue; + + if (!mOptions[opt].value.isNull()) + { + Q_ASSERT(rOpt.isSet); + rError = tr("Duplicate parameter: %1").arg(shortName); + return false; + } + + mOptions[opt].isSet = true; + return true; + } + + rError = tr("Invalid parameter: %1").arg(shortName); + return false; +} + +bool CommandLine::setArgByLongName(QString longName, QString value, QString& rError) +{ + for (int opt = 0; opt < mOptions.size(); opt++) + { + if (mOptions[opt].longName.isEmpty()) + continue; + + if (mOptions[opt].longName != longName) + continue; + + // check for an existing value + if (!mOptions[opt].value.isNull()) + { + Q_ASSERT(mOptions[opt].isSet); + rError = tr("Duplicate parameter: %1").arg("--"+longName); + return false; + } + + if (!value.isNull()) + { + if (mOptions[opt].isSet) + { + rError = tr("Duplicate parameter: %1").arg("--"+longName); + return false; + } + if (!mOptions[opt].canHaveValue) + { + rError = tr("Invalid parameter: %1").arg(value); + return false; + } + } + + mOptions[opt].isSet = true; + mOptions[opt].value = value; + return true; + } + + rError = tr("Invalid parameter: %1").arg("--"+longName); + return false; +} Modified: trunk/src/main.cpp =================================================================== --- trunk/src/main.cpp 2006-08-09 01:41:08 UTC (rev 12) +++ trunk/src/main.cpp 2006-08-09 06:35:51 UTC (rev 13) @@ -19,13 +19,18 @@ ***************************************************************************/ #include "grandmas_svn.h" +#include "commandline.h" + +#ifdef GSVN_TESTS +#include "../tests/tests.h" +#endif + +#include <apr_general.h> #include <svn/modification.h> #include <svn/server_access.h> -#include <apr_general.h> #include <iostream> - class QSvnOperationStatus : public SvnOperationStatus { public: @@ -85,7 +90,25 @@ apr_pool_destroy(pool); // END TEST CODE + GrandmasSVNApp app(argc, argv); - GrandmasSVNApp app(argc, argv); + CommandLine cmd; +#ifdef GSVN_TESTS + cmd.addAvailableOption('t', "tests", "run unit tests", false); +#endif + + if (!cmd.parse(argc, argv, error)) + { + fputs(error.toAscii(), stderr); + fputs("\n", stderr); + fputs(cmd.usage().toAscii(), stderr); + return 1; + } + +#ifdef GSVN_TESTS + if (cmd.checkOption('t', "tests")) + return runTests(); +#endif + return app.exec(); } Added: trunk/tests/commandlinetest.cpp =================================================================== --- trunk/tests/commandlinetest.cpp (rev 0) +++ trunk/tests/commandlinetest.cpp 2006-08-09 06:35:51 UTC (rev 13) @@ -0,0 +1,256 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "commandlinetest.h" +#include "commandline.h" +#include <QtTest/QtTest> + +CommandLineTest::CommandLineTest() +{ + mpCmd = NULL; +} + +void CommandLineTest::init() +{ + Q_ASSERT(mpCmd == NULL); + mpCmd = new CommandLine; + mpCmd->addAvailableOption('s', NULL, "short parameter (without value)", false); + mpCmd->addAvailableOption('S', NULL, "short parameter (with value)", true); + mpCmd->addAvailableOption(NULL, "long", "long parameter (without value)", false); + mpCmd->addAvailableOption(NULL, "long-value", "long parameter (with value)", true); + mpCmd->addAvailableOption('b', "both", "both long and short parameter (without value)", false); + mpCmd->addAvailableOption('B', "both-value", "both long and short parameter (with value)", true); +} + +void CommandLineTest::testUsage() +{ + QString usage = mpCmd->usage(); + QVERIFY(usage.contains("-B")); + QVERIFY(usage.contains("--both-value")); + QVERIFY(usage.contains("both long and short parameter (with value)")); +} + +void CommandLineTest::testCheckOptionBeforeParse() +{ + QVERIFY(!mpCmd->checkOption('?', "unknown")); + + CommandLine cmd; + QString value; + QVERIFY(!cmd.checkOption('!', "unspecified")); + QVERIFY(!cmd.checkOption('!', "unspecified", value)); + QVERIFY(value.isNull()); +} + +void CommandLineTest::testAddAvailableOptionAfterParse() +{ + mpCmd->addAvailableOption('!', "extra", "extra parameter", false); + + QString value; + QVERIFY(!mpCmd->checkOption('!', "extra")); + QVERIFY(!mpCmd->checkOption('!', "extra", value)); + QVERIFY(value.isNull()); +} + +void CommandLineTest::testPath() +{ + QStringList args; + args.push_back("/my/path/"); + + QString error; + QVERIFY(!mpCmd->parse(args, error)); + QCOMPARE(error, tr("Invalid parameter: %1").arg("/my/path/")); +} + +void CommandLineTest::testBogusShort() +{ + QStringList args; + args.push_back("-?"); + + QString error; + QVERIFY(!mpCmd->parse(args, error)); + QCOMPARE(error, tr("Invalid parameter: %1").arg("?")); +} + +void CommandLineTest::testBogusLong() +{ + QStringList args; + args.push_back("-?"); + + QString error; + QVERIFY(!mpCmd->parse(args, error)); + QCOMPARE(error, tr("Invalid parameter: %1").arg("?")); +} + +void CommandLineTest::testTripleDash() +{ + QStringList args; + args.push_back("---long"); + + QString error; + QVERIFY(!mpCmd->parse(args, error)); + QCOMPARE(error, tr("Invalid parameter: %1").arg("---long")); +} + +void CommandLineTest::testDuplicateShort() +{ + QStringList args; + args.push_back("-s"); + args.push_back("-s"); + + QString error; + QVERIFY(mpCmd->parse(args, error)); + QVERIFY(error.isNull()); + QVERIFY(mpCmd->checkOption('s', NULL)); +} + +void CommandLineTest::testLongWithValue() +{ + QStringList args; + args.push_back("--long-value"); + args.push_back("value"); + + QString error; + QVERIFY(mpCmd->parse(args, error)); + QVERIFY(error.isNull()); + + QString value; + QVERIFY(mpCmd->checkOption(NULL, "long-value", value)); + QCOMPARE(value, QString("value")); +} + +void CommandLineTest::testDuplicateLongWithoutValue() +{ + QStringList args; + args.push_back("--long"); + args.push_back("--long"); + + QString error; + QVERIFY(mpCmd->parse(args, error)); + QVERIFY(error.isNull()); + QVERIFY(mpCmd->checkOption(NULL, "long")); +} + +void CommandLineTest::testDuplicateLongWithoutValue1() +{ + QStringList args; + args.push_back("--long"); + args.push_back("--long"); + args.push_back("value"); + + QString error; + QVERIFY(!mpCmd->parse(args, error)); + QCOMPARE(error, tr("Duplicate parameter: %1").arg("--long")); +} + +void CommandLineTest::testDuplicateLongWithoutValue2() +{ + QStringList args; + args.push_back("--long"); + args.push_back("value"); + args.push_back("--long"); + + QString error; + QVERIFY(!mpCmd->parse(args, error)); + QCOMPARE(error, tr("Invalid parameter: %1").arg("value")); +} + +void CommandLineTest::testDuplicateLongWithValue1() +{ + QStringList args; + args.push_back("--long-value"); + args.push_back("--long-value"); + args.push_back("value"); + + QString error; + QVERIFY(!mpCmd->parse(args, error)); + QCOMPARE(error, tr("Duplicate parameter: %1").arg("--long-value")); +} + +void CommandLineTest::testDuplicateLongWithValue2() +{ + QStringList args; + args.push_back("--long-value"); + args.push_back("value"); + args.push_back("--long-value"); + + QString error; + QVERIFY(!mpCmd->parse(args, error)); + QCOMPARE(error, tr("Duplicate parameter: %1").arg("--long-value")); +} + +void CommandLineTest::testShortAndLongWithValue() +{ + QStringList args; + args.push_back("--both-value"); + args.push_back("value"); + + QString error; + QVERIFY(mpCmd->parse(args, error)); + QVERIFY(error.isNull()); + + QString value; + QVERIFY(mpCmd->checkOption('B', "both-value", value)); + QCOMPARE(value, QString("value")); +} + +void CommandLineTest::testDuplicateShortAndLongWithoutValue() +{ + QStringList args; + args.push_back("-b"); + args.push_back("--both"); + + QString error; + QVERIFY(mpCmd->parse(args, error)); + QVERIFY(error.isNull()); + + QString value; + QVERIFY(mpCmd->checkOption('b', "both")); + QVERIFY(value.isNull()); +} + +void CommandLineTest::testDuplicateShortAndLongWithValue() +{ + QStringList args; + args.push_back("-B"); + args.push_back("--both-value"); + args.push_back("value"); + + QString error; + QVERIFY(!mpCmd->parse(args, error)); + QCOMPARE(error, tr("Duplicate parameter: %1").arg("--both-value")); +} + +void CommandLineTest::testDuplicateLongAndShortWithValue() +{ + QStringList args; + args.push_back("--both-value"); + args.push_back("-B"); + args.push_back("value"); + + QString error; + QVERIFY(!mpCmd->parse(args, error)); + QCOMPARE(error, tr("Invalid parameter: %1").arg("value")); +} + +void CommandLineTest::cleanup() +{ + delete mpCmd; + mpCmd = NULL; +} Added: trunk/tests/commandlinetest.h =================================================================== --- trunk/tests/commandlinetest.h (rev 0) +++ trunk/tests/commandlinetest.h 2006-08-09 06:35:51 UTC (rev 13) @@ -0,0 +1,56 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <QObject> + +class CommandLine; + +class CommandLineTest : public QObject +{ + Q_OBJECT +public: + CommandLineTest(); + +private slots: + void init(); + void testUsage(); + void testCheckOptionBeforeParse(); + void testAddAvailableOptionAfterParse(); + void testPath(); + void testBogusShort(); + void testBogusLong(); + void testTripleDash(); + void testDuplicateShort(); + void testLongWithValue(); + void testDuplicateLongWithoutValue(); + void testDuplicateLongWithoutValue1(); + void testDuplicateLongWithoutValue2(); + void testDuplicateLongWithValue1(); + void testDuplicateLongWithValue2(); + void testShortAndLongWithValue(); + void testDuplicateShortAndLongWithoutValue(); + void testDuplicateShortAndLongWithValue(); + void testDuplicateLongAndShortWithValue(); + void cleanup(); + +private: + CommandLine* mpCmd; +}; + Added: trunk/tests/tests.cpp =================================================================== --- trunk/tests/tests.cpp (rev 0) +++ trunk/tests/tests.cpp 2006-08-09 06:35:51 UTC (rev 13) @@ -0,0 +1,40 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "tests.h" +#include "commandlinetest.h" + +#include <QtTest/QtTest> + +#define TEST(ObjectType) \ + do \ + { \ + ObjectType obj; \ + int testResult = QTest::qExec(&obj); \ + if (testResult > result) \ + result = testResult; \ + } while (0) + +int runTests() +{ + int result = 0; + TEST(CommandLineTest); + return result; +} Added: trunk/tests/tests.h =================================================================== --- trunk/tests/tests.h (rev 0) +++ trunk/tests/tests.h 2006-08-09 06:35:51 UTC (rev 13) @@ -0,0 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +int runTests(); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hig...@us...> - 2006-08-09 01:41:14
|
Revision: 12 Author: highjinx Date: 2006-08-08 18:41:08 -0700 (Tue, 08 Aug 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=12&view=rev Log Message: ----------- * Improving the Modifications class * Started adding (untested) unit test for Modifications class Modified Paths: -------------- trunk/grandmas_svn.kdevelop trunk/include/svn/modification.h trunk/include/svn/server_access.h trunk/src/main.cpp trunk/src/svn/modification.cpp trunk/src/svn/revision.cpp Modified: trunk/grandmas_svn.kdevelop =================================================================== --- trunk/grandmas_svn.kdevelop 2006-08-09 00:52:38 UTC (rev 11) +++ trunk/grandmas_svn.kdevelop 2006-08-09 01:41:08 UTC (rev 12) @@ -86,7 +86,7 @@ <directoryradio>executable</directoryradio> </run> <general> - <activedir>src</activedir> + <activedir></activedir> </general> </kdevtrollproject> <workspace> @@ -117,7 +117,7 @@ <LICENSEFILE>COPYING</LICENSEFILE> <VERSION>0.1</VERSION> <YEAR>2006</YEAR> - <dest></dest> + <dest/> </substmap> <kdevcppsupport> <references/> Modified: trunk/include/svn/modification.h =================================================================== --- trunk/include/svn/modification.h 2006-08-09 00:52:38 UTC (rev 11) +++ trunk/include/svn/modification.h 2006-08-09 01:41:08 UTC (rev 12) @@ -26,6 +26,7 @@ class SvnOperationContext; struct svn_wc_status2_t; struct svn_client_ctx_t; +struct svn_info_t; class Modification { @@ -69,21 +70,77 @@ class Modifications : public SvnOperation { public: + // Public, interfaced functions bool init(SvnOperationContext& rContext, QString path, Revision revision, QString& rError); void getModifications(QList<Modification>& rModifications); - bool uncommittedFileIsConflicted(Modification modification); + protected: + bool getRelativeRepoUrl(SvnOperationContext& rContext, svn_client_ctx_t* ctx, QString& rError); + + QString mWcPath; + Revision mRevision; SvnOperationContext* mpContext; - Revision mRevision; + QString mRelativeRepoUrl; QList<Modification> mModifications; - QList<bool> mModificationIsConflicted; +private: + // Callbacks + static void statusCallback(void *baton, const char *path, svn_wc_status2_t *status); + static svn_error_t* logCallback(void *baton, apr_hash_t *changed_paths, svn_revnum_t revision, const char *author, const char *date, const char *message, apr_pool_t *pool); + static svn_error_t* infoCallback(void *baton, const char *path, const svn_info_t *info, apr_pool_t *pool); +}; + + + +#include <svn/server_access.h> + +#include <svn_repos.h> + +#include <QDir> +#include <QObject> +#include <QtTest/QtTest> + +class NoOperationStatus : public SvnOperationStatus +{ public: - void statusCallback(void *baton, const char *path, svn_wc_status2_t *status); + virtual ~NoOperationStatus() {} + virtual void update(QString textToAdd) { textToAdd=textToAdd; } - svn_error_t* logCallback(void *baton, apr_hash_t *changed_paths, svn_revnum_t revision, const char *author, const char *date, const char *message, apr_pool_t *pool); + virtual bool shouldCancel() { return false; } }; +class NoAuthentication : public SvnAuthentication +{ +protected: + virtual bool getAuthentication(QString& /*rUsername*/, QString& /*rPassword*/) { return false; } +}; +class ModificationsTester : public QObject, SvnOperation +{ + Q_OBJECT + +public: + ModificationsTester(); + ~ModificationsTester(); + +private: + QString getRepoPath() { return QDir::convertSeparators(QDir::tempPath()+"/gsvn_repo"); } + QString getWcPath() { return QDir::convertSeparators(QDir::tempPath()+"/gsvn_wc"); } + + bool createRepos(); + bool commitChanges(); + bool addFile(QString relFilePath); + bool touchFile(QString relFilePath, QString fileText); // fails if the file exists + +private slots: + void initTestCase(); + void cleanupTestCase(); + +private: + NoOperationStatus mStatus; + NoAuthentication mAuthentication; + SvnOperationContext* mpContext; + svn_client_ctx_t* mpCtx; +}; Modified: trunk/include/svn/server_access.h =================================================================== --- trunk/include/svn/server_access.h 2006-08-09 00:52:38 UTC (rev 11) +++ trunk/include/svn/server_access.h 2006-08-09 01:41:08 UTC (rev 12) @@ -18,6 +18,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#ifndef _SERVER_ACCESS_H +#define _SERVER_ACCESS_H + #include <QString> struct apr_pool_t; @@ -70,3 +73,5 @@ SvnAuthentication* mpAuthentication; }; +#endif + Modified: trunk/src/main.cpp =================================================================== --- trunk/src/main.cpp 2006-08-09 00:52:38 UTC (rev 11) +++ trunk/src/main.cpp 2006-08-09 01:41:08 UTC (rev 12) @@ -23,6 +23,7 @@ #include <svn/server_access.h> #include <apr_general.h> +#include <iostream> class QSvnOperationStatus : public SvnOperationStatus @@ -49,6 +50,7 @@ return false; } }; +using namespace std; int main(int argc, char** argv) { @@ -71,10 +73,14 @@ QString error; Revision revision; + //revision.setUncommittedRevision(); revision.setCommittedRevision(5); Modifications mods; - mods.init(context, "/home/joshn/projects/gsvn", revision, error); + if (!mods.init(context, "/home/joshn/projects/gsvn", revision, error)) + { + cout << "Error!: " << (const char*)error.toAscii() << "\n"; + } apr_pool_destroy(pool); Modified: trunk/src/svn/modification.cpp =================================================================== --- trunk/src/svn/modification.cpp 2006-08-09 00:52:38 UTC (rev 11) +++ trunk/src/svn/modification.cpp 2006-08-09 01:41:08 UTC (rev 12) @@ -36,7 +36,7 @@ QString promptPassword; SvnAuthentication* pAuth = ((SvnAuthentication*)baton); if (!pAuth->getAuthentication(promptUsername)) - return svn_error_create(SVN_ERR_CANCELLED, NULL, ""); + return svn_error_create(SVN_ERR_CANCELLED, NULL, ""); svn_auth_cred_simple_t* lcred = (svn_auth_cred_simple_t*)apr_palloc(pool, sizeof (svn_auth_cred_simple_t)); lcred->username = pAuth->getUsername(); @@ -74,59 +74,25 @@ return true; } -svn_opt_revision_t svnRevisionFromRevision(Revision rev) -{ - svn_opt_revision_t svnRev; - svnRev.kind = svn_opt_revision_number; - if (!rev.isCommittedRevision()) - svnRev.value.number = 0; - else - svnRev.value.number = rev.getCommittedRevision(); - return svnRev; -} - -void statusCallback(void *baton, const char *path, svn_wc_status2_t *status) -{ - ((Modifications*)baton)->statusCallback(NULL, path, status); -} - -svn_error_t* logCallback(void *baton, apr_hash_t *changed_paths, svn_revnum_t revision, const char *author, const char *date, const char *message, apr_pool_t *pool) -{ - return ((Modifications*)baton)->logCallback(NULL, changed_paths, revision, author, date, message, pool); -} - -svn_error_t* cancelFunc(void */*baton*/) -{ - cout << "cancel" << endl; - return NULL; -} - -void setUpAuthProviders() -{ -} - bool Modifications::init(SvnOperationContext& rServer, QString path, Revision revision, QString& rError) { rError = ""; mpContext = &rServer; + mWcPath = path; svn_client_ctx_t* ctx; svn_client_create_context(&ctx, rServer.getAprPool()); if (!initAuthProviders(ctx, rServer, rError)) return false; - ctx->notify_func2 = NULL; - ctx->cancel_func = ::cancelFunc; - ctx->cancel_baton = NULL; - ctx->log_msg_func2 = NULL; - ctx->log_msg_func = NULL; - ctx->progress_func = NULL; + if (!getRelativeRepoUrl(rServer, ctx, rError)) + return false; svn_error_t* pError = NULL; if (revision.isCommittedRevision()) { - svn_opt_revision_t startRev = svnRevisionFromRevision(revision); - svn_opt_revision_t endRev = svnRevisionFromRevision(revision); + svn_opt_revision_t startRev = revision.getSvnRevision(); + svn_opt_revision_t endRev = revision.getSvnRevision(); apr_array_header_t *array = apr_array_make(rServer.getAprPool(), 1, sizeof(const char*)); APR_ARRAY_PUSH(array, const char*) = svn_path_canonicalize(path.toAscii(), rServer.getAprPool()); @@ -136,16 +102,16 @@ 0/*limit*/, true/*discover_changed_paths*/, false/*strict_node_history*/, - ::logCallback, + logCallback, this, ctx, rServer.getAprPool()); } else { - svn_opt_revision_t svnRevision = svnRevisionFromRevision(revision); + svn_opt_revision_t svnRevision = revision.getSvnRevision(); pError = svn_client_status2(NULL, path.toAscii(), &svnRevision, - ::statusCallback, + statusCallback, this, true/*recurse*/, false/*get_all*/, @@ -158,7 +124,6 @@ if (pError) { rError = pError->message; - cout << (const char*)rError.toAscii() << endl; return false; } return true; @@ -169,15 +134,12 @@ rModifications = mModifications; } -bool Modifications::uncommittedFileIsConflicted(Modification /*modification*/) +void Modifications::statusCallback(void *baton, const char *path, svn_wc_status2_t *status) { - return false; -} + Modifications* pThis = (Modifications*)baton; -void Modifications::statusCallback(void */*baton*/, const char *path, svn_wc_status2_t *status) -{ Modification mod; - mod.newRevision = mRevision; + mod.newRevision = pThis->mRevision; // Set old revision to base, if the file is already under version control if (status->entry) @@ -187,7 +149,6 @@ { // cases we care about case svn_wc_status_unversioned: - mod.mFilePath = path; mod.mType = Modification::Type_New; break; case svn_wc_status_added: @@ -196,22 +157,18 @@ break; case svn_wc_status_missing: - mod.mFilePath = path; mod.mType = Modification::Type_Missing; break; case svn_wc_status_deleted: - mod.mFilePath = path; mod.mType = Modification::Type_Delete; break; case svn_wc_status_modified: - mod.mFilePath = path; mod.mType = Modification::Type_TextMod; break; case svn_wc_status_conflicted: - mod.mFilePath = path; mod.mType = Modification::Type_Conflicting; break; @@ -231,11 +188,16 @@ break; } - mModifications.append(mod); + mod.mFilePath = path; + if (mod.mFilePath.startsWith(pThis->mWcPath)) + mod.mFilePath.remove(0, pThis->mWcPath.length()); + + pThis->mModifications.append(mod); } -svn_error_t* Modifications::logCallback(void */*baton*/, apr_hash_t *changed_paths, svn_revnum_t revision, const char */*author*/, const char */*date*/, const char */*message*/, apr_pool_t *pool) +svn_error_t* Modifications::logCallback(void *baton, apr_hash_t *changed_paths, svn_revnum_t revision, const char */*author*/, const char */*date*/, const char */*message*/, apr_pool_t *pool) { + Modifications* pThis = (Modifications*)baton; for (apr_hash_index_t* pKey = apr_hash_first(pool, changed_paths); pKey; pKey = apr_hash_next(pKey)) { char *path; @@ -244,6 +206,8 @@ Modification mod; mod.mFilePath = path; + + mod.newRevision.setCommittedRevision(revision); mod.oldRevision.setCommittedRevision(revision-1); svn_log_changed_path_t *log_item = reinterpret_cast<svn_log_changed_path_t *>(val); @@ -266,9 +230,111 @@ // TODO: return error break; } - mModifications.append(mod); + pThis->mModifications.append(mod); } return NULL; } +svn_error_t* Modifications::infoCallback(void *baton, const char */*path*/, const svn_info_t *info, apr_pool_t */*pool*/) +{ + Modifications* pThis = (Modifications*)baton; + + QString sRootUrl = info->repos_root_URL; + QString sRepoUrl = info->URL; + + if (!sRepoUrl.startsWith(sRootUrl)) + return svn_error_create(SVN_ERR_INCOMPLETE_DATA, NULL, "Invalid repository information."); + + sRepoUrl.remove(0, sRootUrl.length()); + pThis->mRelativeRepoUrl = sRepoUrl; + return NULL; +} + +bool Modifications::getRelativeRepoUrl(SvnOperationContext& rContext, svn_client_ctx_t* ctx, QString& rError) +{ + svn_error_t* pError = svn_client_info(mWcPath.toAscii(), NULL, NULL, infoCallback, this, false, ctx, rContext.getAprPool()); + if (pError) + { + rError = pError->message; + return false; + } + + return true; +} + +ModificationsTester::ModificationsTester() +{ + apr_pool_t* pool; + apr_pool_create(&pool, NULL); + mpContext = new SvnOperationContext(pool, mStatus, mAuthentication); + + svn_client_create_context(&mpCtx, mpContext->getAprPool()); + + QString rIgnoredError; + Q_ASSERT(initAuthProviders(mpCtx, *mpContext, rIgnoredError)); + +} + +ModificationsTester::~ModificationsTester() +{ + apr_pool_destroy(mpContext->getAprPool()); + delete mpContext; +} + +bool ModificationsTester::createRepos() +{ + svn_repos_t* pCreatedRepo; + if (svn_repos_create(&pCreatedRepo, getRepoPath().toAscii(), NULL, NULL, NULL, NULL, mpContext->getAprPool())) + return false; + + svn_opt_revision_t revision; + revision.kind = svn_opt_revision_head; + if (svn_client_checkout2(NULL, QString("file://"+getRepoPath()).toAscii(), getWcPath().toAscii(), &revision, &revision, true, false, mpCtx, mpContext->getAprPool())) + return false; + + return true; +} + +bool ModificationsTester::commitChanges() +{ + return false; +} + +bool ModificationsTester::addFile(QString relFilePath) +{ + relFilePath = relFilePath; + return false; +} + +bool ModificationsTester::touchFile(QString relFilePath, QString fileText) +{ + QFile file(QDir::convertSeparators(getWcPath()+relFilePath)); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) + return false; + + QTextStream out(&file); + out << fileText; + if (!file.flush()) + return false; + + return true; +} + +void ModificationsTester::initTestCase() +{ + qDebug("called before everything else"); +} + +void ModificationsTester::cleanupTestCase() +{ + qDebug("called after myFirstTest and mySecondTest"); +} + + + + + + + + Modified: trunk/src/svn/revision.cpp =================================================================== --- trunk/src/svn/revision.cpp 2006-08-09 00:52:38 UTC (rev 11) +++ trunk/src/svn/revision.cpp 2006-08-09 01:41:08 UTC (rev 12) @@ -19,6 +19,7 @@ ***************************************************************************/ #include <svn/revision.h> +#include <QtDebug> Revision::Revision() { @@ -48,14 +49,23 @@ int Revision::getCommittedRevision() { -// assert(mIsCommitted); + Q_ASSERT(mIsCommitted); return mCommittedRevision; } svn_opt_revision_t Revision::getSvnRevision() { svn_opt_revision_t svnRev; - svnRev.value.number = mCommittedRevision; + if (!isCommittedRevision()) + { + svnRev.kind = svn_opt_revision_working; + svnRev.value.number = 0; + } + else + { + svnRev.kind = svn_opt_revision_number; + svnRev.value.number = getCommittedRevision(); + } return svnRev; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-08-09 00:52:43
|
Revision: 11 Author: matthiasmiller Date: 2006-08-08 17:52:38 -0700 (Tue, 08 Aug 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=11&view=rev Log Message: ----------- implement open dialog Modified Paths: -------------- trunk/include/dialogs/open.h trunk/include/settings/userpaths.h trunk/src/dialogs/open.cpp trunk/src/grandmas_svn.cpp trunk/src/grandmas_svn.h trunk/src/main.cpp trunk/src/settings/userpaths.cpp Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svn:ignore - *.pcs *.kdevses Makefile Makefile.Debug Makefile.Release bin build debug release object_script.grandmas-svn.Debug object_script.grandmas-svn.Release + *.pcs *.kdevses Makefile Makefile.Debug Makefile.Release bin build debug release object_script.grandmas-svn.Debug object_script.grandmas-svn.Release grandmas-svn.xcodeproj Info.plist Modified: trunk/include/dialogs/open.h =================================================================== --- trunk/include/dialogs/open.h 2006-07-31 16:33:15 UTC (rev 10) +++ trunk/include/dialogs/open.h 2006-08-09 00:52:38 UTC (rev 11) @@ -27,22 +27,22 @@ class Ui_OpenDialog; class UserPathsModel; class QKeyEvent; +class QSettings; class OpenDialog : public BaseDialog { Q_OBJECT public: - OpenDialog(); + OpenDialog(QSettings* pSettings); ~OpenDialog(); - bool load(QString& rError); - signals: void openPath(QString path); private slots: void accept(); + void openOther(); protected: virtual void initMac(); Modified: trunk/include/settings/userpaths.h =================================================================== --- trunk/include/settings/userpaths.h 2006-07-31 16:33:15 UTC (rev 10) +++ trunk/include/settings/userpaths.h 2006-08-09 00:52:38 UTC (rev 11) @@ -21,20 +21,38 @@ #include <QAbstractItemModel> #include <QStringList> +class QSettings; + class UserPathsModel : public QAbstractListModel { public: - UserPathsModel(); + UserPathsModel(QSettings* pSettings); virtual ~UserPathsModel(); - bool load(QString& rError); - virtual int rowCount(const QModelIndex& rcParent = QModelIndex()) const; virtual QVariant data(const QModelIndex& rcIndex, int role = Qt::DisplayRole) const; QString getPath(const QModelIndex& rcIndex) const; + QModelIndex addPath(QString path); private: - QStringList mNames, mPaths; + class WorkingCopy + { + public: + WorkingCopy(QString path); + QString getDisplayName() const; + QString getPath() const; + bool operator<(const WorkingCopy& rcOther) const; + + static void load(QSettings* pSettings, QList<WorkingCopy>& rWorkingCopies); + static void save(QSettings* pSettings, const QList<WorkingCopy>& rcWorkingCopies); + static void sort(QList<WorkingCopy>& rWorkingCopies); + + private: + QString mPath; + }; + + QSettings* mpSettings; + QList<WorkingCopy> mWorkingCopies; }; Modified: trunk/src/dialogs/open.cpp =================================================================== --- trunk/src/dialogs/open.cpp 2006-07-31 16:33:15 UTC (rev 10) +++ trunk/src/dialogs/open.cpp 2006-08-09 00:52:38 UTC (rev 11) @@ -21,14 +21,17 @@ #include "dialogs/open.h" #include "settings/userpaths.h" #include "ui_open.h" +#include <QFileDialog> +#include <QMessageBox> -OpenDialog::OpenDialog() +OpenDialog::OpenDialog(QSettings* pSettings) { - mpPathsModel = new UserPathsModel(); + mpPathsModel = new UserPathsModel(pSettings); mpUi = new Ui_OpenDialog(); mpUi->setupUi(this); mpUi->workingCopyListView->setModel(mpPathsModel); + connect(mpUi->otherButton, SIGNAL(clicked()), this, SLOT(openOther())); init(); } @@ -42,11 +45,6 @@ mpUi = NULL; } -bool OpenDialog::load(QString& rError) -{ - return mpPathsModel->load(rError); -} - void OpenDialog::accept() { QModelIndex index = mpUi->workingCopyListView->currentIndex(); @@ -57,6 +55,18 @@ } } +void OpenDialog::openOther() +{ + QString other = QFileDialog::getExistingDirectory(this); + if (!other.isNull()) + { + // TODO: give an error if this is not a valid working copy + QModelIndex index = mpPathsModel->addPath(other); + mpUi->workingCopyListView->setCurrentIndex(index); + mpUi->workingCopyListView->setFocus(); + } +} + void OpenDialog::initMac() { exchangeWidgets(mpUi->hboxLayout, mpUi->okButton, mpUi->cancelButton); Modified: trunk/src/grandmas_svn.cpp =================================================================== --- trunk/src/grandmas_svn.cpp 2006-07-31 16:33:15 UTC (rev 10) +++ trunk/src/grandmas_svn.cpp 2006-08-09 00:52:38 UTC (rev 11) @@ -23,7 +23,7 @@ #include "dialogs/open.h" #include <QMenuBar> -#include <QMessageBox> +#include <QSettings> GrandmasSVNApp::GrandmasSVNApp(int& argc, char** argv) : QApplication(argc, argv) { @@ -42,6 +42,9 @@ GrandmasSVNApp::~GrandmasSVNApp() { + delete mpOpenDlg; + mpOpenDlg = NULL; + delete mpAppMenu; mpAppMenu = NULL; } @@ -59,6 +62,11 @@ pOpen->setShortcut(tr("Ctrl+O")); } +QSettings* GrandmasSVNApp::createSettings() +{ + return new QSettings(QSettings::IniFormat, QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName()); +} + void GrandmasSVNApp::open() { if (mpOpenDlg) @@ -68,14 +76,12 @@ } else { - mpOpenDlg = new OpenDialog(); + QSettings* pSettings = createSettings(); + mpOpenDlg = new OpenDialog(pSettings); + pSettings->setParent(mpOpenDlg); + connect(mpOpenDlg, SIGNAL(openPath(QString)), this, SLOT(openPath(QString))); connect(mpOpenDlg, SIGNAL(finished(int)), this, SLOT(open_done(int))); - - QString error; - if (!mpOpenDlg->load(error)) - QMessageBox::critical(NULL, error, tr("Grandma's SVN")); - mpOpenDlg->show(); } } Modified: trunk/src/grandmas_svn.h =================================================================== --- trunk/src/grandmas_svn.h 2006-07-31 16:33:15 UTC (rev 10) +++ trunk/src/grandmas_svn.h 2006-08-09 00:52:38 UTC (rev 11) @@ -26,6 +26,7 @@ class OpenDialog; class QMenuBar; +class QSettings; class GrandmasSVNApp : public QApplication { @@ -37,6 +38,7 @@ private: void initMac(); + static QSettings* createSettings(); private slots: void open(); @@ -47,6 +49,7 @@ private: QMenuBar* mpAppMenu; OpenDialog* mpOpenDlg; + QSettings* mpSettings; }; #endif Modified: trunk/src/main.cpp =================================================================== --- trunk/src/main.cpp 2006-07-31 16:33:15 UTC (rev 10) +++ trunk/src/main.cpp 2006-08-09 00:52:38 UTC (rev 11) @@ -52,6 +52,11 @@ int main(int argc, char** argv) { + // This information is used for the QSettings object. + QCoreApplication::setOrganizationName("grandmas-svn.org"); + QCoreApplication::setOrganizationDomain("grandmas-svn.org"); + QCoreApplication::setApplicationName("Grandma's SVN"); + // BEGIN TEST CODE apr_status_t rv = apr_initialize(); if (rv != APR_SUCCESS) Modified: trunk/src/settings/userpaths.cpp =================================================================== --- trunk/src/settings/userpaths.cpp 2006-07-31 16:33:15 UTC (rev 10) +++ trunk/src/settings/userpaths.cpp 2006-08-09 00:52:38 UTC (rev 11) @@ -19,31 +19,93 @@ ***************************************************************************/ #include "settings/userpaths.h" +#include <QDir> +#include <QSettings> -UserPathsModel::UserPathsModel() +UserPathsModel::WorkingCopy::WorkingCopy(QString path) { + mPath = path; } -UserPathsModel::~UserPathsModel() +QString UserPathsModel::WorkingCopy::getDisplayName() const { + return QDir(mPath).dirName(); } -bool UserPathsModel::load(QString& rError) +QString UserPathsModel::WorkingCopy::getPath() const { -// BEGIN SCAFFOLDING - mNames.push_back(tr("Foo")); - mPaths.push_back(tr("Foo")); - mNames.push_back(tr("Bar")); - mPaths.push_back(tr("Bar")); - rError = ""; - return true; -// END SCAFFOLDING + return mPath; } +bool UserPathsModel::WorkingCopy::operator <(const UserPathsModel::WorkingCopy& rcOther) const +{ + int result = getDisplayName().compare(rcOther.getDisplayName()); + if (result == 0) + result = getPath().compare(rcOther.getPath()); + return result < 0; +} + +void UserPathsModel::WorkingCopy::load(QSettings* pSettings, QList<WorkingCopy>& rWorkingCopies) +{ + rWorkingCopies.empty(); + + // load working copy locations + int numWCs = pSettings->beginReadArray("WorkingCopies"); + for (int wc = 0; wc < numWCs; wc++) + { + pSettings->setArrayIndex(wc); + + QString path = pSettings->value("Path").toString(); + // TODO: check for valid repository? + if (QDir(path).exists()) + rWorkingCopies.push_back(WorkingCopy(path)); + } + pSettings->endArray(); + + sort(rWorkingCopies); +} + +void UserPathsModel::WorkingCopy::save(QSettings* pSettings, const QList<WorkingCopy>& rcWorkingCopies) +{ + pSettings->beginWriteArray("WorkingCopies"); + for (int wc = 0; wc < rcWorkingCopies.size(); wc++) + { + pSettings->setArrayIndex(wc); + pSettings->setValue("Path", rcWorkingCopies.at(wc).getPath()); + } + pSettings->endArray(); +} + +void UserPathsModel::WorkingCopy::sort(QList<WorkingCopy>& rWorkingCopies) +{ + qSort(rWorkingCopies); + + // remove duplicates + QList<WorkingCopy>::iterator iter = rWorkingCopies.begin(); + while (iter != rWorkingCopies.end()) + { + if (qBinaryFind(iter+1, rWorkingCopies.end(), *iter) != rWorkingCopies.end()) + iter = rWorkingCopies.erase(iter); + else + iter++; + } +} + + + +UserPathsModel::UserPathsModel(QSettings* pSettings) +{ + mpSettings = pSettings; + WorkingCopy::load(mpSettings, mWorkingCopies); +} + +UserPathsModel::~UserPathsModel() +{ +} + int UserPathsModel::rowCount(const QModelIndex& /*rcParent*/) const { - Q_ASSERT(mNames.count() == mPaths.count()); - return mNames.count(); + return mWorkingCopies.count(); } QVariant UserPathsModel::data(const QModelIndex& rcIndex, int role) const @@ -51,18 +113,31 @@ if (!rcIndex.isValid()) return QVariant(); - if (rcIndex.row() >= mNames.size()) + if (rcIndex.row() >= mWorkingCopies.size()) return QVariant(); if (role != Qt::DisplayRole) return QVariant(); - return mNames.at(rcIndex.row()); + return mWorkingCopies.at(rcIndex.row()).getDisplayName(); } QString UserPathsModel::getPath(const QModelIndex& rcIndex) const { Q_ASSERT(rcIndex.isValid() && rcIndex.row() <= mPaths.size()); - return mPaths.at(rcIndex.row()); + return mWorkingCopies.at(rcIndex.row()).getPath(); } +QModelIndex UserPathsModel::addPath(QString path) +{ + WorkingCopy wc(path); + mWorkingCopies.push_back(wc); + WorkingCopy::sort(mWorkingCopies); + WorkingCopy::save(mpSettings, mWorkingCopies); + emit layoutChanged(); + + int offset = qBinaryFind(mWorkingCopies.begin(), mWorkingCopies.end(), WorkingCopy(wc)) - mWorkingCopies.begin(); + Q_ASSERT(offset >= 0); + Q_ASSERT(offset < mWorkingCopies.size()); + return index(offset, 0); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-07-31 16:33:19
|
Revision: 10 Author: matthiasmiller Date: 2006-07-31 09:33:15 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=10&view=rev Log Message: ----------- link against svn_subr Modified Paths: -------------- trunk/grandmas_svn.pro Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-07-31 16:22:27 UTC (rev 9) +++ trunk/grandmas_svn.pro 2006-07-31 16:33:15 UTC (rev 10) @@ -48,7 +48,7 @@ INCLUDEPATH += $$SVN_INCLUDE_DIR/subversion-1 LIBS += -L$${SVN_LIB_DIR} - LIBS += -lsvn_client-1 + LIBS += -lsvn_client-1 -lsvn_subr-1 } win32 { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hig...@us...> - 2006-07-31 16:22:30
|
Revision: 9 Author: highjinx Date: 2006-07-31 09:22:27 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=9&view=rev Log Message: ----------- Adding server_access.cpp Added Paths: ----------- trunk/src/svn/server_access.cpp Added: trunk/src/svn/server_access.cpp =================================================================== --- trunk/src/svn/server_access.cpp (rev 0) +++ trunk/src/svn/server_access.cpp 2006-07-31 16:22:27 UTC (rev 9) @@ -0,0 +1,35 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <svn/server_access.h> +#include <svn_pools.h> + +SvnOperationContext::SvnOperationContext(apr_pool_t* pMainPool, SvnOperationStatus& rStatus, SvnAuthentication& rAuthentication) +{ + mpSubPool = svn_pool_create(pMainPool); + + mpStatus = &rStatus; + mpAuthentication = &rAuthentication; +} + +SvnOperationContext::~SvnOperationContext() +{ + apr_pool_destroy(mpSubPool); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hig...@us...> - 2006-07-31 16:19:21
|
Revision: 8 Author: highjinx Date: 2006-07-31 09:19:11 -0700 (Mon, 31 Jul 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=8&view=rev Log Message: ----------- Misc initial work on getting modifications Modified Paths: -------------- trunk/grandmas_svn.pro trunk/include/svn/file_access.h trunk/include/svn/modification.h trunk/include/svn/revision.h trunk/include/svn/server_access.h trunk/src/main.cpp trunk/src/svn/modification.cpp trunk/src/svn/revision.cpp Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-05-07 02:54:16 UTC (rev 7) +++ trunk/grandmas_svn.pro 2006-07-31 16:19:11 UTC (rev 8) @@ -58,7 +58,7 @@ SVN_INCLUDE_DIR = $$(SVN_DEV_DIR)\include SVN_LIB_DIR = $$(SVN_DEV_DIR)\lib - INCLUDEPATH += $${SVN_INCLUDE_DIR} + INCLUDEPATH += $${SVN_INCLUDE_DIR} INCLUDEPATH += $${SVN_INCLUDE_DIR}\apr INCLUDEPATH += $${SVN_INCLUDE_DIR}\apr-util INCLUDEPATH += $${SVN_INCLUDE_DIR}\apr-iconv @@ -115,7 +115,7 @@ UI_DIR = build/ui RCC_DIR = build/rcc -CONFIG += debug \ +CONFIG += release \ warn_on \ qt \ thread \ @@ -139,6 +139,9 @@ include/dialogs/move.h \ include/dialogs/open.h \ include/dialogs/mainwindow.h \ + include/svn/server_access.h \ + include/svn/modification.h \ + include/svn/revision.h \ src/grandmas_svn.h SOURCES += src/dialogs/commit.cpp \ @@ -146,6 +149,9 @@ src/dialogs/mainwindow.cpp \ src/dialogs/move.cpp \ src/dialogs/open.cpp \ + src/svn/server_access.cpp \ + src/svn/modification.cpp \ + src/svn/revision.cpp \ src/grandmas_svn.cpp \ src/main.cpp \ src/settings/userpaths.cpp Modified: trunk/include/svn/file_access.h =================================================================== --- trunk/include/svn/file_access.h 2006-05-07 02:54:16 UTC (rev 7) +++ trunk/include/svn/file_access.h 2006-07-31 16:19:11 UTC (rev 8) @@ -27,7 +27,7 @@ { public: bool init(QString fullRepoPath, Revision oldRevision, Revision newRevision, QString& rError); - bool getOldFile(QString relFilePath, QString& rFilePath, ServerAccess& rAccess, QString& rError); - bool getNewFile(QString relFilePath, QString& rFilePath, ServerAccess& rAccess, QString& rError); - bool getDiff(QString relFilePath, QString& rDiff, ServerAccess& rAccess, QString& rError); + bool getOldFile(ServerAccess& rAccess, QString relFilePath, QString& rCreatedFilePath, QString& rError); + bool getNewFile(ServerAccess& rAccess, QString relFilePath, QString& rCreatedFilePath, QString& rError); + bool getDiff(ServerAccess& rAccess, QString relLeftFilePath, QString relRightFilePath, QString& rDiff, QString& rError); }; Modified: trunk/include/svn/modification.h =================================================================== --- trunk/include/svn/modification.h 2006-05-07 02:54:16 UTC (rev 7) +++ trunk/include/svn/modification.h 2006-07-31 16:19:11 UTC (rev 8) @@ -18,21 +18,72 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include <Qt> +#include "revision.h" -class ModificationSummary +#include <QList> +#include <QString> + +class SvnOperationContext; +struct svn_wc_status2_t; +struct svn_client_ctx_t; + +class Modification { public: enum Type { + Type_TextMod, Type_Add, Type_Delete, - Type_TextMod, - Type_PropertyMod + Type_Move, + Type_PropMod, + Type_Copy, + + // Pseudo-types: types that are not modifications, but need to be displayed + Type_New, // exists, but has not been added + Type_Missing, + Type_Conflicting, }; - Type getType(); - QString getRelFilePath(); + QString getFilePath(); - bool isAddedWithHistory(QString& rSrcFilePath); + // Only use for move and copy mods + QString getDestFilePath(); + +private: + friend class Modifications; + + Type mType; + QString mFilePath; + QString mDestFilePath; + Revision oldRevision; + Revision newRevision; }; + +class SvnOperation +{ +public: + bool initAuthProviders(svn_client_ctx_t* context, SvnOperationContext& rContext, QString& rError); +}; + +class Modifications : public SvnOperation +{ +public: + bool init(SvnOperationContext& rContext, QString path, Revision revision, QString& rError); + + void getModifications(QList<Modification>& rModifications); + bool uncommittedFileIsConflicted(Modification modification); +protected: + SvnOperationContext* mpContext; + Revision mRevision; + + QList<Modification> mModifications; + QList<bool> mModificationIsConflicted; + +public: + void statusCallback(void *baton, const char *path, svn_wc_status2_t *status); + + svn_error_t* logCallback(void *baton, apr_hash_t *changed_paths, svn_revnum_t revision, const char *author, const char *date, const char *message, apr_pool_t *pool); +}; + + Modified: trunk/include/svn/revision.h =================================================================== --- trunk/include/svn/revision.h 2006-05-07 02:54:16 UTC (rev 7) +++ trunk/include/svn/revision.h 2006-07-31 16:19:11 UTC (rev 8) @@ -20,21 +20,26 @@ #include <Qt> +#include <svn_wc.h> + class Revision { public: - void SetHeadRevision(); - void SetBaseRevision(); - void SetCommittedRevision(int revision); + Revision(); + ~Revision(); - enum Type - { - Type_Head, - Type_Base, - Type_Committed - }; + void setUncommittedRevision(); + void setCommittedRevision(int revision); - Type GetType(); - int GetCommittedRevision(); + bool isCommittedRevision(); + int getCommittedRevision(); + +// svn wrapper functions +public: + svn_opt_revision_t getSvnRevision(); + +private: + bool mIsCommitted; + int mCommittedRevision; }; Modified: trunk/include/svn/server_access.h =================================================================== --- trunk/include/svn/server_access.h 2006-05-07 02:54:16 UTC (rev 7) +++ trunk/include/svn/server_access.h 2006-07-31 16:19:11 UTC (rev 8) @@ -18,11 +18,55 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include <QString> -class ServerAccess +struct apr_pool_t; + +class SvnOperationStatus { public: - void* GetStatusDisplay(); - void* GetAuthenticationCallback(); + virtual ~SvnOperationStatus() {} + virtual void update(QString textToAdd)=0; + //virtual void update(int progressPercent)=0; // maybe someday? + + virtual bool shouldCancel()=0; }; +class SvnAuthentication +{ +public: + virtual ~SvnAuthentication() {} + + bool getAuthentication(QString defaultUsername) + { + mUsername = defaultUsername; + mPassword = ""; + return getAuthentication(mUsername, mPassword); + } + const char* getUsername() { return mUsername.toAscii(); } + const char* getPassword() { return mPassword.toAscii(); } + +protected: + virtual bool getAuthentication(QString& rUsername, QString& rPassword)=0; + + QString mUsername; + QString mPassword; +}; + +class SvnOperationContext +{ +public: + SvnOperationContext(apr_pool_t* pMainPool, SvnOperationStatus& rStatus, SvnAuthentication& rAuthentication); + ~SvnOperationContext(); + +// used by svn layer + apr_pool_t* getAprPool() const { return mpSubPool; } + SvnOperationStatus* getStatus() const { return mpStatus; } + SvnAuthentication* getAuthenticationCallback() const { return mpAuthentication; } + +private: + apr_pool_t* mpSubPool; + SvnOperationStatus* mpStatus; + SvnAuthentication* mpAuthentication; +}; + Modified: trunk/src/main.cpp =================================================================== --- trunk/src/main.cpp 2006-05-07 02:54:16 UTC (rev 7) +++ trunk/src/main.cpp 2006-07-31 16:19:11 UTC (rev 8) @@ -19,9 +19,62 @@ ***************************************************************************/ #include "grandmas_svn.h" +#include <svn/modification.h> +#include <svn/server_access.h> +#include <apr_general.h> + + +class QSvnOperationStatus : public SvnOperationStatus +{ +public: + virtual void update(QString textToAdd) + { + textToAdd = textToAdd; + } + + virtual bool shouldCancel() + { + return false; + } +}; + +class QSvnAuthentication : public SvnAuthentication +{ +public: + virtual bool getAuthentication(QString& rUsername, QString& rPassword) + { + rUsername = ""; + rPassword = ""; + return false; + } +}; + int main(int argc, char** argv) { +// BEGIN TEST CODE + apr_status_t rv = apr_initialize(); + if (rv != APR_SUCCESS) + return -1; + + apr_pool_t* pool; + apr_pool_create(&pool, NULL); + + QSvnOperationStatus status; + QSvnAuthentication auth; + SvnOperationContext context(pool, status, auth);; + + QString error; + Revision revision; + revision.setCommittedRevision(5); + + Modifications mods; + mods.init(context, "/home/joshn/projects/gsvn", revision, error); + + apr_pool_destroy(pool); + +// END TEST CODE + GrandmasSVNApp app(argc, argv); return app.exec(); } Modified: trunk/src/svn/modification.cpp =================================================================== --- trunk/src/svn/modification.cpp 2006-05-07 02:54:16 UTC (rev 7) +++ trunk/src/svn/modification.cpp 2006-07-31 16:19:11 UTC (rev 8) @@ -19,16 +19,256 @@ ***************************************************************************/ #include <svn/modification.h> +#include <svn/server_access.h> -ModificationSummary::Type ModificationSummary::getType() +#include <apr_pools.h> +#include <assert.h> +#include <iostream> +#include <svn_client.h> +#include <svn_path.h> +#include <svn_pools.h> + +using namespace std; + +svn_error_t* simpleAuthPrompt(svn_auth_cred_simple_t **cred, void *baton, const char */*realm*/, const char *username, svn_boolean_t /*_may_save*/, apr_pool_t *pool) { + QString promptUsername = username; + QString promptPassword; + SvnAuthentication* pAuth = ((SvnAuthentication*)baton); + if (!pAuth->getAuthentication(promptUsername)) + return svn_error_create(SVN_ERR_CANCELLED, NULL, ""); + + svn_auth_cred_simple_t* lcred = (svn_auth_cred_simple_t*)apr_palloc(pool, sizeof (svn_auth_cred_simple_t)); + lcred->username = pAuth->getUsername(); + lcred->password = pAuth->getPassword(); + + // tell svn if the credentials need to be saved + lcred->may_save = true; + *cred = lcred; + + return SVN_NO_ERROR; + } + + +bool SvnOperation::initAuthProviders(svn_client_ctx_t* context, SvnOperationContext& rContext, QString& /*rError*/) +{ + apr_array_header_t *providers = apr_array_make(rContext.getAprPool(), 3, sizeof(svn_auth_provider_object_t *)); + + svn_auth_provider_object_t *provider; + + svn_client_get_simple_provider(&provider, rContext.getAprPool()); + APR_ARRAY_PUSH(providers,svn_auth_provider_object_t*) = provider; + + svn_client_get_username_provider(&provider, rContext.getAprPool()); + APR_ARRAY_PUSH(providers,svn_auth_provider_object_t*) = provider; + + svn_client_get_simple_prompt_provider(&provider, simpleAuthPrompt, rContext.getAuthenticationCallback(), 100000000, rContext.getAprPool()); + APR_ARRAY_PUSH(providers,svn_auth_provider_object_t*) = provider; + + // TODO: add ssl providers + + svn_auth_baton_t *authBaton; + svn_auth_open(&authBaton, providers, rContext.getAprPool()); + + context->auth_baton = authBaton; + return true; } -QString ModificationSummary::getRelFilePath() +svn_opt_revision_t svnRevisionFromRevision(Revision rev) { + svn_opt_revision_t svnRev; + svnRev.kind = svn_opt_revision_number; + if (!rev.isCommittedRevision()) + svnRev.value.number = 0; + else + svnRev.value.number = rev.getCommittedRevision(); + return svnRev; } -bool ModificationSummary::isAddedWithHistory(QString& rSrcFilePath) +void statusCallback(void *baton, const char *path, svn_wc_status2_t *status) { + ((Modifications*)baton)->statusCallback(NULL, path, status); } +svn_error_t* logCallback(void *baton, apr_hash_t *changed_paths, svn_revnum_t revision, const char *author, const char *date, const char *message, apr_pool_t *pool) +{ + return ((Modifications*)baton)->logCallback(NULL, changed_paths, revision, author, date, message, pool); +} + +svn_error_t* cancelFunc(void */*baton*/) +{ + cout << "cancel" << endl; + return NULL; +} + +void setUpAuthProviders() +{ +} + +bool Modifications::init(SvnOperationContext& rServer, QString path, Revision revision, QString& rError) +{ + rError = ""; + mpContext = &rServer; + + svn_client_ctx_t* ctx; + svn_client_create_context(&ctx, rServer.getAprPool()); + if (!initAuthProviders(ctx, rServer, rError)) + return false; + + ctx->notify_func2 = NULL; + ctx->cancel_func = ::cancelFunc; + ctx->cancel_baton = NULL; + ctx->log_msg_func2 = NULL; + ctx->log_msg_func = NULL; + ctx->progress_func = NULL; + + svn_error_t* pError = NULL; + if (revision.isCommittedRevision()) + { + svn_opt_revision_t startRev = svnRevisionFromRevision(revision); + svn_opt_revision_t endRev = svnRevisionFromRevision(revision); + apr_array_header_t *array = apr_array_make(rServer.getAprPool(), 1, sizeof(const char*)); + APR_ARRAY_PUSH(array, const char*) = svn_path_canonicalize(path.toAscii(), rServer.getAprPool()); + + pError = svn_client_log2(array, + &startRev, + &endRev, + 0/*limit*/, + true/*discover_changed_paths*/, + false/*strict_node_history*/, + ::logCallback, + this, + ctx, + rServer.getAprPool()); + } + else + { + svn_opt_revision_t svnRevision = svnRevisionFromRevision(revision); + pError = svn_client_status2(NULL, path.toAscii(), &svnRevision, + ::statusCallback, + this, + true/*recurse*/, + false/*get_all*/, + false/*update*/, + false /*no_ignore*/, + true/*ignore_externals*/, + ctx/*svn_client_ctx_t *ctx*/, + rServer.getAprPool()); + } + if (pError) + { + rError = pError->message; + cout << (const char*)rError.toAscii() << endl; + return false; + } + return true; +} + +void Modifications::getModifications(QList<Modification>& rModifications) +{ + rModifications = mModifications; +} + +bool Modifications::uncommittedFileIsConflicted(Modification /*modification*/) +{ + return false; +} + +void Modifications::statusCallback(void */*baton*/, const char *path, svn_wc_status2_t *status) +{ + Modification mod; + mod.newRevision = mRevision; + + // Set old revision to base, if the file is already under version control + if (status->entry) + mod.oldRevision.setCommittedRevision(status->entry->revision); + + switch (status->text_status) + { + // cases we care about + case svn_wc_status_unversioned: + mod.mFilePath = path; + mod.mType = Modification::Type_New; + break; + case svn_wc_status_added: + mod.mFilePath = path; + mod.mType = Modification::Type_Add; + break; + + case svn_wc_status_missing: + mod.mFilePath = path; + mod.mType = Modification::Type_Missing; + break; + + case svn_wc_status_deleted: + mod.mFilePath = path; + mod.mType = Modification::Type_Delete; + break; + + case svn_wc_status_modified: + mod.mFilePath = path; + mod.mType = Modification::Type_TextMod; + break; + + case svn_wc_status_conflicted: + mod.mFilePath = path; + mod.mType = Modification::Type_Conflicting; + break; + + // cases we can ignore + case svn_wc_status_ignored: + case svn_wc_status_obstructed: + case svn_wc_status_merged: + case svn_wc_status_normal: + case svn_wc_status_none: + return; + + // cases we need to learn how to handle + case svn_wc_status_replaced: + case svn_wc_status_incomplete: + case svn_wc_status_external: + assert(false); + break; + + } + mModifications.append(mod); +} + +svn_error_t* Modifications::logCallback(void */*baton*/, apr_hash_t *changed_paths, svn_revnum_t revision, const char */*author*/, const char */*date*/, const char */*message*/, apr_pool_t *pool) +{ + for (apr_hash_index_t* pKey = apr_hash_first(pool, changed_paths); pKey; pKey = apr_hash_next(pKey)) + { + char *path; + void *val; + apr_hash_this(pKey, (const void **)&path, NULL, &val); + + Modification mod; + mod.mFilePath = path; + mod.newRevision.setCommittedRevision(revision); + mod.oldRevision.setCommittedRevision(revision-1); + svn_log_changed_path_t *log_item = reinterpret_cast<svn_log_changed_path_t *>(val); + switch (log_item->action) + { + case 'A': + mod.mType = Modification::Type_Add; + break; + case 'D': + mod.mType = Modification::Type_Delete; + break; + case 'R': + // TODO: handle "replace" + mod.mType = Modification::Type_Add; + break; + case 'M': + mod.mType = Modification::Type_TextMod; + break; + default: + // TODO: return error + break; + } + mModifications.append(mod); + } + + return NULL; +} + Modified: trunk/src/svn/revision.cpp =================================================================== --- trunk/src/svn/revision.cpp 2006-05-07 02:54:16 UTC (rev 7) +++ trunk/src/svn/revision.cpp 2006-07-31 16:19:11 UTC (rev 8) @@ -20,23 +20,42 @@ #include <svn/revision.h> -void Revision::SetHeadRevision() +Revision::Revision() { + mIsCommitted = false; + mCommittedRevision = -1; } -void Revision::SetBaseRevision() +Revision::~Revision() { } -void Revision::SetCommittedRevision(int revision) +void Revision::setUncommittedRevision() { + mIsCommitted = false; } -Revision::Type Revision::GetType() +void Revision::setCommittedRevision(int revision) { + mIsCommitted = true; + mCommittedRevision = revision; } -int Revision::GetCommittedRevision() +bool Revision::isCommittedRevision() { + return mIsCommitted; } +int Revision::getCommittedRevision() +{ +// assert(mIsCommitted); + return mCommittedRevision; +} + +svn_opt_revision_t Revision::getSvnRevision() +{ + svn_opt_revision_t svnRev; + svnRev.value.number = mCommittedRevision; + return svnRev; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-05-08 23:52:34
|
Revision: 7 Author: matthiasmiller Date: 2006-05-06 19:54:16 -0700 (Sat, 06 May 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=7&view=rev Log Message: ----------- branching dialog initialization for different platforms and improving UI for Windows and Mac Modified Paths: -------------- trunk/grandmas_svn.pro trunk/include/dialogs/commit.h trunk/include/dialogs/move.h trunk/include/dialogs/open.h trunk/src/dialogs/commit.cpp trunk/src/dialogs/mainwindow.cpp trunk/src/dialogs/move.cpp trunk/src/dialogs/open.cpp trunk/src/grandmas_svn.cpp trunk/ui/mainwindow.ui trunk/ui/open.ui Added Paths: ----------- trunk/include/dialogs/core/ trunk/include/dialogs/core/base.h trunk/src/dialogs/core/ trunk/src/dialogs/core/base.cpp Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/grandmas_svn.pro 2006-05-07 02:54:16 UTC (rev 7) @@ -110,9 +110,10 @@ TARGET = bin/grandmas-svn -OBJECTS_DIR = build/ +OBJECTS_DIR = build/obj MOC_DIR = build/moc UI_DIR = build/ui +RCC_DIR = build/rcc CONFIG += debug \ warn_on \ @@ -134,12 +135,14 @@ HEADERS += include/settings/userpaths.h \ include/dialogs/commit.h \ + include/dialogs/core/base.h \ include/dialogs/move.h \ include/dialogs/open.h \ include/dialogs/mainwindow.h \ src/grandmas_svn.h SOURCES += src/dialogs/commit.cpp \ + src/dialogs/core/base.cpp \ src/dialogs/mainwindow.cpp \ src/dialogs/move.cpp \ src/dialogs/open.cpp \ Modified: trunk/include/dialogs/commit.h =================================================================== --- trunk/include/dialogs/commit.h 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/include/dialogs/commit.h 2006-05-07 02:54:16 UTC (rev 7) @@ -22,16 +22,19 @@ #ifndef DIALOGS_COMMIT_H_ #define DIALOGS_COMMIT_H_ -#include <QDialog> +#include "dialogs/core/base.h" class Ui_CommitDialog; -class CommitDialog : public QDialog +class CommitDialog : public BaseDialog { public: - CommitDialog(); + CommitDialog(QWidget* pParent); ~CommitDialog(); +protected: + virtual void initMac(); + private: Ui_CommitDialog* mpUi; }; Added: trunk/include/dialogs/core/base.h =================================================================== --- trunk/include/dialogs/core/base.h (rev 0) +++ trunk/include/dialogs/core/base.h 2006-05-07 02:54:16 UTC (rev 7) @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef DIALOGS_CORE_BASE_H_ +#define DIALOGS_CORE_BASE_H_ + +#include <QDialog> + +class QBoxLayout; + +class BaseDialog : public QDialog +{ +public: + BaseDialog(QWidget* pParent=NULL); + +protected: + void init(); + + virtual void initX11(); + virtual void initMac(); + virtual void initWin(); + + void exchangeWidgets(QBoxLayout* pLayout, QWidget* pFirst, QWidget* pSecond); +}; + +#endif Modified: trunk/include/dialogs/move.h =================================================================== --- trunk/include/dialogs/move.h 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/include/dialogs/move.h 2006-05-07 02:54:16 UTC (rev 7) @@ -22,19 +22,22 @@ #ifndef DIALOGS_MOVE_H_ #define DIALOGS_MOVE_H_ -#include <QDialog> +#include "dialogs/core/base.h" class Ui_moveDialog; -class MoveDialog : public QDialog +class MoveDialog : public BaseDialog { Q_OBJECT public: - MoveDialog(); + MoveDialog(QWidget* pParent); ~MoveDialog(); private: + virtual void initMac(); + +private: Ui_moveDialog* mpUi; }; Modified: trunk/include/dialogs/open.h =================================================================== --- trunk/include/dialogs/open.h 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/include/dialogs/open.h 2006-05-07 02:54:16 UTC (rev 7) @@ -22,12 +22,13 @@ #ifndef DIALOGS_OPEN_H_ #define DIALOGS_OPEN_H_ -#include <QDialog> +#include "dialogs/core/base.h" class Ui_OpenDialog; class UserPathsModel; +class QKeyEvent; -class OpenDialog : public QDialog +class OpenDialog : public BaseDialog { Q_OBJECT @@ -43,6 +44,9 @@ private slots: void accept(); +protected: + virtual void initMac(); + private: Ui_OpenDialog* mpUi; UserPathsModel* mpPathsModel; Modified: trunk/src/dialogs/commit.cpp =================================================================== --- trunk/src/dialogs/commit.cpp 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/src/dialogs/commit.cpp 2006-05-07 02:54:16 UTC (rev 7) @@ -21,10 +21,12 @@ #include "dialogs/commit.h" #include "ui_commit.h" -CommitDialog::CommitDialog() +CommitDialog::CommitDialog(QWidget* pParent) : BaseDialog(pParent) { mpUi = new Ui_CommitDialog(); mpUi->setupUi(this); + + init(); } CommitDialog::~CommitDialog() @@ -32,3 +34,8 @@ delete mpUi; mpUi = NULL; } + +void CommitDialog::initMac() +{ + exchangeWidgets(mpUi->hboxLayout, mpUi->okButton, mpUi->cancelButton); +} Added: trunk/src/dialogs/core/base.cpp =================================================================== --- trunk/src/dialogs/core/base.cpp (rev 0) +++ trunk/src/dialogs/core/base.cpp 2006-05-07 02:54:16 UTC (rev 7) @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "dialogs/core/base.h" + +#include <QBoxLayout> +#include <QPushButton> + +BaseDialog::BaseDialog(QWidget* pParent) : QDialog(pParent) +{ +} + +void BaseDialog::init() +{ +#if defined(Q_WS_X11) + initX11(); +#elif defined(Q_WS_MAC) + initMac(); +#elif defined(Q_WS_WIN) + initWin(); +#endif +} + +void BaseDialog::initX11() +{ +} + +void BaseDialog::initMac() +{ +} + +void BaseDialog::initWin() +{ +} + +void BaseDialog::exchangeWidgets(QBoxLayout* pLayout, QWidget* pFirstWidget, QWidget* pSecondWidget) +{ + // If both widgets are in the same layout, it's important to move them in the correct order. + int firstIndex = pLayout->indexOf(pFirstWidget); + int secondIndex = pLayout->indexOf(pSecondWidget); + Q_ASSERT(firstIndex != -1); + Q_ASSERT(secondIndex != -1); + Q_ASSERT(firstIndex < secondIndex); + + pLayout->removeWidget(pSecondWidget); + pLayout->insertWidget(firstIndex, pSecondWidget); + + pLayout->removeWidget(pFirstWidget); + pLayout->insertWidget(secondIndex, pFirstWidget); +} Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/src/dialogs/mainwindow.cpp 2006-05-07 02:54:16 UTC (rev 7) @@ -58,12 +58,12 @@ void MainWindow::commit() { - CommitDialog dlg; + CommitDialog dlg(this); dlg.exec(); } void MainWindow::move() { - MoveDialog dlg; + MoveDialog dlg(this); dlg.exec(); } Modified: trunk/src/dialogs/move.cpp =================================================================== --- trunk/src/dialogs/move.cpp 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/src/dialogs/move.cpp 2006-05-07 02:54:16 UTC (rev 7) @@ -21,10 +21,11 @@ #include "dialogs/move.h" #include "ui_move.h" -MoveDialog::MoveDialog() +MoveDialog::MoveDialog(QWidget* pParent) : BaseDialog(pParent) { mpUi = new Ui_moveDialog(); mpUi->setupUi(this); + init(); } MoveDialog::~MoveDialog() @@ -33,3 +34,7 @@ mpUi = NULL; } +void MoveDialog::initMac() +{ + exchangeWidgets(mpUi->hboxLayout2, mpUi->okButton, mpUi->cancelButton); +} Modified: trunk/src/dialogs/open.cpp =================================================================== --- trunk/src/dialogs/open.cpp 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/src/dialogs/open.cpp 2006-05-07 02:54:16 UTC (rev 7) @@ -29,6 +29,8 @@ mpUi = new Ui_OpenDialog(); mpUi->setupUi(this); mpUi->workingCopyListView->setModel(mpPathsModel); + + init(); } OpenDialog::~OpenDialog() @@ -55,3 +57,7 @@ } } +void OpenDialog::initMac() +{ + exchangeWidgets(mpUi->hboxLayout, mpUi->okButton, mpUi->cancelButton); +} Modified: trunk/src/grandmas_svn.cpp =================================================================== --- trunk/src/grandmas_svn.cpp 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/src/grandmas_svn.cpp 2006-05-07 02:54:16 UTC (rev 7) @@ -33,7 +33,7 @@ #ifdef Q_WS_MAC initMac(); #else - connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit()) ); + connect(this, SIGNAL(lastWindowClosed()), this, SLOT(quit())); #endif // Show OpenDialog on startup Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/ui/mainwindow.ui 2006-05-07 02:54:16 UTC (rev 7) @@ -118,6 +118,9 @@ <property name="text" > <string>Commit Log Entry:</string> </property> + <property name="buddy" > + <cstring>logEdit</cstring> + </property> </widget> </item> <item> @@ -141,6 +144,9 @@ <property name="text" > <string>Changes:</string> </property> + <property name="buddy" > + <cstring>changesTableView</cstring> + </property> </widget> </item> <item> @@ -266,6 +272,9 @@ <property name="text" > <string>Recent Activity:</string> </property> + <property name="buddy" > + <cstring>revisionsTableView</cstring> + </property> </widget> </item> <item> Modified: trunk/ui/open.ui =================================================================== --- trunk/ui/open.ui 2006-05-04 04:22:39 UTC (rev 6) +++ trunk/ui/open.ui 2006-05-07 02:54:16 UTC (rev 7) @@ -28,8 +28,11 @@ <item> <widget class="QLabel" name="workingCopylabel" > <property name="text" > - <string>Working Copy:</string> + <string>&Working Copy:</string> </property> + <property name="buddy" > + <cstring>workingCopyListView</cstring> + </property> </widget> </item> <item> @@ -133,7 +136,7 @@ </connection> <connection> <sender>workingCopyListView</sender> - <signal>doubleClicked(QModelIndex)</signal> + <signal>activated(QModelIndex)</signal> <receiver>OpenDialog</receiver> <slot>accept()</slot> <hints> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-05-04 04:22:48
|
Revision: 6 Author: matthiasmiller Date: 2006-05-03 21:22:39 -0700 (Wed, 03 May 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=6&view=rev Log Message: ----------- creating icon file for Windows (does not include 16-bit version) Modified Paths: -------------- trunk/grandmas_svn.pro Added Paths: ----------- trunk/ui/icons/win32.ico trunk/ui/icons/win32.rc Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-05-03 03:43:52 UTC (rev 5) +++ trunk/grandmas_svn.pro 2006-05-04 04:22:39 UTC (rev 6) @@ -130,6 +130,7 @@ ICON = ui/icons/mac.icns RESOURCES = ui/grandmas-svn.qrc +RC_FILE = ui/icons/win32.rc HEADERS += include/settings/userpaths.h \ include/dialogs/commit.h \ Added: trunk/ui/icons/win32.ico =================================================================== (Binary files differ) Property changes on: trunk/ui/icons/win32.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/ui/icons/win32.rc =================================================================== --- trunk/ui/icons/win32.rc (rev 0) +++ trunk/ui/icons/win32.rc 2006-05-04 04:22:39 UTC (rev 6) @@ -0,0 +1 @@ + IDI_WIN32_LOGO_ICON ICON DISCARDABLE "win32.ico" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-05-03 03:44:07
|
Revision: 5 Author: matthiasmiller Date: 2006-05-02 20:43:52 -0700 (Tue, 02 May 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=5&view=rev Log Message: ----------- setting window icons Modified Paths: -------------- trunk/grandmas_svn.pro trunk/ui/commit.ui trunk/ui/mainwindow.ui trunk/ui/move.ui trunk/ui/open.ui Added Paths: ----------- trunk/ui/grandmas-svn.qrc Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-05-03 02:51:43 UTC (rev 4) +++ trunk/grandmas_svn.pro 2006-05-03 03:43:52 UTC (rev 5) @@ -129,6 +129,7 @@ ui/open.ui ICON = ui/icons/mac.icns +RESOURCES = ui/grandmas-svn.qrc HEADERS += include/settings/userpaths.h \ include/dialogs/commit.h \ Modified: trunk/ui/commit.ui =================================================================== --- trunk/ui/commit.ui 2006-05-03 02:51:43 UTC (rev 4) +++ trunk/ui/commit.ui 2006-05-03 03:43:52 UTC (rev 5) @@ -15,6 +15,9 @@ <property name="windowTitle" > <string>Commit</string> </property> + <property name="windowIcon" > + <iconset resource="grandmas-svn.qrc" >:/logo/logo-32x32.png</iconset> + </property> <layout class="QVBoxLayout" > <property name="margin" > <number>9</number> @@ -112,7 +115,9 @@ <tabstop>okButton</tabstop> <tabstop>cancelButton</tabstop> </tabstops> - <resources/> + <resources> + <include location="grandmas-svn.qrc" /> + </resources> <connections> <connection> <sender>okButton</sender> Added: trunk/ui/grandmas-svn.qrc =================================================================== --- trunk/ui/grandmas-svn.qrc (rev 0) +++ trunk/ui/grandmas-svn.qrc 2006-05-03 03:43:52 UTC (rev 5) @@ -0,0 +1,6 @@ +<RCC> + <qresource prefix="/" > + <file>logo/logo-16x16.png</file> + <file>logo/logo-32x32.png</file> + </qresource> +</RCC> Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-05-03 02:51:43 UTC (rev 4) +++ trunk/ui/mainwindow.ui 2006-05-03 03:43:52 UTC (rev 5) @@ -15,6 +15,9 @@ <property name="windowTitle" > <string>Grandma's SVN</string> </property> + <property name="windowIcon" > + <iconset resource="grandmas-svn.qrc" >:/logo/logo-32x32.png</iconset> + </property> <widget class="QWidget" name="centralwidget" > <layout class="QVBoxLayout" > <property name="margin" > @@ -325,6 +328,8 @@ <tabstop>updateButton</tabstop> <tabstop>commitButton</tabstop> </tabstops> - <resources/> + <resources> + <include location="grandmas-svn.qrc" /> + </resources> <connections/> </ui> Modified: trunk/ui/move.ui =================================================================== --- trunk/ui/move.ui 2006-05-03 02:51:43 UTC (rev 4) +++ trunk/ui/move.ui 2006-05-03 03:43:52 UTC (rev 5) @@ -15,6 +15,9 @@ <property name="windowTitle" > <string>Move or Rename</string> </property> + <property name="windowIcon" > + <iconset resource="grandmas-svn.qrc" >:/logo/logo-32x32.png</iconset> + </property> <layout class="QVBoxLayout" > <property name="margin" > <number>9</number> @@ -257,7 +260,9 @@ <tabstop>okButton</tabstop> <tabstop>cancelButton</tabstop> </tabstops> - <resources/> + <resources> + <include location="grandmas-svn.qrc" /> + </resources> <connections> <connection> <sender>okButton</sender> Modified: trunk/ui/open.ui =================================================================== --- trunk/ui/open.ui 2006-05-03 02:51:43 UTC (rev 4) +++ trunk/ui/open.ui 2006-05-03 03:43:52 UTC (rev 5) @@ -15,6 +15,9 @@ <property name="windowTitle" > <string>Open Working Copy</string> </property> + <property name="windowIcon" > + <iconset resource="grandmas-svn.qrc" >:/logo/logo-32x32.png</iconset> + </property> <layout class="QVBoxLayout" > <property name="margin" > <number>9</number> @@ -92,7 +95,9 @@ <tabstop>cancelButton</tabstop> <tabstop>otherButton</tabstop> </tabstops> - <resources/> + <resources> + <include location="grandmas-svn.qrc" /> + </resources> <connections> <connection> <sender>okButton</sender> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-05-03 02:51:47
|
Revision: 4 Author: matthiasmiller Date: 2006-05-02 19:51:43 -0700 (Tue, 02 May 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=4&view=rev Log Message: ----------- create mac icons Modified Paths: -------------- trunk/grandmas_svn.pro Added Paths: ----------- trunk/ui/icons/ trunk/ui/icons/mac.icns Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-05-03 02:38:50 UTC (rev 3) +++ trunk/grandmas_svn.pro 2006-05-03 02:51:43 UTC (rev 4) @@ -128,6 +128,8 @@ ui/move.ui \ ui/open.ui +ICON = ui/icons/mac.icns + HEADERS += include/settings/userpaths.h \ include/dialogs/commit.h \ include/dialogs/move.h \ Added: trunk/ui/icons/mac.icns =================================================================== (Binary files differ) Property changes on: trunk/ui/icons/mac.icns ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-05-03 02:39:06
|
Revision: 3 Author: matthiasmiller Date: 2006-05-02 19:38:50 -0700 (Tue, 02 May 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=3&view=rev Log Message: ----------- creating PNGs of the logo (16 and 32 from the small, 48 and bigger from the large) Added Paths: ----------- trunk/ui/logo/logo-128x128.png trunk/ui/logo/logo-16x16.png trunk/ui/logo/logo-256x256.png trunk/ui/logo/logo-32x32.png trunk/ui/logo/logo-48x48.png trunk/ui/logo/logo-64x64.png Added: trunk/ui/logo/logo-128x128.png =================================================================== (Binary files differ) Property changes on: trunk/ui/logo/logo-128x128.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/ui/logo/logo-16x16.png =================================================================== (Binary files differ) Property changes on: trunk/ui/logo/logo-16x16.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/ui/logo/logo-256x256.png =================================================================== (Binary files differ) Property changes on: trunk/ui/logo/logo-256x256.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/ui/logo/logo-32x32.png =================================================================== (Binary files differ) Property changes on: trunk/ui/logo/logo-32x32.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/ui/logo/logo-48x48.png =================================================================== (Binary files differ) Property changes on: trunk/ui/logo/logo-48x48.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/ui/logo/logo-64x64.png =================================================================== (Binary files differ) Property changes on: trunk/ui/logo/logo-64x64.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-05-03 02:31:09
|
Revision: 2 Author: matthiasmiller Date: 2006-05-02 19:30:59 -0700 (Tue, 02 May 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=2&view=rev Log Message: ----------- creating logos Added Paths: ----------- trunk/ui/logo/ trunk/ui/logo/logo-large.svg trunk/ui/logo/logo-small.svg Added: trunk/ui/logo/logo-large.svg =================================================================== --- trunk/ui/logo/logo-large.svg (rev 0) +++ trunk/ui/logo/logo-large.svg 2006-05-03 02:30:59 UTC (rev 2) @@ -0,0 +1,171 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="51.200000pt" + height="51.200000pt" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.42.2" + sodipodi:docname="logo-large.svg" + sodipodi:docbase=""> + <metadata + id="metadata1469" /> + <sodipodi:namedview + inkscape:window-height="509" + inkscape:window-width="690" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base" + inkscape:zoom="5.3750000" + inkscape:cx="32.000000" + inkscape:cy="32.000000" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:current-layer="svg2" /> + <defs + id="defs4"> + <linearGradient + id="linearGradient9014" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-0.512979,0.000000,0.000000,-0.713085,-10.32679,-10.35792)" + x1="-134.04611" + y1="-42.400291" + x2="-131.65134" + y2="-95.910194"> + <stop + id="stop18212" + style="stop-color:#ffffff;stop-opacity:0.86813188;" + offset="0.0055999998" /> + <stop + id="stop18211" + style="stop-color:#ffffff;stop-opacity:0.0054945056;" + offset="1.0000000" /> + </linearGradient> + <linearGradient + id="linearGradient9016" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.512979,0.000000,0.000000,0.705254,-10.13758,-9.585753)" + x1="58.847176" + y1="12.077335" + x2="64.445343" + y2="89.780243"> + <stop + id="stop11533" + style="stop-color:#ffffff;stop-opacity:1.0000000;" + offset="0.0055999998" /> + <stop + id="stop11536" + style="stop-color:#ffffff;stop-opacity:0.0054945056;" + offset="1.0000000" /> + </linearGradient> + <metadata + id="metadata6537"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:creator> + <cc:Agent> + <dc:title>Alexandre Moore</dc:title> + </cc:Agent> + </dc:creator> + <dc:rights> + <cc:Agent> + <dc:title>Alexandre Moore</dc:title> + </cc:Agent> + </dc:rights> + <dc:publisher> + <cc:Agent> + <dc:title>Alexandre Moore</dc:title> + </cc:Agent> + </dc:publisher> + <cc:license + rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" /> + <dc:title>SnowIsh Icons</dc:title> + </cc:Work> + <cc:License + rdf:about="http://creativecommons.org/licenses/GPL/2.0/"> + <cc:permits + rdf:resource="http://web.resource.org/cc/Reproduction" /> + <cc:permits + rdf:resource="http://web.resource.org/cc/Distribution" /> + <cc:requires + rdf:resource="http://web.resource.org/cc/Notice" /> + <cc:permits + rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> + <cc:requires + rdf:resource="http://web.resource.org/cc/ShareAlike" /> + <cc:requires + rdf:resource="http://web.resource.org/cc/SourceCode" /> + </cc:License> + </rdf:RDF> + </metadata> + </defs> + <g + id="g1384"> + <path + style="color:#000000;fill:#809cc9;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.11500000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:block" + d="M 2.6428084,2.5721626 L 61.466870,2.5721626 L 61.466870,61.162509 L 2.6428084,61.162509 L 2.6428084,2.5721626 z " + id="path10560" /> + <g + id="g9074" + transform="matrix(1.187448,0.000000,0.000000,1.402413,-7.649957,10.23555)"> + <path + id="path10764" + style="fill:#809cc9" + d="M 49.006622,8.0133106 L 16.618046,8.0133106 L 16.618046,31.645297 L 49.006922,31.645297 L 49.006922,8.0133106 L 49.006622,8.0133106 z " /> + <g + transform="matrix(0.299997,0.000000,0.000000,0.300043,10.17561,7.750773)" + id="g10766"> + <path + id="path10768" + style="fill:#ffffff" + d="M 130.37200,0.0000000 L 132.03400,6.5830000 C 116.74900,8.7990000 103.14800,11.411000 91.232000,14.420000 C 78.375000,17.667000 68.034000,20.966000 60.207000,24.316000 C 52.363000,27.600000 48.700000,30.268000 49.217000,32.316000 C 49.673000,34.123000 52.952000,34.942000 59.080000,34.769000 C 62.221000,34.711000 67.332000,34.370000 74.415000,33.741000 C 81.498000,33.115000 90.636000,32.205000 101.83000,31.015000 C 122.42900,28.871000 136.59200,27.938000 144.32100,28.215000 C 152.03200,28.425000 156.26500,29.999000 157.00900,32.940000 C 158.01600,36.928000 150.70500,42.271000 135.07800,48.966000 C 119.42100,55.599000 99.198000,62.042000 74.426000,68.298000 C 53.572000,73.563000 35.593000,77.327000 20.487000,79.589000 L 18.842000,73.079000 C 36.710000,70.524000 52.779000,67.446000 67.047000,63.843000 C 80.373000,60.479000 90.641000,57.214000 97.847000,54.044000 C 105.05200,50.875000 108.38000,48.204000 107.83000,46.025000 C 107.35300,44.139000 104.02500,43.176000 97.857000,43.134000 C 94.698000,43.168000 90.347000,43.391000 84.795000,43.802000 C 79.229000,44.216000 72.316000,44.858000 64.056000,45.725000 C 51.242000,47.100000 40.594000,48.140000 32.126000,48.846000 C 23.646000,49.555000 17.325000,49.897000 13.150000,49.876000 C 5.1400000,49.802000 0.76000000,48.256000 0.0000000,45.248000 C -1.0240000,41.187000 5.7400000,36.053000 20.295000,29.845000 C 35.002000,23.577000 54.925000,17.269000 80.090000,10.915000 C 97.494000,6.5210000 114.25400,2.8830000 130.37200,0.0000000 z " /> + </g> + <g + transform="matrix(0.299997,0.000000,0.000000,0.300043,10.17561,7.750773)" + id="g10770"> + <path + id="path10772" + style="fill:#ffffff" + d="M 26.125000,56.078000 C 26.404000,56.078000 26.646000,56.183000 26.853000,56.394000 C 27.058000,56.599000 27.162000,56.845000 27.162000,57.130000 C 27.162000,57.427000 27.058000,57.678000 26.853000,57.884000 C 26.647000,58.089000 26.399000,58.192000 26.108000,58.192000 C 25.811000,58.192000 25.560000,58.089000 25.355000,57.883000 C 25.149000,57.672000 25.046000,57.421000 25.046000,57.130000 C 25.046000,56.833000 25.149000,56.585000 25.355000,56.385000 C 25.565000,56.181000 25.822000,56.078000 26.125000,56.078000 z M 26.125000,62.881000 C 26.404000,62.881000 26.646000,62.988000 26.853000,63.199000 C 27.058000,63.406000 27.162000,63.655000 27.162000,63.947000 C 27.162000,64.239000 27.058000,64.488000 26.853000,64.695000 C 26.636000,64.896000 26.388000,64.996000 26.108000,64.996000 C 25.960000,64.996000 25.821000,64.969000 25.693000,64.914000 C 25.565000,64.860000 25.452000,64.786000 25.355000,64.691000 C 25.257000,64.596000 25.182000,64.485000 25.127000,64.355000 C 25.072000,64.226000 25.046000,64.087000 25.046000,63.938000 C 25.046000,63.646000 25.149000,63.396000 25.355000,63.190000 C 25.565000,62.984000 25.822000,62.881000 26.125000,62.881000 z " /> + <path + id="path10774" + style="fill:#ffffff" + d="M 29.779000,56.078000 C 30.059000,56.078000 30.301000,56.183000 30.507000,56.394000 C 30.713000,56.599000 30.816000,56.845000 30.816000,57.130000 C 30.816000,57.427000 30.713000,57.678000 30.507000,57.884000 C 30.302000,58.089000 30.054000,58.192000 29.763000,58.192000 C 29.466000,58.192000 29.214000,58.089000 29.009000,57.883000 C 28.803000,57.672000 28.700000,57.421000 28.700000,57.130000 C 28.700000,56.833000 28.803000,56.585000 29.009000,56.385000 C 29.220000,56.181000 29.477000,56.078000 29.779000,56.078000 z M 29.779000,62.881000 C 30.059000,62.881000 30.301000,62.988000 30.507000,63.199000 C 30.713000,63.406000 30.816000,63.655000 30.816000,63.947000 C 30.816000,64.239000 30.713000,64.488000 30.507000,64.695000 C 30.290000,64.896000 30.042000,64.996000 29.763000,64.996000 C 29.615000,64.996000 29.476000,64.969000 29.347000,64.914000 C 29.219000,64.860000 29.106000,64.786000 29.009000,64.691000 C 28.912000,64.596000 28.836000,64.485000 28.782000,64.355000 C 28.727000,64.226000 28.700000,64.087000 28.700000,63.938000 C 28.700000,63.646000 28.803000,63.396000 29.009000,63.190000 C 29.220000,62.984000 29.477000,62.881000 29.779000,62.881000 z " /> + </g> + </g> + <path + style="opacity:0.82727271;fill:url(#linearGradient9014);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:4.0000000;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" + d="M 61.649017,61.935857 L 61.488301,19.975630 L 41.048558,61.499720 L 61.649017,61.935857 z " + id="path25207" /> + <path + style="opacity:0.85835695;fill:url(#linearGradient9016);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:4.0000000;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" + d="M 2.8193008,2.8953614 L 2.9800255,59.935857 L 25.649929,59.833596 L 40.205206,2.8165906 L 2.8193008,2.8953614 z " + id="path25205" /> + <text + sodipodi:linespacing="125.00000%" + transform="matrix(0.956305,-0.283617,0.292371,0.958981,0.000000,0.000000)" + id="text1420" + y="30.363831" + x="-5.1485696" + style="font-size:17.999977px;font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125.00000%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:URW Chancery L" + xml:space="preserve"><tspan + y="30.363831" + x="-5.1485696" + id="tspan1422" + sodipodi:role="line">Grandma's</tspan></text> + </g> +</svg> Property changes on: trunk/ui/logo/logo-large.svg ___________________________________________________________________ Name: svn:executable + * Added: trunk/ui/logo/logo-small.svg =================================================================== --- trunk/ui/logo/logo-small.svg (rev 0) +++ trunk/ui/logo/logo-small.svg 2006-05-03 02:30:59 UTC (rev 2) @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="51.200000pt" + height="51.200000pt" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.42.2" + sodipodi:docname="logo-small.svg" + sodipodi:docbase=""> + <metadata + id="metadata1469" /> + <sodipodi:namedview + inkscape:window-height="509" + inkscape:window-width="690" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base" + inkscape:zoom="5.3750000" + inkscape:cx="32.000000" + inkscape:cy="32.000000" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:current-layer="svg2" /> + <defs + id="defs4"> + <linearGradient + id="linearGradient9014" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-0.512979,0.000000,0.000000,-0.713085,-10.32679,-10.35792)" + x1="-134.04611" + y1="-42.400291" + x2="-131.65134" + y2="-95.910194"> + <stop + id="stop18212" + style="stop-color:#ffffff;stop-opacity:0.86813188;" + offset="0.0055999998" /> + <stop + id="stop18211" + style="stop-color:#ffffff;stop-opacity:0.0054945056;" + offset="1.0000000" /> + </linearGradient> + <linearGradient + id="linearGradient9016" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.512979,0.000000,0.000000,0.705254,-10.13758,-9.585753)" + x1="58.847176" + y1="12.077335" + x2="64.445343" + y2="89.780243"> + <stop + id="stop11533" + style="stop-color:#ffffff;stop-opacity:1.0000000;" + offset="0.0055999998" /> + <stop + id="stop11536" + style="stop-color:#ffffff;stop-opacity:0.0054945056;" + offset="1.0000000" /> + </linearGradient> + <metadata + id="metadata6537"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:creator> + <cc:Agent> + <dc:title>Alexandre Moore</dc:title> + </cc:Agent> + </dc:creator> + <dc:rights> + <cc:Agent> + <dc:title>Alexandre Moore</dc:title> + </cc:Agent> + </dc:rights> + <dc:publisher> + <cc:Agent> + <dc:title>Alexandre Moore</dc:title> + </cc:Agent> + </dc:publisher> + <cc:license + rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" /> + <dc:title>SnowIsh Icons</dc:title> + </cc:Work> + <cc:License + rdf:about="http://creativecommons.org/licenses/GPL/2.0/"> + <cc:permits + rdf:resource="http://web.resource.org/cc/Reproduction" /> + <cc:permits + rdf:resource="http://web.resource.org/cc/Distribution" /> + <cc:requires + rdf:resource="http://web.resource.org/cc/Notice" /> + <cc:permits + rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> + <cc:requires + rdf:resource="http://web.resource.org/cc/ShareAlike" /> + <cc:requires + rdf:resource="http://web.resource.org/cc/SourceCode" /> + </cc:License> + </rdf:RDF> + </metadata> + </defs> + <g + id="g1384"> + <path + style="color:#000000;fill:#809cc9;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.11500000;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:block" + d="M 2.6428084,2.5721626 L 61.466870,2.5721626 L 61.466870,61.162509 L 2.6428084,61.162509 L 2.6428084,2.5721626 z " + id="path10560" /> + <g + id="g9074" + transform="matrix(1.187448,0.000000,0.000000,1.402413,-7.649957,2.235547)"> + <path + id="path10764" + style="fill:#809cc9" + d="M 49.006622,8.0133106 L 16.618046,8.0133106 L 16.618046,31.645297 L 49.006922,31.645297 L 49.006922,8.0133106 L 49.006622,8.0133106 z " /> + <g + transform="matrix(0.299997,0.000000,0.000000,0.300043,10.17561,7.750773)" + id="g10766"> + <path + id="path10768" + style="fill:#ffffff" + d="M 130.37200,0.0000000 L 132.03400,6.5830000 C 116.74900,8.7990000 103.14800,11.411000 91.232000,14.420000 C 78.375000,17.667000 68.034000,20.966000 60.207000,24.316000 C 52.363000,27.600000 48.700000,30.268000 49.217000,32.316000 C 49.673000,34.123000 52.952000,34.942000 59.080000,34.769000 C 62.221000,34.711000 67.332000,34.370000 74.415000,33.741000 C 81.498000,33.115000 90.636000,32.205000 101.83000,31.015000 C 122.42900,28.871000 136.59200,27.938000 144.32100,28.215000 C 152.03200,28.425000 156.26500,29.999000 157.00900,32.940000 C 158.01600,36.928000 150.70500,42.271000 135.07800,48.966000 C 119.42100,55.599000 99.198000,62.042000 74.426000,68.298000 C 53.572000,73.563000 35.593000,77.327000 20.487000,79.589000 L 18.842000,73.079000 C 36.710000,70.524000 52.779000,67.446000 67.047000,63.843000 C 80.373000,60.479000 90.641000,57.214000 97.847000,54.044000 C 105.05200,50.875000 108.38000,48.204000 107.83000,46.025000 C 107.35300,44.139000 104.02500,43.176000 97.857000,43.134000 C 94.698000,43.168000 90.347000,43.391000 84.795000,43.802000 C 79.229000,44.216000 72.316000,44.858000 64.056000,45.725000 C 51.242000,47.100000 40.594000,48.140000 32.126000,48.846000 C 23.646000,49.555000 17.325000,49.897000 13.150000,49.876000 C 5.1400000,49.802000 0.76000000,48.256000 0.0000000,45.248000 C -1.0240000,41.187000 5.7400000,36.053000 20.295000,29.845000 C 35.002000,23.577000 54.925000,17.269000 80.090000,10.915000 C 97.494000,6.5210000 114.25400,2.8830000 130.37200,0.0000000 z " /> + </g> + <g + transform="matrix(0.299997,0.000000,0.000000,0.300043,10.17561,7.750773)" + id="g10770"> + <path + id="path10772" + style="fill:#ffffff" + d="M 26.125000,56.078000 C 26.404000,56.078000 26.646000,56.183000 26.853000,56.394000 C 27.058000,56.599000 27.162000,56.845000 27.162000,57.130000 C 27.162000,57.427000 27.058000,57.678000 26.853000,57.884000 C 26.647000,58.089000 26.399000,58.192000 26.108000,58.192000 C 25.811000,58.192000 25.560000,58.089000 25.355000,57.883000 C 25.149000,57.672000 25.046000,57.421000 25.046000,57.130000 C 25.046000,56.833000 25.149000,56.585000 25.355000,56.385000 C 25.565000,56.181000 25.822000,56.078000 26.125000,56.078000 z M 26.125000,62.881000 C 26.404000,62.881000 26.646000,62.988000 26.853000,63.199000 C 27.058000,63.406000 27.162000,63.655000 27.162000,63.947000 C 27.162000,64.239000 27.058000,64.488000 26.853000,64.695000 C 26.636000,64.896000 26.388000,64.996000 26.108000,64.996000 C 25.960000,64.996000 25.821000,64.969000 25.693000,64.914000 C 25.565000,64.860000 25.452000,64.786000 25.355000,64.691000 C 25.257000,64.596000 25.182000,64.485000 25.127000,64.355000 C 25.072000,64.226000 25.046000,64.087000 25.046000,63.938000 C 25.046000,63.646000 25.149000,63.396000 25.355000,63.190000 C 25.565000,62.984000 25.822000,62.881000 26.125000,62.881000 z " /> + <path + id="path10774" + style="fill:#ffffff" + d="M 29.779000,56.078000 C 30.059000,56.078000 30.301000,56.183000 30.507000,56.394000 C 30.713000,56.599000 30.816000,56.845000 30.816000,57.130000 C 30.816000,57.427000 30.713000,57.678000 30.507000,57.884000 C 30.302000,58.089000 30.054000,58.192000 29.763000,58.192000 C 29.466000,58.192000 29.214000,58.089000 29.009000,57.883000 C 28.803000,57.672000 28.700000,57.421000 28.700000,57.130000 C 28.700000,56.833000 28.803000,56.585000 29.009000,56.385000 C 29.220000,56.181000 29.477000,56.078000 29.779000,56.078000 z M 29.779000,62.881000 C 30.059000,62.881000 30.301000,62.988000 30.507000,63.199000 C 30.713000,63.406000 30.816000,63.655000 30.816000,63.947000 C 30.816000,64.239000 30.713000,64.488000 30.507000,64.695000 C 30.290000,64.896000 30.042000,64.996000 29.763000,64.996000 C 29.615000,64.996000 29.476000,64.969000 29.347000,64.914000 C 29.219000,64.860000 29.106000,64.786000 29.009000,64.691000 C 28.912000,64.596000 28.836000,64.485000 28.782000,64.355000 C 28.727000,64.226000 28.700000,64.087000 28.700000,63.938000 C 28.700000,63.646000 28.803000,63.396000 29.009000,63.190000 C 29.220000,62.984000 29.477000,62.881000 29.779000,62.881000 z " /> + </g> + </g> + <path + style="opacity:0.82727271;fill:url(#linearGradient9014);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:4.0000000;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" + d="M 61.649017,59.935857 L 61.488301,17.975630 L 41.048558,59.499720 L 61.649017,59.935857 z " + id="path25207" /> + <path + style="opacity:0.85835695;fill:url(#linearGradient9016);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:4.0000000;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000" + d="M 2.8193008,2.8953614 L 2.9800255,59.935857 L 25.649929,59.833596 L 40.205206,2.8165906 L 2.8193008,2.8953614 z " + id="path25205" /> + </g> +</svg> Property changes on: trunk/ui/logo/logo-small.svg ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-05-03 01:29:16
|
Revision: 1 Author: matthiasmiller Date: 2006-05-02 18:28:40 -0700 (Tue, 02 May 2006) ViewCVS: http://svn.sourceforge.net/grandmas-svn/?rev=1&view=rev Log Message: ----------- initial import Added Paths: ----------- trunk/ trunk/COPYING trunk/Doxyfile trunk/grandmas_svn.kdevelop trunk/grandmas_svn.pro trunk/include/ trunk/include/dialogs/ trunk/include/dialogs/commit.h trunk/include/dialogs/mainwindow.h trunk/include/dialogs/move.h trunk/include/dialogs/open.h trunk/include/settings/ trunk/include/settings/userpaths.h trunk/include/svn/ trunk/include/svn/commit_summary.h trunk/include/svn/file_access.h trunk/include/svn/modification.h trunk/include/svn/revision.h trunk/include/svn/server_access.h trunk/src/ trunk/src/dialogs/ trunk/src/dialogs/commit.cpp trunk/src/dialogs/mainwindow.cpp trunk/src/dialogs/move.cpp trunk/src/dialogs/open.cpp trunk/src/grandmas_svn.cpp trunk/src/grandmas_svn.h trunk/src/main.cpp trunk/src/settings/ trunk/src/settings/userpaths.cpp trunk/src/svn/ trunk/src/svn/modification.cpp trunk/src/svn/revision.cpp trunk/templates/ trunk/templates/cpp trunk/templates/h trunk/ui/ trunk/ui/commit.ui trunk/ui/mainwindow.ui trunk/ui/move.ui trunk/ui/open.ui Property changes on: trunk ___________________________________________________________________ Name: svn:ignore + *.pcs *.kdevses Makefile Makefile.Debug Makefile.Release bin build debug release object_script.grandmas-svn.Debug object_script.grandmas-svn.Release Added: trunk/COPYING =================================================================== --- trunk/COPYING (rev 0) +++ trunk/COPYING 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Added: trunk/Doxyfile =================================================================== --- trunk/Doxyfile (rev 0) +++ trunk/Doxyfile 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,275 @@ +# Doxyfile 1.4.1-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = grandmas_svn.kdevelop +PROJECT_NUMBER = 0.1 +OUTPUT_DIRECTORY = +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = yes +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = yes +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = grandmas_svn.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO Added: trunk/grandmas_svn.kdevelop =================================================================== --- trunk/grandmas_svn.kdevelop (rev 0) +++ trunk/grandmas_svn.kdevelop 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,137 @@ +<?xml version = '1.0'?> +<kdevelop> + <general> + <author>Matthias Miller</author> + <email>ad...@gr...</email> + <version>0.1</version> + <projectmanagement>KDevTrollProject</projectmanagement> + <primarylanguage>C++</primarylanguage> + <keywords> + <keyword>Qt</keyword> + </keywords> + <ignoreparts/> + </general> + <kdevfileview> + <groups> + <group pattern="*.cpp;*.cxx;*.h" name="Sources" /> + <group pattern="*.ui" name="User Interface" /> + <group pattern="*.png" name="Icons" /> + <group pattern="*" name="Others" /> + <hidenonprojectfiles>false</hidenonprojectfiles> + <hidenonlocation>false</hidenonlocation> + </groups> + <tree> + <hidenonprojectfiles>false</hidenonprojectfiles> + <hidepatterns>*.o,*.lo,CVS</hidepatterns> + </tree> + </kdevfileview> + <kdevdoctreeview> + <ignoretocs> + <toc>bash</toc> + <toc>bash_bugs</toc> + <toc>clanlib</toc> + <toc>fortran_bugs_gcc</toc> + <toc>gnome1</toc> + <toc>gnustep</toc> + <toc>gtk</toc> + <toc>gtk_bugs</toc> + <toc>haskell</toc> + <toc>haskell_bugs_ghc</toc> + <toc>java_bugs_gcc</toc> + <toc>java_bugs_sun</toc> + <toc>kde2book</toc> + <toc>opengl</toc> + <toc>pascal_bugs_fp</toc> + <toc>php</toc> + <toc>php_bugs</toc> + <toc>perl</toc> + <toc>perl_bugs</toc> + <toc>python</toc> + <toc>python_bugs</toc> + <toc>qt-kdev3</toc> + <toc>ruby</toc> + <toc>ruby_bugs</toc> + <toc>sdl</toc> + <toc>stl</toc> + <toc>sw</toc> + <toc>w3c-dom-level2-html</toc> + <toc>w3c-svg</toc> + <toc>w3c-uaag10</toc> + <toc>wxwidgets_bugs</toc> + </ignoretocs> + <ignoredoxygen> + <toc>KDE Libraries (Doxygen)</toc> + </ignoredoxygen> + </kdevdoctreeview> + <kdevdebugger> + <general> + <dbgshell/> + <breakpoints/> + <programargs/> + <gdbpath>/usr/bin/</gdbpath> + <breakonloadinglibs>true</breakonloadinglibs> + <separatetty>false</separatetty> + <floatingtoolbar>false</floatingtoolbar> + </general> + <display> + <staticmembers>false</staticmembers> + <demanglenames>true</demanglenames> + </display> + <breakpoints/> + </kdevdebugger> + <kdevtrollproject> + <run> + <mainprogram>./bin/grandmas_svn</mainprogram> + <programargs/> + <directoryradio>executable</directoryradio> + </run> + <general> + <activedir>src</activedir> + </general> + </kdevtrollproject> + <workspace> + <openfiles/> + </workspace> + <kdevfilecreate> + <useglobaltypes> + <type ext="ui" /> + <type ext="cpp" /> + <type ext="h" /> + <type ext="ts" /> + </useglobaltypes> + </kdevfilecreate> + <kdevdocumentation> + <projectdoc> + <docsystem>Doxygen Documentation Collection</docsystem> + <docurl>grandmas_svn.tag</docurl> + </projectdoc> + </kdevdocumentation> + <substmap> + <APPNAME>grandmas_svn</APPNAME> + <APPNAMELC>grandmas_svn</APPNAMELC> + <APPNAMESC>Grandmas_svn</APPNAMESC> + <APPNAMEUC>GRANDMAS_SVN</APPNAMEUC> + <AUTHOR>Matthias Miller</AUTHOR> + <EMAIL>ad...@gr...</EMAIL> + <LICENSE>GPL</LICENSE> + <LICENSEFILE>COPYING</LICENSEFILE> + <VERSION>0.1</VERSION> + <YEAR>2006</YEAR> + <dest></dest> + </substmap> + <kdevcppsupport> + <references/> + <codecompletion> + <includeGlobalFunctions>true</includeGlobalFunctions> + <includeTypes>true</includeTypes> + <includeEnums>true</includeEnums> + <includeTypedefs>false</includeTypedefs> + <automaticCodeCompletion>true</automaticCodeCompletion> + <automaticArgumentsHint>true</automaticArgumentsHint> + <automaticHeaderCompletion>true</automaticHeaderCompletion> + <codeCompletionDelay>250</codeCompletionDelay> + <argumentsHintDelay>400</argumentsHintDelay> + <headerCompletionDelay>250</headerCompletionDelay> + </codecompletion> + </kdevcppsupport> +</kdevelop> Added: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro (rev 0) +++ trunk/grandmas_svn.pro 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,145 @@ + +unix { + APR_CONFIG = apr-config + APU_CONFIG = apu-config + + # Mac OS X Subversion installer does not place apr-config into PATH + ALT_APACHE_DIR = /usr/local/apr/bin + + !system($$APR_CONFIG --version):exists($$ALT_APACHE_DIR/apr-config) { + APR_CONFIG = $$ALT_APACHE_DIR/apr-config + } + + !system($$APU_CONFIG --version):exists($$ALT_APACHE_DIR/apu-config) { + APU_CONFIG = $$ALT_APACHE_DIR/apu-config + } + + INCLUDEPATH += $$system($$APR_CONFIG --includedir) + INCLUDEPATH += $$system($$APU_CONFIG --includedir) + + LIBS += $$system($$APR_CONFIG --libs --link-ld) + LIBS += $$system($$APU_CONFIG --libs --link-ld) + + # Find the Subversion include path + SVN_INCLUDES = /usr/local/include /usr/include /sw/include + for(TEST_INCLUDE, SVN_INCLUDES):isEmpty(SVN_INCLUDE_DIR) { + exists($${TEST_INCLUDE}/subversion-1/svn_types.h) { + SVN_INCLUDE_DIR = $$TEST_INCLUDE + } + } + + isEmpty(SVN_INCLUDE_DIR) { + error(Please set SVN_INCLUDE_DIR to the directory containing the subversion-1 headers.) + } + + # Find the Subversion lib path + SVN_LIBS = /usr/local/lib /usr/lib /sw/lib + for(TEST_LIB, SVN_LIBS):isEmpty(SVN_LIB_DIR) { + ALL_TEST_LIBS = $$files($$TEST_LIB/*) + SVN_TEST_LIBS = $$find(ALL_TEST_LIBS, \/libsvn_client-1\..*) + !isEmpty(SVN_TEST_LIBS) { + SVN_LIB_DIR = $$TEST_LIB + } + } + + isEmpty(SVN_LIB_DIR) { + error(Please set SVN_LIB_DIR to the directory containing the subversion-1 libraries.) + } + + INCLUDEPATH += $$SVN_INCLUDE_DIR/subversion-1 + LIBS += -L$${SVN_LIB_DIR} + LIBS += -lsvn_client-1 +} + +win32 { + !exists($(SVN_DEV_DIR)) { + error("SVN_DEV_DIR must point to the Subversion development folder."); + } + SVN_INCLUDE_DIR = $$(SVN_DEV_DIR)\include + SVN_LIB_DIR = $$(SVN_DEV_DIR)\lib + + INCLUDEPATH += $${SVN_INCLUDE_DIR} + INCLUDEPATH += $${SVN_INCLUDE_DIR}\apr + INCLUDEPATH += $${SVN_INCLUDE_DIR}\apr-util + INCLUDEPATH += $${SVN_INCLUDE_DIR}\apr-iconv + + LIBS += $${SVN_LIB_DIR}\libsvn_client-1.lib + + APR_LIBS = apr #apr-iconv apr-util + for(APR_LIB, APR_LIBS) { + APR_LIB_DIR = $${SVN_LIB_DIR}$${DIR_SEPARATOR}$${APR_LIB} + APR_LIB_NAME = $$APR_LIB + APR_LIB_NAME ~= s/-//g + + !exists($${APR_LIB_DIR}$${DIR_SEPARATOR}lib$${APR_LIB_NAME}.a) { + # Get the library def file + !system(cd /D $$APR_LIB_DIR && reimp -d lib$${APR_LIB_NAME}.lib) { + error(Could not generate definition for $${APR_LIB_NAME}. Please make sure the reimp tool is installed.) + } + + # Retranslate the definition for MinGW + APR_DEF_MSVC = $${APR_LIB_DIR}$${DIR_SEPARATOR}lib$${APR_LIB_NAME}.def + APR_DEF_MINGW = $${APR_LIB_DIR}$${DIR_SEPARATOR}lib$${APR_LIB_NAME}-MinGW.def + + !system(copy $${APR_DEF_MSVC} $${APR_DEF_MINGW} > nul) { + error(Could not copy $${APR_LIB_NAME} library definition file.) + } + !system( \ + @FOR /F "tokens=*" %a in ($${APR_DEF_MSVC}) DO @( \ #for each line... + @FOR /F "tokens=1,* delims=_" %b IN ("%a") DO @( \ + @IF "%a"=="_%b_%c" @( \ #contains stdcall prefix (underscore)? + @FOR /F "tokens=1,* delims=@" %d IN ("%c") DO @( \ + @IF "%c"=="%d@%e" @( \ #contains ordinal? + @echo %b_%d = _%b_%d@%e >> $${APR_DEF_MINGW} \ #output: function = _function@ordinal + ) \ + ) \ + ) \ + ) \ + ) \ + ):error(Could not translate $${APR_LIB_NAME} library definition file) + + # Create MinGW library files + !system(cd /D $$APR_LIB_DIR && dlltool -d lib$${APR_LIB_NAME}-MinGW.def -l lib$${APR_LIB_NAME}.a) { + error(Could not generate MinGW library file for $${APR_LIB_NAME}) + } + } + + LIBS += -L$${APR_LIB_DIR} -l$${APR_LIB_NAME} + } +} + +TARGET = bin/grandmas-svn + +OBJECTS_DIR = build/ +MOC_DIR = build/moc +UI_DIR = build/ui + +CONFIG += debug \ + warn_on \ + qt \ + thread \ + moc +TEMPLATE = app + +INCLUDEPATH += include + +FORMS += ui/commit.ui \ + ui/mainwindow.ui \ + ui/move.ui \ + ui/open.ui + +HEADERS += include/settings/userpaths.h \ + include/dialogs/commit.h \ + include/dialogs/move.h \ + include/dialogs/open.h \ + include/dialogs/mainwindow.h \ + src/grandmas_svn.h + +SOURCES += src/dialogs/commit.cpp \ + src/dialogs/mainwindow.cpp \ + src/dialogs/move.cpp \ + src/dialogs/open.cpp \ + src/grandmas_svn.cpp \ + src/main.cpp \ + src/settings/userpaths.cpp + Added: trunk/include/dialogs/commit.h =================================================================== --- trunk/include/dialogs/commit.h (rev 0) +++ trunk/include/dialogs/commit.h 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifndef DIALOGS_COMMIT_H_ +#define DIALOGS_COMMIT_H_ + +#include <QDialog> + +class Ui_CommitDialog; + +class CommitDialog : public QDialog +{ +public: + CommitDialog(); + ~CommitDialog(); + +private: + Ui_CommitDialog* mpUi; +}; + +#endif Added: trunk/include/dialogs/mainwindow.h =================================================================== --- trunk/include/dialogs/mainwindow.h (rev 0) +++ trunk/include/dialogs/mainwindow.h 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef DIALOGS_MAINWINDOW_H +#define DIALOGS_MAINWINDOW_H + +#include <QMainWindow> + +class Ui_MainWindow; + +class MainWindow: public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + ~MainWindow(); + +private slots: + void commit(); + void move(); + +private: + Ui_MainWindow* mpUi; +}; + +#endif Added: trunk/include/dialogs/move.h =================================================================== --- trunk/include/dialogs/move.h (rev 0) +++ trunk/include/dialogs/move.h 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifndef DIALOGS_MOVE_H_ +#define DIALOGS_MOVE_H_ + +#include <QDialog> + +class Ui_moveDialog; + +class MoveDialog : public QDialog +{ + Q_OBJECT + +public: + MoveDialog(); + ~MoveDialog(); + +private: + Ui_moveDialog* mpUi; +}; + +#endif Added: trunk/include/dialogs/open.h =================================================================== --- trunk/include/dialogs/open.h (rev 0) +++ trunk/include/dialogs/open.h 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifndef DIALOGS_OPEN_H_ +#define DIALOGS_OPEN_H_ + +#include <QDialog> + +class Ui_OpenDialog; +class UserPathsModel; + +class OpenDialog : public QDialog +{ + Q_OBJECT + +public: + OpenDialog(); + ~OpenDialog(); + + bool load(QString& rError); + +signals: + void openPath(QString path); + +private slots: + void accept(); + +private: + Ui_OpenDialog* mpUi; + UserPathsModel* mpPathsModel; +}; + +#endif Added: trunk/include/settings/userpaths.h =================================================================== --- trunk/include/settings/userpaths.h (rev 0) +++ trunk/include/settings/userpaths.h 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,40 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <QAbstractItemModel> +#include <QStringList> + +class UserPathsModel : public QAbstractListModel +{ +public: + UserPathsModel(); + virtual ~UserPathsModel(); + + bool load(QString& rError); + + virtual int rowCount(const QModelIndex& rcParent = QModelIndex()) const; + virtual QVariant data(const QModelIndex& rcIndex, int role = Qt::DisplayRole) const; + + QString getPath(const QModelIndex& rcIndex) const; + +private: + QStringList mNames, mPaths; +}; + Added: trunk/include/svn/commit_summary.h =================================================================== --- trunk/include/svn/commit_summary.h (rev 0) +++ trunk/include/svn/commit_summary.h 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,36 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <svn/revision.h> +#include <svn/server_access.h> + +#include <Qt> +#include <QList> + +class CommitSummary +{ +public: + bool init(QString fullRepoPath, QString revision); + + bool getCommitAuthor(QString& rAuthor, QString& rError); + bool getCommitDate(QDateTime& rDate, QString& rError); + bool getCommitLogMessage(QString& rCommitLog, QString& rError); + bool getCommitModifications(QList<ModificationSummary>& rModifications, QString& rError); +}; Added: trunk/include/svn/file_access.h =================================================================== --- trunk/include/svn/file_access.h (rev 0) +++ trunk/include/svn/file_access.h 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,33 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <svn/revision.h> +#include <svn/server_access.h> + +#include <Qt> + +class RepoFileAccess +{ +public: + bool init(QString fullRepoPath, Revision oldRevision, Revision newRevision, QString& rError); + bool getOldFile(QString relFilePath, QString& rFilePath, ServerAccess& rAccess, QString& rError); + bool getNewFile(QString relFilePath, QString& rFilePath, ServerAccess& rAccess, QString& rError); + bool getDiff(QString relFilePath, QString& rDiff, ServerAccess& rAccess, QString& rError); +}; Added: trunk/include/svn/modification.h =================================================================== --- trunk/include/svn/modification.h (rev 0) +++ trunk/include/svn/modification.h 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <Qt> + +class ModificationSummary +{ +public: + enum Type + { + Type_Add, + Type_Delete, + Type_TextMod, + Type_PropertyMod + }; + + Type getType(); + QString getRelFilePath(); + + bool isAddedWithHistory(QString& rSrcFilePath); +}; Added: trunk/include/svn/revision.h =================================================================== --- trunk/include/svn/revision.h (rev 0) +++ trunk/include/svn/revision.h 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,40 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <Qt> + +class Revision +{ +public: + void SetHeadRevision(); + void SetBaseRevision(); + void SetCommittedRevision(int revision); + + enum Type + { + Type_Head, + Type_Base, + Type_Committed + }; + + Type GetType(); + int GetCommittedRevision(); +}; + Added: trunk/include/svn/server_access.h =================================================================== --- trunk/include/svn/server_access.h (rev 0) +++ trunk/include/svn/server_access.h 2006-05-03 01:28:40 UTC (rev 1) @@ -0,0 +1,28 @@ +/*************************************************************************** + * Copyright (C) 2006 by Matthias Miller * + * ad...@gr... * + * * + * 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. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program;... [truncated message content] |