grandmas-svn-commit Mailing List for Grandma's SVN (Page 5)
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: <mat...@us...> - 2006-10-27 15:35:39
|
Revision: 67 http://svn.sourceforge.net/grandmas-svn/?rev=67&view=rev Author: matthiasmiller Date: 2006-10-27 08:35:28 -0700 (Fri, 27 Oct 2006) Log Message: ----------- * start showing revisions in main window * fix bug in CommitSummary::fetchSummaries that sometimes prevented committed summaries from being loaded Modified Paths: -------------- trunk/include/dialogs/mainwindow.h trunk/include/dialogs/revisionsmodel.h trunk/src/dialogs/mainwindow.cpp trunk/src/dialogs/modificationsmodel.cpp trunk/src/dialogs/revisionsmodel.cpp trunk/src/svn/commit_summary.cpp Modified: trunk/include/dialogs/mainwindow.h =================================================================== --- trunk/include/dialogs/mainwindow.h 2006-10-27 15:09:48 UTC (rev 66) +++ trunk/include/dialogs/mainwindow.h 2006-10-27 15:35:28 UTC (rev 67) @@ -48,7 +48,8 @@ void move(); private: - void reload(); + void reloadCommitSummaries(); + void reloadModifications(); bool diffFiles(QString left, QString right); Ui_MainWindow* mpUi; Modified: trunk/include/dialogs/revisionsmodel.h =================================================================== --- trunk/include/dialogs/revisionsmodel.h 2006-10-27 15:09:48 UTC (rev 66) +++ trunk/include/dialogs/revisionsmodel.h 2006-10-27 15:35:28 UTC (rev 67) @@ -19,17 +19,24 @@ ***************************************************************************/ #include <QAbstractListModel> +class CommitSummary; + class RevisionsModel : public QAbstractListModel { public: RevisionsModel(); virtual ~RevisionsModel(); - + + void showError(QString error); + void showCommitSummaries(QList<CommitSummary> summaries); + virtual int columnCount(const QModelIndex &rcParent = QModelIndex()) const; virtual int rowCount(const QModelIndex& rcParent = QModelIndex()) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; virtual QVariant data(const QModelIndex& rcIndex, int role = Qt::DisplayRole) const; private: + QString mError; + QList<CommitSummary> mCommitSummaries; }; Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-27 15:09:48 UTC (rev 66) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-27 15:35:28 UTC (rev 67) @@ -114,7 +114,8 @@ setWindowTitle(tr("%1 - %2").arg(QDir::convertSeparators(path)).arg(windowTitle())); - reload(); + reloadCommitSummaries(); + reloadModifications(); } MainWindow::~MainWindow() @@ -143,7 +144,7 @@ { // Refresh the modifications if it doesn't require server access. if (mpModificationsModel && mDisplayedRevision.getType() == Revision::Uncommitted) - reload(); + reloadModifications(); } } @@ -197,13 +198,30 @@ dlg.exec(); } -void MainWindow::reload() +void MainWindow::reloadCommitSummaries() { + CommitSummaryFetcher fetcher; + QList<CommitSummary> summaries; + CommitSummary uncommittedSummary; + QString error; + if (!fetcher.fetchSummaries(*mpContext, mPath, Revision::base(), Revision::committed(0), false, summaries, error) || + !fetcher.fetchSummary(*mpContext, mPath, mDisplayedRevision, false, uncommittedSummary, error)) + { + mpRevisionsModel->showError(error); + return; + } + + summaries.push_front(uncommittedSummary); + mpRevisionsModel->showCommitSummaries(summaries); +} + +void MainWindow::reloadModifications() +{ CommitSummary summary; CommitSummaryFetcher fetcher; QString error; if (fetcher.fetchSummary(*mpContext, mPath, mDisplayedRevision, true, summary, error)) - mpModificationsModel->showModifications(summary.modifications(), false); + mpModificationsModel->showModifications(summary.modifications(), true); else mpModificationsModel->showError(error); } Modified: trunk/src/dialogs/modificationsmodel.cpp =================================================================== --- trunk/src/dialogs/modificationsmodel.cpp 2006-10-27 15:09:48 UTC (rev 66) +++ trunk/src/dialogs/modificationsmodel.cpp 2006-10-27 15:35:28 UTC (rev 67) @@ -83,7 +83,7 @@ Modification ModificationsModel::getModificationFromIndex(int row) const { - if (row < 0 || row >= mAllModifications.count()) + if (row < 0 || row >= mAllModifications.size()) { GSVN_ASSERT(false); return Modification(); Modified: trunk/src/dialogs/revisionsmodel.cpp =================================================================== --- trunk/src/dialogs/revisionsmodel.cpp 2006-10-27 15:09:48 UTC (rev 66) +++ trunk/src/dialogs/revisionsmodel.cpp 2006-10-27 15:35:28 UTC (rev 67) @@ -19,6 +19,9 @@ ***************************************************************************/ #include "dialogs/revisionsmodel.h" +#include "debug.h" +#include "svn/commit_summary.h" + RevisionsModel::RevisionsModel() { } @@ -27,26 +30,54 @@ { } +void RevisionsModel::showError(QString error) +{ + GSVN_ASSERT(!error.isNull()); + mError = error; + mCommitSummaries.clear(); +} + +void RevisionsModel::showCommitSummaries(QList<CommitSummary> summaries) +{ + mError = QString(); + mCommitSummaries = summaries; +} + int RevisionsModel::columnCount(const QModelIndex &rcParent) const { + Q_UNUSED(rcParent); + + if (!mError.isNull()) + return 1; + return 4; } int RevisionsModel::rowCount(const QModelIndex& rcParent) const { - return 0; + Q_UNUSED(rcParent); + + if (!mError.isNull()) + return 1; + + return mCommitSummaries.count(); } QVariant RevisionsModel::headerData(int section, Qt::Orientation orientation, int role) const { + Q_UNUSED(orientation); + if (role == Qt::DisplayRole) { + if (!mError.isNull()) + return QVariant(); + switch (section) { case 0: return tr("Revision"); case 1: return tr("Author"); case 2: return tr("Date"); - case 3: return tr("Message"); + case 3: return tr("Log Message"); default: return QVariant(); } } @@ -56,6 +87,44 @@ QVariant RevisionsModel::data(const QModelIndex& rcIndex, int role) const { - return QVariant(); + if (role == Qt::DisplayRole) + { + // display the error + if (!mError.isNull()) + return mError; + + if (!rcIndex.isValid() || rcIndex.row() >= mCommitSummaries.size()) + return QVariant(); + + CommitSummary summary = mCommitSummaries.at(rcIndex.row()); + switch (rcIndex.column()) + { + case 0: + { + Revision rev = summary.getRevision(); + switch (rev.getType()) + { + case Revision::Uncommitted: return tr("(uncommitted)"); + case Revision::Committed: return tr("r%1").arg(QString::number(rev.getCommittedRevision())) ; + case Revision::Base: return tr("(base)"); + case Revision::Head: return tr("(head)"); + default: + return QVariant(); + } + } + case 1: return summary.getCommitAuthor(); + case 2: return summary.getCommitDate(); + case 3: + { + QString logMessage = summary.getCommitLogMessage(); + logMessage = logMessage.replace('\r', ' '); + logMessage = logMessage.replace('\n', ' '); + return logMessage; + } + default: return QVariant(); + } + } + else + return QVariant(); } Modified: trunk/src/svn/commit_summary.cpp =================================================================== --- trunk/src/svn/commit_summary.cpp 2006-10-27 15:09:48 UTC (rev 66) +++ trunk/src/svn/commit_summary.cpp 2006-10-27 15:35:28 UTC (rev 67) @@ -40,7 +40,7 @@ svn_error_t* pError = NULL; if (startRevision.getType() != Revision::Uncommitted) { - if (!Operation::getRepoCheckoutUrl(rContext, ctx, fullRepoPath, mWcPath, rError)) + if (!Operation::getRepoCheckoutUrl(rContext, ctx, mWcPath, fullRepoPath, rError)) return false; svn_opt_revision_t startRev = startRevision.getSvnRevision(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hig...@us...> - 2006-10-27 15:09:55
|
Revision: 66 http://svn.sourceforge.net/grandmas-svn/?rev=66&view=rev Author: highjinx Date: 2006-10-27 08:09:48 -0700 (Fri, 27 Oct 2006) Log Message: ----------- Enable callers to chose whether to fetch modifications in CommitSummaryFetcher Modified Paths: -------------- trunk/include/svn/commit_summary.h trunk/src/dialogs/commit.cpp trunk/src/dialogs/mainwindow.cpp trunk/src/svn/commit_summary.cpp trunk/tests/svn_test.cpp Modified: trunk/include/svn/commit_summary.h =================================================================== --- trunk/include/svn/commit_summary.h 2006-10-27 15:01:19 UTC (rev 65) +++ trunk/include/svn/commit_summary.h 2006-10-27 15:09:48 UTC (rev 66) @@ -59,10 +59,10 @@ public: // Must be passed a working copy path (TODO: support full repo path) bool fetchSummaries(SvnOperationContext& rContext, QString fullRepoPath, - Revision startRevision, Revision endRevision, + Revision startRevision, Revision endRevision, bool fetchModifications, QList<CommitSummary>& rSummaries, QString& rError); - bool fetchSummary(SvnOperationContext& rContext, QString fullRepoPath, - Revision revision, CommitSummary& rSummary, QString& rError); + bool fetchSummary(SvnOperationContext& rContext, QString fullRepoPath, Revision revision, + bool fetchModifications, CommitSummary& rSummary, QString& rError); protected: QString mWcPath; Modified: trunk/src/dialogs/commit.cpp =================================================================== --- trunk/src/dialogs/commit.cpp 2006-10-27 15:01:19 UTC (rev 65) +++ trunk/src/dialogs/commit.cpp 2006-10-27 15:09:48 UTC (rev 66) @@ -76,7 +76,7 @@ CommitSummary summary; CommitSummaryFetcher fetcher; QString error; - if (fetcher.fetchSummary(*mpContext, mPath, Revision::uncommitted(), summary, error)) + if (fetcher.fetchSummary(*mpContext, mPath, Revision::uncommitted(), true, summary, error)) mpModificationsModel->showModifications(summary.modifications(), false); else mpModificationsModel->showError(error); Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-27 15:01:19 UTC (rev 65) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-27 15:09:48 UTC (rev 66) @@ -202,7 +202,7 @@ CommitSummary summary; CommitSummaryFetcher fetcher; QString error; - if (fetcher.fetchSummary(*mpContext, mPath, mDisplayedRevision, summary, error)) + if (fetcher.fetchSummary(*mpContext, mPath, mDisplayedRevision, true, summary, error)) mpModificationsModel->showModifications(summary.modifications(), false); else mpModificationsModel->showError(error); Modified: trunk/src/svn/commit_summary.cpp =================================================================== --- trunk/src/svn/commit_summary.cpp 2006-10-27 15:01:19 UTC (rev 65) +++ trunk/src/svn/commit_summary.cpp 2006-10-27 15:09:48 UTC (rev 66) @@ -25,7 +25,7 @@ #include <svn_path.h> bool CommitSummaryFetcher::fetchSummaries(SvnOperationContext& rContext, QString fullRepoPath, - Revision startRevision, Revision endRevision, + Revision startRevision, Revision endRevision, bool fetchModifications, QList<CommitSummary>& rSummaries, QString& rError) { mSummaries.clear(); @@ -52,7 +52,7 @@ &startRev, &endRev, 0/*limit*/, - true/*discover_changed_paths*/, + fetchModifications/*discover_changed_paths*/, false/*strict_node_history*/, logCallback, this, @@ -88,10 +88,10 @@ } bool CommitSummaryFetcher::fetchSummary(SvnOperationContext& rContext, QString fullRepoPath, - Revision revision, CommitSummary& rSummary, QString& rError) + Revision revision, bool fetchModifications, CommitSummary& rSummary, QString& rError) { QList<CommitSummary> summaries; - if (!fetchSummaries(rContext, fullRepoPath, revision, revision, summaries, rError)) + if (!fetchSummaries(rContext, fullRepoPath, revision, revision, fetchModifications, summaries, rError)) return false; GSVN_ASSERT(summaries.size() == 1); @@ -103,38 +103,41 @@ { CommitSummary summary; - for (apr_hash_index_t* pKey = apr_hash_first(pool, changed_paths); pKey; pKey = apr_hash_next(pKey)) + if (changed_paths) { - char *path; - void *val; - apr_hash_this(pKey, (const void **)&path, NULL, &val); - - Modification mod; - mod.mFilePath = path; - - mod.mNewRevision = Revision::committed(revision); - mod.mOldRevision = Revision::committed(revision-1); - svn_log_changed_path_t *log_item = reinterpret_cast<svn_log_changed_path_t *>(val); - switch (log_item->action) + for (apr_hash_index_t* pKey = apr_hash_first(pool, changed_paths); pKey; pKey = apr_hash_next(pKey)) { - 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; + char *path; + void *val; + apr_hash_this(pKey, (const void **)&path, NULL, &val); + + Modification mod; + mod.mFilePath = path; + + mod.mNewRevision = Revision::committed(revision); + mod.mOldRevision = Revision::committed(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; + } + summary.mModifications.append(mod); } - summary.mModifications.append(mod); } summary.mRevision = Revision::committed(revision); Modified: trunk/tests/svn_test.cpp =================================================================== --- trunk/tests/svn_test.cpp 2006-10-27 15:01:19 UTC (rev 65) +++ trunk/tests/svn_test.cpp 2006-10-27 15:09:48 UTC (rev 66) @@ -198,7 +198,7 @@ QString rError; Revision rev; rev = Revision::committed(1); - QVERIFY(fetcher.fetchSummary(*mpContext, getWcPath(), rev, summary, rError)); + QVERIFY(fetcher.fetchSummary(*mpContext, getWcPath(), rev, true, summary, rError)); const QList<Modification>& mods = summary.modifications(); @@ -208,7 +208,7 @@ QCOMPARE(summary.getRevision(), Revision::committed(1)); rev = Revision::uncommitted(); - QVERIFY(fetcher.fetchSummary(*mpContext, getWcPath(), rev, summary, rError)); + QVERIFY(fetcher.fetchSummary(*mpContext, getWcPath(), rev, true, summary, rError)); QCOMPARE(mods.size(), 1); QCOMPARE(mods[0].getFilePath(), QString("/second.txt")); @@ -251,7 +251,7 @@ CommitSummary summary; CommitSummaryFetcher fetcher; - QVERIFY(fetcher.fetchSummary(*mpContext, getWcPath(), rev, summary, rError)); + QVERIFY(fetcher.fetchSummary(*mpContext, getWcPath(), rev, false, summary, rError)); //QCOMPARE(summary.getCommitAuthor(), QString("billfrank")); //QCOMPARE(summary.getCommitDate(), bogus); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hig...@us...> - 2006-10-27 15:01:27
|
Revision: 65 http://svn.sourceforge.net/grandmas-svn/?rev=65&view=rev Author: highjinx Date: 2006-10-27 08:01:19 -0700 (Fri, 27 Oct 2006) Log Message: ----------- Adding ability to fetch multiple commit summaries Modified Paths: -------------- trunk/include/svn/commit_summary.h trunk/include/svn/modification.h trunk/include/svn/revision.h trunk/src/dialogs/commit.cpp trunk/src/dialogs/mainwindow.cpp trunk/src/svn/commit_summary.cpp trunk/src/svn/revision.cpp trunk/tests/svn_test.cpp Modified: trunk/include/svn/commit_summary.h =================================================================== --- trunk/include/svn/commit_summary.h 2006-10-27 14:59:41 UTC (rev 64) +++ trunk/include/svn/commit_summary.h 2006-10-27 15:01:19 UTC (rev 65) @@ -18,6 +18,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include "debug.h" + #include <svn/modification.h> #include <svn/revision.h> #include <svn/server_access.h> @@ -29,30 +31,42 @@ struct svn_error_t; struct apr_hash_t; struct svn_wc_status2_t; +class CommitSummaryFetcher; class CommitSummary { public: - // Must be passed a working copy path (TODO: support full repo path) - bool init(SvnOperationContext& rContext, QString fullRepoPath, Revision revision, QString& rError); - // These functions should only be called for committed revisions QString getCommitAuthor() const { return mAuthor; } QDateTime getCommitDate() const { return mDate; } QString getCommitLogMessage() const { return mLogMessage; } + Revision getRevision() const { return mRevision; } // This function may be called for working copy revision const QList<Modification>& modifications() const { return mModifications; } protected: + friend class CommitSummaryFetcher; QString mAuthor; QDateTime mDate; QString mLogMessage; QList<Modification> mModifications; Revision mRevision; +}; + +class CommitSummaryFetcher +{ +public: + // Must be passed a working copy path (TODO: support full repo path) + bool fetchSummaries(SvnOperationContext& rContext, QString fullRepoPath, + Revision startRevision, Revision endRevision, + QList<CommitSummary>& rSummaries, QString& rError); + bool fetchSummary(SvnOperationContext& rContext, QString fullRepoPath, + Revision revision, CommitSummary& rSummary, QString& rError); -private: +protected: QString mWcPath; + QList<CommitSummary> mSummaries; private: // Callbacks 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); Modified: trunk/include/svn/modification.h =================================================================== --- trunk/include/svn/modification.h 2006-10-27 14:59:41 UTC (rev 64) +++ trunk/include/svn/modification.h 2006-10-27 15:01:19 UTC (rev 65) @@ -26,7 +26,7 @@ #include <QString> class SvnOperationContext; -class CommitSummary; +class CommitSummaryFetcher; class Modification { @@ -80,7 +80,7 @@ Revision getNewRevision() const { return mNewRevision; } private: - friend class CommitSummary; + friend class CommitSummaryFetcher; Type mType; QString mFilePath; Modified: trunk/include/svn/revision.h =================================================================== --- trunk/include/svn/revision.h 2006-10-27 14:59:41 UTC (rev 64) +++ trunk/include/svn/revision.h 2006-10-27 15:01:19 UTC (rev 65) @@ -35,6 +35,7 @@ static Revision committed(int revision) { Revision rev; rev.mType = Committed; rev.mCommittedRevision = revision; return rev; } static Revision base() { Revision rev; rev.mType = Base; rev.mCommittedRevision = 0; return rev; } static Revision head() { Revision rev; rev.mType = Head; rev.mCommittedRevision = 0; return rev; } + static Revision fromSvn(svn_opt_revision_t revision); enum Type { Modified: trunk/src/dialogs/commit.cpp =================================================================== --- trunk/src/dialogs/commit.cpp 2006-10-27 14:59:41 UTC (rev 64) +++ trunk/src/dialogs/commit.cpp 2006-10-27 15:01:19 UTC (rev 65) @@ -74,8 +74,9 @@ void CommitDialog::reload() { CommitSummary summary; + CommitSummaryFetcher fetcher; QString error; - if (summary.init(*mpContext, mPath, Revision(), error)) + if (fetcher.fetchSummary(*mpContext, mPath, Revision::uncommitted(), summary, error)) mpModificationsModel->showModifications(summary.modifications(), false); else mpModificationsModel->showError(error); Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-27 14:59:41 UTC (rev 64) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-27 15:01:19 UTC (rev 65) @@ -200,9 +200,10 @@ void MainWindow::reload() { CommitSummary summary; + CommitSummaryFetcher fetcher; QString error; - if (summary.init(*mpContext, mPath, mDisplayedRevision, error)) - mpModificationsModel->showModifications(summary.modifications(), true); + if (fetcher.fetchSummary(*mpContext, mPath, mDisplayedRevision, summary, error)) + mpModificationsModel->showModifications(summary.modifications(), false); else mpModificationsModel->showError(error); } Modified: trunk/src/svn/commit_summary.cpp =================================================================== --- trunk/src/svn/commit_summary.cpp 2006-10-27 14:59:41 UTC (rev 64) +++ trunk/src/svn/commit_summary.cpp 2006-10-27 15:01:19 UTC (rev 65) @@ -24,11 +24,12 @@ #include <svn_client.h> #include <svn_path.h> -bool CommitSummary::init(SvnOperationContext& rContext, QString fullRepoPath, Revision revision, QString& rError) +bool CommitSummaryFetcher::fetchSummaries(SvnOperationContext& rContext, QString fullRepoPath, + Revision startRevision, Revision endRevision, + QList<CommitSummary>& rSummaries, QString& rError) { - mModifications.clear(); + mSummaries.clear(); rError = ""; - mRevision = revision; const char* fullCanonPath = svn_path_canonicalize(fullRepoPath.toAscii(), rContext.getAprPool()); svn_client_ctx_t* ctx; @@ -37,13 +38,13 @@ return false; svn_error_t* pError = NULL; - if (revision.getType() != Revision::Uncommitted) + if (startRevision.getType() != Revision::Uncommitted) { if (!Operation::getRepoCheckoutUrl(rContext, ctx, fullRepoPath, mWcPath, rError)) return false; - svn_opt_revision_t startRev = revision.getSvnRevision(); - svn_opt_revision_t endRev = revision.getSvnRevision(); + svn_opt_revision_t startRev = startRevision.getSvnRevision(); + svn_opt_revision_t endRev = endRevision.getSvnRevision(); apr_array_header_t *array = apr_array_make(rContext.getAprPool(), 1, sizeof(const char*)); APR_ARRAY_PUSH(array, const char*) = fullCanonPath; @@ -62,7 +63,7 @@ { mWcPath = fullRepoPath; - svn_opt_revision_t svnRevision = revision.getSvnRevision(); + svn_opt_revision_t svnRevision = startRevision.getSvnRevision(); pError = svn_client_status2(NULL, fullCanonPath, &svnRevision, statusCallback, this, @@ -79,12 +80,29 @@ rError = pError->message; return false; } + else + { + rSummaries = mSummaries; + } return true; } -svn_error_t* CommitSummary::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) +bool CommitSummaryFetcher::fetchSummary(SvnOperationContext& rContext, QString fullRepoPath, + Revision revision, CommitSummary& rSummary, QString& rError) { - CommitSummary* pThis = (CommitSummary*)baton; + QList<CommitSummary> summaries; + if (!fetchSummaries(rContext, fullRepoPath, revision, revision, summaries, rError)) + return false; + + GSVN_ASSERT(summaries.size() == 1); + rSummary = summaries[0]; + return true; +} + +svn_error_t* CommitSummaryFetcher::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) +{ + + CommitSummary summary; for (apr_hash_index_t* pKey = apr_hash_first(pool, changed_paths); pKey; pKey = apr_hash_next(pKey)) { char *path; @@ -94,7 +112,6 @@ Modification mod; mod.mFilePath = path; - mod.mNewRevision = Revision::committed(revision); mod.mOldRevision = Revision::committed(revision-1); svn_log_changed_path_t *log_item = reinterpret_cast<svn_log_changed_path_t *>(val); @@ -117,29 +134,23 @@ // TODO: return error break; } - pThis->mModifications.append(mod); + summary.mModifications.append(mod); } - pThis->mAuthor = author; - pThis->mDate = QDateTime::fromString(date, Qt::ISODate); - pThis->mLogMessage = message; + summary.mRevision = Revision::committed(revision); + summary.mAuthor = author; + summary.mDate = QDateTime::fromString(date, Qt::ISODate); + summary.mLogMessage = message; + CommitSummaryFetcher* pThis = (CommitSummaryFetcher*)baton; + pThis->mSummaries.append(summary); + return NULL; } -void CommitSummary::statusCallback(void *baton, const char *path, svn_wc_status2_t *status) +void CommitSummaryFetcher::statusCallback(void *baton, const char *path, svn_wc_status2_t *status) { - CommitSummary* pThis = (CommitSummary*)baton; - Modification mod; - mod.mNewRevision = pThis->mRevision; - - // Set old revision to base, if the file is already under version control - if (status->entry) - mod.mOldRevision = Revision::base(); -// else -// mod.mOldRevision = Revision::unknown(); - switch (status->text_status) { // cases we care about @@ -183,9 +194,29 @@ break; } + + CommitSummaryFetcher* pThis = (CommitSummaryFetcher*)baton; + + // Set file path (removing working copy part) + mod.mNewRevision = Revision::uncommitted(); + mod.mFilePath = path; if (mod.mFilePath.startsWith(pThis->mWcPath)) mod.mFilePath.remove(0, pThis->mWcPath.length()); + + // Set old revision to base, if the file is already under version control + if (status->entry) + mod.mOldRevision = Revision::base(); +// else +// mod.mOldRevision = Revision::unknown(); + + // Assume that if we're here (i.e. checking WC status) that we're only retrieving one revision + if (pThis->mSummaries.size() == 0) + { + CommitSummary summary; + pThis->mSummaries.append(summary); + } + GSVN_ASSERT(pThis->mSummaries.size() == 1); - pThis->mModifications.append(mod); + pThis->mSummaries[0].mModifications.append(mod); } Modified: trunk/src/svn/revision.cpp =================================================================== --- trunk/src/svn/revision.cpp 2006-10-27 14:59:41 UTC (rev 64) +++ trunk/src/svn/revision.cpp 2006-10-27 15:01:19 UTC (rev 65) @@ -42,6 +42,27 @@ return mCommittedRevision; } +Revision Revision::fromSvn(svn_opt_revision_t svnRev) +{ + Revision rev; + switch (svnRev.kind) + { + case svn_opt_revision_working: + return uncommitted(); + case svn_opt_revision_number: + return committed(svnRev.value.number); + case svn_opt_revision_base: + return base(); + case svn_opt_revision_head: + return head(); + default: + return uncommitted(); + } + GSVN_ASSERT(false); + return uncommitted(); +} + + svn_opt_revision_t Revision::getSvnRevision() { svn_opt_revision_t svnRev; Modified: trunk/tests/svn_test.cpp =================================================================== --- trunk/tests/svn_test.cpp 2006-10-27 14:59:41 UTC (rev 64) +++ trunk/tests/svn_test.cpp 2006-10-27 15:01:19 UTC (rev 65) @@ -194,23 +194,26 @@ void SvnTester::testModifications() { CommitSummary summary; + CommitSummaryFetcher fetcher; QString rError; Revision rev; rev = Revision::committed(1); - QVERIFY(summary.init(*mpContext, getWcPath(), rev, rError)); + QVERIFY(fetcher.fetchSummary(*mpContext, getWcPath(), rev, summary, rError)); const QList<Modification>& mods = summary.modifications(); QCOMPARE(mods.size(), 1); QCOMPARE(mods[0].getFilePath(), QString("/first.txt")); QCOMPARE(mods[0].getType(), Modification::Type_Add); + QCOMPARE(summary.getRevision(), Revision::committed(1)); rev = Revision::uncommitted(); - QVERIFY(summary.init(*mpContext, getWcPath(), rev, rError)); + QVERIFY(fetcher.fetchSummary(*mpContext, getWcPath(), rev, summary, rError)); QCOMPARE(mods.size(), 1); QCOMPARE(mods[0].getFilePath(), QString("/second.txt")); QCOMPARE(mods[0].getType(), Modification::Type_Add); + QCOMPARE(summary.getRevision(), Revision::uncommitted()); } void SvnTester::testRepoFileAccess() @@ -247,7 +250,8 @@ rev = Revision::committed(1); CommitSummary summary; - QVERIFY(summary.init(*mpContext, getWcPath(), rev, rError)); + CommitSummaryFetcher fetcher; + QVERIFY(fetcher.fetchSummary(*mpContext, getWcPath(), rev, summary, rError)); //QCOMPARE(summary.getCommitAuthor(), QString("billfrank")); //QCOMPARE(summary.getCommitDate(), bogus); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-27 14:59:48
|
Revision: 64 http://svn.sourceforge.net/grandmas-svn/?rev=64&view=rev Author: matthiasmiller Date: 2006-10-27 07:59:41 -0700 (Fri, 27 Oct 2006) Log Message: ----------- fix tab order in main window Modified Paths: -------------- trunk/ui/mainwindow.ui Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-10-27 05:03:13 UTC (rev 63) +++ trunk/ui/mainwindow.ui 2006-10-27 14:59:41 UTC (rev 64) @@ -333,6 +333,7 @@ <tabstop>addButton</tabstop> <tabstop>deleteButton</tabstop> <tabstop>moveButton</tabstop> + <tabstop>revisionsTreeView</tabstop> <tabstop>updateButton</tabstop> <tabstop>commitButton</tabstop> </tabstops> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-27 05:03:15
|
Revision: 63 http://svn.sourceforge.net/grandmas-svn/?rev=63&view=rev Author: matthiasmiller Date: 2006-10-26 22:03:13 -0700 (Thu, 26 Oct 2006) Log Message: ----------- don't let QTreeView column headings be dragged around Modified Paths: -------------- trunk/src/dialogs/commit.cpp trunk/src/dialogs/mainwindow.cpp Modified: trunk/src/dialogs/commit.cpp =================================================================== --- trunk/src/dialogs/commit.cpp 2006-10-27 04:43:32 UTC (rev 62) +++ trunk/src/dialogs/commit.cpp 2006-10-27 05:03:13 UTC (rev 63) @@ -25,6 +25,8 @@ #include "svn/revision.h" #include "ui_commit.h" +#include <QHeaderView> + CommitDialog::CommitDialog(SvnOperationContext* pContext, QString path, QWidget* pParent) : QDialog(pParent) { mpContext = pContext; @@ -39,6 +41,7 @@ mpModificationsModel = new ModificationsModel(); mpModificationsModel->setAllowSelections(true); mpUi->changesTreeView->setModel(mpModificationsModel); + mpUi->changesTreeView->header()->setMovable(false); reload(); Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-27 04:43:32 UTC (rev 62) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-27 05:03:13 UTC (rev 63) @@ -30,6 +30,7 @@ #include "ui_mainwindow.h" #include <QDir> +#include <QHeaderView> #include <QMessageBox> #include <QProcess> #include <svn_client.h> @@ -105,9 +106,11 @@ mpModificationsModel = new ModificationsModel(); mpUi->changesTreeView->setModel(mpModificationsModel); - + mpUi->changesTreeView->header()->setMovable(false); + mpRevisionsModel = new RevisionsModel(); mpUi->revisionsTreeView->setModel(mpRevisionsModel); + mpUi->revisionsTreeView->header()->setMovable(false); setWindowTitle(tr("%1 - %2").arg(QDir::convertSeparators(path)).arg(windowTitle())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-27 04:43:36
|
Revision: 62 http://svn.sourceforge.net/grandmas-svn/?rev=62&view=rev Author: matthiasmiller Date: 2006-10-26 21:43:32 -0700 (Thu, 26 Oct 2006) Log Message: ----------- create skeleton revisions model Modified Paths: -------------- trunk/grandmas_svn.pro trunk/include/dialogs/mainwindow.h trunk/src/dialogs/mainwindow.cpp Added Paths: ----------- trunk/include/dialogs/revisionsmodel.h trunk/src/dialogs/revisionsmodel.cpp Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-10-27 04:30:33 UTC (rev 61) +++ trunk/grandmas_svn.pro 2006-10-27 04:43:32 UTC (rev 62) @@ -116,6 +116,7 @@ include/dialogs/modificationsmodel.h \ include/dialogs/move.h \ include/dialogs/open.h \ + include/dialogs/revisionsmodel.h \ include/dialogs/util.h \ include/settings/userpaths.h \ include/svn/commit_summary.h \ @@ -134,6 +135,8 @@ src/dialogs/modificationsmodel.cpp \ src/dialogs/move.cpp \ src/dialogs/open.cpp \ + src/dialogs/revisionsmodel.cpp \ + src/dialogs/util.cpp \ src/settings/userpaths.cpp \ src/svn/commit_summary.cpp \ src/svn/file_access.cpp \ @@ -141,7 +144,6 @@ src/svn/operation_internal.cpp \ src/svn/revision.cpp \ src/svn/server_access.cpp \ - src/dialogs/util.cpp \ src/grandmas_svn.cpp \ src/main.cpp \ Modified: trunk/include/dialogs/mainwindow.h =================================================================== --- trunk/include/dialogs/mainwindow.h 2006-10-27 04:30:33 UTC (rev 61) +++ trunk/include/dialogs/mainwindow.h 2006-10-27 04:43:32 UTC (rev 62) @@ -25,6 +25,7 @@ #include "svn/revision.h" class ModificationsModel; +class RevisionsModel; class SvnOperationContext; class Ui_MainWindow; class QModelIndex; @@ -55,6 +56,7 @@ QString mPath; ModificationsModel* mpModificationsModel; Revision mDisplayedRevision; + RevisionsModel* mpRevisionsModel; }; #endif Copied: trunk/include/dialogs/revisionsmodel.h (from rev 60, trunk/templates/h) =================================================================== --- trunk/include/dialogs/revisionsmodel.h (rev 0) +++ trunk/include/dialogs/revisionsmodel.h 2006-10-27 04:43:32 UTC (rev 62) @@ -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 <QAbstractListModel> + +class RevisionsModel : public QAbstractListModel +{ +public: + RevisionsModel(); + virtual ~RevisionsModel(); + + virtual int columnCount(const QModelIndex &rcParent = QModelIndex()) const; + virtual int rowCount(const QModelIndex& rcParent = QModelIndex()) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + virtual QVariant data(const QModelIndex& rcIndex, int role = Qt::DisplayRole) const; + +private: +}; + Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-27 04:30:33 UTC (rev 61) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-27 04:43:32 UTC (rev 62) @@ -23,6 +23,7 @@ #include "dialogs/commit.h" #include "dialogs/modificationsmodel.h" #include "dialogs/move.h" +#include "dialogs/revisionsmodel.h" #include "svn/commit_summary.h" #include "svn/file_access.h" #include "svn/revision.h" @@ -104,6 +105,9 @@ mpModificationsModel = new ModificationsModel(); mpUi->changesTreeView->setModel(mpModificationsModel); + + mpRevisionsModel = new RevisionsModel(); + mpUi->revisionsTreeView->setModel(mpRevisionsModel); setWindowTitle(tr("%1 - %2").arg(QDir::convertSeparators(path)).arg(windowTitle())); @@ -112,6 +116,12 @@ MainWindow::~MainWindow() { + // detach revisions model + mpUi->revisionsTreeView->setModel(NULL); + delete mpRevisionsModel; + mpRevisionsModel = NULL; + + // detach modifications model mpUi->changesTreeView->setModel(NULL); delete mpModificationsModel; mpModificationsModel = NULL; Copied: trunk/src/dialogs/revisionsmodel.cpp (from rev 60, trunk/templates/cpp) =================================================================== --- trunk/src/dialogs/revisionsmodel.cpp (rev 0) +++ trunk/src/dialogs/revisionsmodel.cpp 2006-10-27 04:43:32 UTC (rev 62) @@ -0,0 +1,61 @@ +/*************************************************************************** + * 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/revisionsmodel.h" + +RevisionsModel::RevisionsModel() +{ +} + +RevisionsModel::~RevisionsModel() +{ +} + +int RevisionsModel::columnCount(const QModelIndex &rcParent) const +{ + return 4; +} + +int RevisionsModel::rowCount(const QModelIndex& rcParent) const +{ + return 0; +} + +QVariant RevisionsModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role == Qt::DisplayRole) + { + switch (section) + { + case 0: return tr("Revision"); + case 1: return tr("Author"); + case 2: return tr("Date"); + case 3: return tr("Message"); + default: return QVariant(); + } + } + else + return QVariant(); +} + +QVariant RevisionsModel::data(const QModelIndex& rcIndex, int role) const +{ + return QVariant(); +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-27 04:30:39
|
Revision: 61 http://svn.sourceforge.net/grandmas-svn/?rev=61&view=rev Author: matthiasmiller Date: 2006-10-26 21:30:33 -0700 (Thu, 26 Oct 2006) Log Message: ----------- change revisions view from a QTableView to a QTreeView Modified Paths: -------------- trunk/src/dialogs/mainwindow.cpp trunk/ui/mainwindow.ui Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-26 14:45:13 UTC (rev 60) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-27 04:30:33 UTC (rev 61) @@ -94,6 +94,7 @@ mpUi->setupUi(this); #if QT_VERSION >= 0x040200 mpUi->changesTreeView->setAllColumnsShowFocus(true); + mpUi->revisionsTreeView->setAllColumnsShowFocus(true); #endif connect(mpUi->commitButton, SIGNAL(clicked()), this, SLOT(commit())); Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-10-26 14:45:13 UTC (rev 60) +++ trunk/ui/mainwindow.ui 2006-10-27 04:30:33 UTC (rev 61) @@ -1,4 +1,7 @@ <ui version="4.0" > + <author></author> + <comment></comment> + <exportmacro></exportmacro> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow" > <property name="geometry" > @@ -289,27 +292,27 @@ <string>Recent Activity:</string> </property> <property name="buddy" > - <cstring>revisionsTableView</cstring> + <cstring>revisionsTreeView</cstring> </property> </widget> </item> <item> - <widget class="QTableView" name="revisionsTableView" > + <widget class="QTreeView" name="revisionsTreeView" > <property name="minimumSize" > <size> <width>0</width> <height>100</height> </size> </property> - <property name="sizeIncrement" > - <size> - <width>0</width> - <height>0</height> - </size> + <property name="selectionMode" > + <enum>QAbstractItemView::ExtendedSelection</enum> </property> - <property name="tabKeyNavigation" > - <bool>false</bool> + <property name="indentation" > + <number>0</number> </property> + <property name="rootIsDecorated" > + <bool>true</bool> + </property> </widget> </item> </layout> @@ -321,6 +324,7 @@ </property> </action> </widget> + <pixmapfunction></pixmapfunction> <tabstops> <tabstop>logEdit</tabstop> <tabstop>changesTreeView</tabstop> @@ -329,7 +333,6 @@ <tabstop>addButton</tabstop> <tabstop>deleteButton</tabstop> <tabstop>moveButton</tabstop> - <tabstop>revisionsTableView</tabstop> <tabstop>updateButton</tabstop> <tabstop>commitButton</tabstop> </tabstops> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-26 14:45:23
|
Revision: 60 http://svn.sourceforge.net/grandmas-svn/?rev=60&view=rev Author: matthiasmiller Date: 2006-10-26 07:45:13 -0700 (Thu, 26 Oct 2006) Log Message: ----------- add icon back to commit dialog Modified Paths: -------------- trunk/ui/commit.ui Modified: trunk/ui/commit.ui =================================================================== --- trunk/ui/commit.ui 2006-10-26 12:59:20 UTC (rev 59) +++ trunk/ui/commit.ui 2006-10-26 14:45:13 UTC (rev 60) @@ -13,7 +13,7 @@ <string>Commit</string> </property> <property name="windowIcon" > - <iconset/> + <iconset resource="grandmas-svn.qrc" >:/logo/logo-32x32.png</iconset> </property> <layout class="QVBoxLayout" > <property name="margin" > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-26 12:59:25
|
Revision: 59 http://svn.sourceforge.net/grandmas-svn/?rev=59&view=rev Author: matthiasmiller Date: 2006-10-26 05:59:20 -0700 (Thu, 26 Oct 2006) Log Message: ----------- allow multiple items to be diffed at once; slight tweak to commit dialog layout Modified Paths: -------------- trunk/include/dialogs/modificationsmodel.h trunk/src/dialogs/mainwindow.cpp trunk/src/dialogs/modificationsmodel.cpp trunk/ui/commit.ui trunk/ui/mainwindow.ui Modified: trunk/include/dialogs/modificationsmodel.h =================================================================== --- trunk/include/dialogs/modificationsmodel.h 2006-10-26 03:36:10 UTC (rev 58) +++ trunk/include/dialogs/modificationsmodel.h 2006-10-26 12:59:20 UTC (rev 59) @@ -32,7 +32,7 @@ void showError(QString error); void showModifications(const QList<Modification>& rcModifications, bool includeUnversionedMods); - Modification getModificationFromIndex(const QModelIndex& rcIndex) const; + Modification getModificationFromIndex(int row) const; virtual int columnCount(const QModelIndex &rcParent = QModelIndex()) const; virtual int rowCount(const QModelIndex& rcParent = QModelIndex()) const; Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-26 03:36:10 UTC (rev 58) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-26 12:59:20 UTC (rev 59) @@ -141,32 +141,42 @@ void MainWindow::diff() { - diff(mpUi->changesTreeView->selectionModel()->currentIndex()); -} - -void MainWindow::diff(const QModelIndex& rcIndex) -{ - if (!rcIndex.isValid()) - return; - - // Generate each side of the diff - QString error, leftPath, rightPath; - Modification mod = mpModificationsModel->getModificationFromIndex(rcIndex); - QString fullFilePath = RepoFileAccess::getCanonicalPath(*mpContext, mPath, mod.getFilePath()); - if (!RepoFileAccess::getDiffFiles(*mpContext, fullFilePath, mod.getOldRevision(), mod.getNewRevision(), leftPath, rightPath, error)) + // determine which rows are selected (remove duplicate rows, since an index is returned for each column) + QModelIndexList selection = mpUi->changesTreeView->selectionModel()->selectedIndexes(); + QSet<int> rows; + Q_FOREACH(QModelIndex index, selection) { - QMessageBox::critical(this, "", error); - return; + if (index.isValid()) + rows.insert(index.row()); } - // Launch the diff - if (!diffFiles(leftPath, rightPath)) + Q_FOREACH(int row, rows) { - QMessageBox::critical(this, tr("The differences could not be displayed."), tr("The comparison program could not be opened.")); - return; + // Generate each side of the diff + QString error, leftPath, rightPath; + Modification mod = mpModificationsModel->getModificationFromIndex(row); + QString fullFilePath = RepoFileAccess::getCanonicalPath(*mpContext, mPath, mod.getFilePath()); + if (!RepoFileAccess::getDiffFiles(*mpContext, fullFilePath, mod.getOldRevision(), mod.getNewRevision(), leftPath, rightPath, error)) + { + QMessageBox::critical(this, "", error); + return; + } + + // Launch the diff + if (!diffFiles(leftPath, rightPath)) + { + QMessageBox::critical(this, tr("The differences could not be displayed."), tr("The comparison program could not be opened.")); + return; + } } } +void MainWindow::diff(const QModelIndex& rcIndex) +{ + Q_UNUSED(rcIndex); + diff(); +} + void MainWindow::move() { MoveDialog dlg(this); Modified: trunk/src/dialogs/modificationsmodel.cpp =================================================================== --- trunk/src/dialogs/modificationsmodel.cpp 2006-10-26 03:36:10 UTC (rev 58) +++ trunk/src/dialogs/modificationsmodel.cpp 2006-10-26 12:59:20 UTC (rev 59) @@ -81,21 +81,15 @@ emit layoutChanged(); } -Modification ModificationsModel::getModificationFromIndex(const QModelIndex& rcIndex) const +Modification ModificationsModel::getModificationFromIndex(int row) const { - if (!rcIndex.isValid()) + if (row < 0 || row >= mAllModifications.count()) { GSVN_ASSERT(false); return Modification(); } - - if (rcIndex.row() < 0 || rcIndex.row() >= mAllModifications.count()) - { - GSVN_ASSERT(false); - return Modification(); - } - return mAllModifications.at(rcIndex.row()); + return mAllModifications.at(row); } int ModificationsModel::columnCount(const QModelIndex &rcParent) const Modified: trunk/ui/commit.ui =================================================================== --- trunk/ui/commit.ui 2006-10-26 03:36:10 UTC (rev 58) +++ trunk/ui/commit.ui 2006-10-26 12:59:20 UTC (rev 59) @@ -13,7 +13,7 @@ <string>Commit</string> </property> <property name="windowIcon" > - <iconset resource="grandmas-svn.qrc" >:/logo/logo-32x32.png</iconset> + <iconset/> </property> <layout class="QVBoxLayout" > <property name="margin" > @@ -74,6 +74,13 @@ </widget> </item> <item> + <widget class="QCheckBox" name="updateCheckBox" > + <property name="text" > + <string>&Also update this working copy.</string> + </property> + </widget> + </item> + <item> <layout class="QHBoxLayout" > <property name="margin" > <number>0</number> @@ -82,13 +89,6 @@ <number>6</number> </property> <item> - <widget class="QCheckBox" name="updateCheckBox" > - <property name="text" > - <string>&Also update this working copy.</string> - </property> - </widget> - </item> - <item> <spacer> <property name="orientation" > <enum>Qt::Horizontal</enum> Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-10-26 03:36:10 UTC (rev 58) +++ trunk/ui/mainwindow.ui 2006-10-26 12:59:20 UTC (rev 59) @@ -169,6 +169,9 @@ </item> <item row="2" column="0" > <widget class="QTreeView" name="changesTreeView" > + <property name="selectionMode" > + <enum>QAbstractItemView::ExtendedSelection</enum> + </property> <property name="indentation" > <number>0</number> </property> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-26 03:36:15
|
Revision: 58 http://svn.sourceforge.net/grandmas-svn/?rev=58&view=rev Author: matthiasmiller Date: 2006-10-25 20:36:10 -0700 (Wed, 25 Oct 2006) Log Message: ----------- fix icon in main window and show working copy path in title Modified Paths: -------------- trunk/src/dialogs/mainwindow.cpp trunk/ui/mainwindow.ui Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-26 03:23:52 UTC (rev 57) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-26 03:36:10 UTC (rev 58) @@ -28,6 +28,7 @@ #include "svn/revision.h" #include "ui_mainwindow.h" +#include <QDir> #include <QMessageBox> #include <QProcess> #include <svn_client.h> @@ -103,6 +104,8 @@ mpModificationsModel = new ModificationsModel(); mpUi->changesTreeView->setModel(mpModificationsModel); + setWindowTitle(tr("%1 - %2").arg(QDir::convertSeparators(path)).arg(windowTitle())); + reload(); } Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-10-26 03:23:52 UTC (rev 57) +++ trunk/ui/mainwindow.ui 2006-10-26 03:36:10 UTC (rev 58) @@ -13,7 +13,7 @@ <string>Grandma's SVN</string> </property> <property name="windowIcon" > - <iconset/> + <iconset resource="grandmas-svn.qrc" >:/logo/logo-32x32.png</iconset> </property> <widget class="QWidget" name="centralwidget" > <layout class="QVBoxLayout" > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-26 03:23:56
|
Revision: 57 http://svn.sourceforge.net/grandmas-svn/?rev=57&view=rev Author: matthiasmiller Date: 2006-10-25 20:23:52 -0700 (Wed, 25 Oct 2006) Log Message: ----------- make main window's buttons the same width as the logo to improve overall appearance on Windows and Mac Modified Paths: -------------- trunk/ui/mainwindow.ui Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-10-26 03:09:28 UTC (rev 56) +++ trunk/ui/mainwindow.ui 2006-10-26 03:23:52 UTC (rev 57) @@ -32,38 +32,34 @@ <number>6</number> </property> <item> - <widget class="QLabel" name="logLabel" > + <widget class="QPushButton" name="updateButton" > <property name="sizePolicy" > <sizepolicy> - <hsizetype>5</hsizetype> + <hsizetype>0</hsizetype> <vsizetype>5</vsizetype> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="text" > - <string>Commit Log Entry:</string> + <string>&Update</string> </property> - <property name="alignment" > - <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> - </property> - <property name="buddy" > - <cstring>logEdit</cstring> - </property> </widget> </item> <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> + <widget class="QPushButton" name="commitButton" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> + <property name="text" > + <string>&Commit...</string> </property> - </spacer> + </widget> </item> <item> <spacer> @@ -82,64 +78,57 @@ </spacer> </item> <item> - <widget class="QPushButton" name="updateButton" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> </property> - <property name="text" > - <string>&Update</string> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> </property> - </widget> + </spacer> </item> - <item> - <widget class="QPushButton" name="commitButton" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>&Commit...</string> - </property> - </widget> - </item> </layout> </item> <item> - <layout class="QHBoxLayout" > + <widget class="QLabel" name="logLabel" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Commit Log Entry:</string> + </property> + <property name="buddy" > + <cstring>logEdit</cstring> + </property> + </widget> + </item> + <item> + <layout class="QGridLayout" > <property name="margin" > <number>0</number> </property> <property name="spacing" > <number>6</number> </property> - <item> - <widget class="QTextEdit" name="logEdit" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>13</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item row="1" column="0" > + <widget class="QLabel" name="changesLabel" > + <property name="text" > + <string>Changes:</string> </property> - <property name="tabChangesFocus" > - <bool>true</bool> + <property name="buddy" > + <cstring>changesTreeView</cstring> </property> - <property name="acceptRichText" > - <bool>false</bool> - </property> </widget> </item> - <item> + <item row="0" column="1" > <widget class="QLabel" name="label" > <property name="sizePolicy" > <sizepolicy> @@ -160,27 +149,25 @@ </property> </widget> </item> - </layout> - </item> - <item> - <widget class="QLabel" name="changesLabel" > - <property name="text" > - <string>Changes:</string> - </property> - <property name="buddy" > - <cstring>changesTreeView</cstring> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> + <item row="0" column="0" > + <widget class="QTextEdit" name="logEdit" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>13</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="tabChangesFocus" > + <bool>true</bool> + </property> + <property name="acceptRichText" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="2" column="0" > <widget class="QTreeView" name="changesTreeView" > <property name="indentation" > <number>0</number> @@ -190,7 +177,7 @@ </property> </widget> </item> - <item> + <item row="2" column="1" > <layout class="QVBoxLayout" > <property name="margin" > <number>0</number> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-26 03:09:31
|
Revision: 56 http://svn.sourceforge.net/grandmas-svn/?rev=56&view=rev Author: matthiasmiller Date: 2006-10-25 20:09:28 -0700 (Wed, 25 Oct 2006) Log Message: ----------- remove space in resource prefix Modified Paths: -------------- trunk/ui/mainwindow.ui Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-10-26 03:07:59 UTC (rev 55) +++ trunk/ui/mainwindow.ui 2006-10-26 03:09:28 UTC (rev 56) @@ -153,7 +153,7 @@ <string/> </property> <property name="pixmap" > - <pixmap resource="grandmas-svn.qrc" >:/ /logo/logo-128x128.png</pixmap> + <pixmap resource="grandmas-svn.qrc" >:/logo/logo-128x128.png</pixmap> </property> <property name="alignment" > <set>Qt::AlignCenter</set> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-26 03:08:04
|
Revision: 55 http://svn.sourceforge.net/grandmas-svn/?rev=55&view=rev Author: matthiasmiller Date: 2006-10-25 20:07:59 -0700 (Wed, 25 Oct 2006) Log Message: ----------- remove space in resource prefix Modified Paths: -------------- trunk/ui/grandmas-svn.qrc Modified: trunk/ui/grandmas-svn.qrc =================================================================== --- trunk/ui/grandmas-svn.qrc 2006-10-26 03:05:17 UTC (rev 54) +++ trunk/ui/grandmas-svn.qrc 2006-10-26 03:07:59 UTC (rev 55) @@ -1,5 +1,5 @@ <RCC> - <qresource prefix="/ " > + <qresource prefix="/" > <file>logo/logo-128x128.png</file> <file>logo/logo-16x16.png</file> <file>logo/logo-32x32.png</file> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-26 03:05:21
|
Revision: 54 http://svn.sourceforge.net/grandmas-svn/?rev=54&view=rev Author: matthiasmiller Date: 2006-10-25 20:05:17 -0700 (Wed, 25 Oct 2006) Log Message: ----------- changing main window layout slightly to improve appearance on Mac Modified Paths: -------------- trunk/ui/mainwindow.ui Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-10-26 02:24:38 UTC (rev 53) +++ trunk/ui/mainwindow.ui 2006-10-26 03:05:17 UTC (rev 54) @@ -6,14 +6,14 @@ <x>0</x> <y>0</y> <width>639</width> - <height>449</height> + <height>512</height> </rect> </property> <property name="windowTitle" > <string>Grandma's SVN</string> </property> <property name="windowIcon" > - <iconset resource="grandmas-svn.qrc" >:/logo/logo-32x32.png</iconset> + <iconset/> </property> <widget class="QWidget" name="centralwidget" > <layout class="QVBoxLayout" > @@ -32,173 +32,137 @@ <number>6</number> </property> <item> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> + <widget class="QLabel" name="logLabel" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="spacing" > - <number>6</number> + <property name="text" > + <string>Commit Log Entry:</string> </property> - <item> - <widget class="QLabel" name="logLabel" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>5</hsizetype> - <vsizetype>0</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>Commit Log Entry:</string> - </property> - <property name="buddy" > - <cstring>logEdit</cstring> - </property> - </widget> - </item> - <item> - <widget class="QTextEdit" name="logEdit" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>13</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize" > - <size> - <width>0</width> - <height>100</height> - </size> - </property> - <property name="tabChangesFocus" > - <bool>true</bool> - </property> - <property name="acceptRichText" > - <bool>false</bool> - </property> - </widget> - </item> - </layout> + <property name="alignment" > + <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set> + </property> + <property name="buddy" > + <cstring>logEdit</cstring> + </property> + </widget> </item> <item> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> </property> - <property name="spacing" > - <number>6</number> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> </property> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Minimum</enum> - </property> - <property name="sizeHint" > - <size> - <width>5</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="updateButton" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>&Update</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="commitButton" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>&Commit...</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Minimum</enum> - </property> - <property name="sizeHint" > - <size> - <width>5</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="label" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>5</hsizetype> - <vsizetype>0</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string/> - </property> - <property name="pixmap" > - <pixmap resource="grandmas-svn.qrc" >:/ /logo/logo-128x128.png</pixmap> - </property> - <property name="alignment" > - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - </layout> - </item> - </layout> + </spacer> </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Minimum</enum> + </property> + <property name="sizeHint" > + <size> + <width>5</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="updateButton" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>&Update</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="commitButton" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>&Commit...</string> + </property> + </widget> + </item> </layout> </item> <item> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <widget class="QTextEdit" name="logEdit" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>13</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="tabChangesFocus" > + <bool>true</bool> + </property> + <property name="acceptRichText" > + <bool>false</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string/> + </property> + <property name="pixmap" > + <pixmap resource="grandmas-svn.qrc" >:/ /logo/logo-128x128.png</pixmap> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + </layout> + </item> + <item> <widget class="QLabel" name="changesLabel" > <property name="text" > <string>Changes:</string> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-26 02:24:43
|
Revision: 53 http://svn.sourceforge.net/grandmas-svn/?rev=53&view=rev Author: matthiasmiller Date: 2006-10-25 19:24:38 -0700 (Wed, 25 Oct 2006) Log Message: ----------- adding a logo the main window and removing the settings button (at least for now) Modified Paths: -------------- trunk/ui/grandmas-svn.qrc trunk/ui/mainwindow.ui Modified: trunk/ui/grandmas-svn.qrc =================================================================== --- trunk/ui/grandmas-svn.qrc 2006-10-25 23:47:09 UTC (rev 52) +++ trunk/ui/grandmas-svn.qrc 2006-10-26 02:24:38 UTC (rev 53) @@ -1,5 +1,6 @@ <RCC> - <qresource prefix="/" > + <qresource prefix="/ " > + <file>logo/logo-128x128.png</file> <file>logo/logo-16x16.png</file> <file>logo/logo-32x32.png</file> </qresource> Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-10-25 23:47:09 UTC (rev 52) +++ trunk/ui/mainwindow.ui 2006-10-26 02:24:38 UTC (rev 53) @@ -6,7 +6,7 @@ <x>0</x> <y>0</y> <width>639</width> - <height>452</height> + <height>449</height> </rect> </property> <property name="windowTitle" > @@ -32,152 +32,173 @@ <number>6</number> </property> <item> - <widget class="QPushButton" name="updateButton" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>0</number> </property> - <property name="text" > - <string>&Update</string> + <property name="spacing" > + <number>6</number> </property> - </widget> + <item> + <widget class="QLabel" name="logLabel" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>Commit Log Entry:</string> + </property> + <property name="buddy" > + <cstring>logEdit</cstring> + </property> + </widget> + </item> + <item> + <widget class="QTextEdit" name="logEdit" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>13</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize" > + <size> + <width>0</width> + <height>100</height> + </size> + </property> + <property name="tabChangesFocus" > + <bool>true</bool> + </property> + <property name="acceptRichText" > + <bool>false</bool> + </property> + </widget> + </item> + </layout> </item> <item> - <widget class="QPushButton" name="commitButton" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>0</number> </property> - <property name="text" > - <string>&Commit...</string> + <property name="spacing" > + <number>6</number> </property> - </widget> + <item> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Minimum</enum> + </property> + <property name="sizeHint" > + <size> + <width>5</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="updateButton" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>&Update</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="commitButton" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>&Commit...</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" > + <property name="margin" > + <number>0</number> + </property> + <property name="spacing" > + <number>6</number> + </property> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Minimum</enum> + </property> + <property name="sizeHint" > + <size> + <width>5</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="label" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string/> + </property> + <property name="pixmap" > + <pixmap resource="grandmas-svn.qrc" >:/ /logo/logo-128x128.png</pixmap> + </property> + <property name="alignment" > + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + </layout> + </item> + </layout> </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="workingCopyLabel" > - <property name="font" > - <font> - <family>Lucida Grande</family> - <pointsize>24</pointsize> - <weight>75</weight> - <italic>false</italic> - <bold>true</bold> - <underline>false</underline> - <strikeout>false</strikeout> - </font> - </property> - <property name="text" > - <string>Grandma's SVN</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="settingsButton" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text" > - <string>&Settings</string> - </property> - </widget> - </item> </layout> </item> <item> - <widget class="QLabel" name="logLabel" > - <property name="text" > - <string>Commit Log Entry:</string> - </property> - <property name="buddy" > - <cstring>logEdit</cstring> - </property> - </widget> - </item> - <item> - <widget class="QTextEdit" name="logEdit" > - <property name="minimumSize" > - <size> - <width>0</width> - <height>100</height> - </size> - </property> - <property name="tabChangesFocus" > - <bool>true</bool> - </property> - <property name="acceptRichText" > - <bool>false</bool> - </property> - </widget> - </item> - <item> <widget class="QLabel" name="changesLabel" > <property name="text" > <string>Changes:</string> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hig...@us...> - 2006-10-25 23:47:42
|
Revision: 52 http://svn.sourceforge.net/grandmas-svn/?rev=52&view=rev Author: highjinx Date: 2006-10-25 16:47:09 -0700 (Wed, 25 Oct 2006) Log Message: ----------- * Fixed file status on working revisions * Changed the Revision object to know about "base" revisions, to speed diffing Modified Paths: -------------- trunk/include/svn/operation.h trunk/include/svn/revision.h trunk/src/dialogs/mainwindow.cpp trunk/src/svn/commit_summary.cpp trunk/src/svn/file_access.cpp trunk/src/svn/operation.cpp trunk/src/svn/revision.cpp trunk/tests/svn_test.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 grandmas-svn.xcodeproj Info.plist + *.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 tags Modified: trunk/include/svn/operation.h =================================================================== --- trunk/include/svn/operation.h 2006-10-25 18:59:09 UTC (rev 51) +++ trunk/include/svn/operation.h 2006-10-25 23:47:09 UTC (rev 52) @@ -28,7 +28,7 @@ namespace Operation { - bool initAuthProviders(svn_client_ctx_t* context, SvnOperationContext& rContext, QString& rError); + bool initAuthProviders(SvnOperationContext& rContext, svn_client_ctx_t* context, QString& rError); - bool getRelativeRepoUrl(SvnOperationContext& rContext, QString fullRepoPath, svn_client_ctx_t* ctx, QString& rRelPath, QString& rError); + bool getRepoCheckoutUrl(SvnOperationContext& rContext, svn_client_ctx_t* ctx, QString& rRelPath, QString fullRepoPath, QString& rError); }; Modified: trunk/include/svn/revision.h =================================================================== --- trunk/include/svn/revision.h 2006-10-25 18:59:09 UTC (rev 51) +++ trunk/include/svn/revision.h 2006-10-25 23:47:09 UTC (rev 52) @@ -30,12 +30,25 @@ public: Revision(); ~Revision(); + + static Revision uncommitted() { Revision rev; rev.mType = Uncommitted; rev.mCommittedRevision = 0; return rev; } + static Revision committed(int revision) { Revision rev; rev.mType = Committed; rev.mCommittedRevision = revision; return rev; } + static Revision base() { Revision rev; rev.mType = Base; rev.mCommittedRevision = 0; return rev; } + static Revision head() { Revision rev; rev.mType = Head; rev.mCommittedRevision = 0; return rev; } + + enum Type + { + Uncommitted, + Committed, + Base, + Head, // Unimplemented + }; bool operator==(const Revision& rcOther) const { - if (mIsCommitted != rcOther.mIsCommitted) + if (mType != rcOther.mType) return false; - if (mIsCommitted && mCommittedRevision != rcOther.mCommittedRevision) + if (mType == Committed && mCommittedRevision != rcOther.mCommittedRevision) return false; return true; @@ -44,11 +57,8 @@ { return !(*this == rcOther); } - - void setUncommittedRevision(); - void setCommittedRevision(int revision); - bool isCommittedRevision(); + Type getType(); int getCommittedRevision(); // svn wrapper functions @@ -56,7 +66,7 @@ svn_opt_revision_t getSvnRevision(); private: - bool mIsCommitted; + Type mType; int mCommittedRevision; }; Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-25 18:59:09 UTC (rev 51) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-25 23:47:09 UTC (rev 52) @@ -125,7 +125,7 @@ if (pEvent->type() == QEvent::ActivationChange && isActiveWindow()) { // Refresh the modifications if it doesn't require server access. - if (mpModificationsModel && !mDisplayedRevision.isCommittedRevision()) + if (mpModificationsModel && mDisplayedRevision.getType() == Revision::Uncommitted) reload(); } } @@ -190,7 +190,7 @@ #elif defined(Q_WS_MAC) app = "opendiff"; #else - return false; + app = "meld"; #endif QStringList args; Modified: trunk/src/svn/commit_summary.cpp =================================================================== --- trunk/src/svn/commit_summary.cpp 2006-10-25 18:59:09 UTC (rev 51) +++ trunk/src/svn/commit_summary.cpp 2006-10-25 23:47:09 UTC (rev 52) @@ -29,25 +29,23 @@ mModifications.clear(); rError = ""; mRevision = revision; - //mpContext = &rServer; - mWcPath = svn_path_canonicalize(fullRepoPath.toAscii(), rContext.getAprPool()); + const char* fullCanonPath = svn_path_canonicalize(fullRepoPath.toAscii(), rContext.getAprPool()); svn_client_ctx_t* ctx; svn_client_create_context(&ctx, rContext.getAprPool()); - if (!Operation::initAuthProviders(ctx, rContext, rError)) + if (!Operation::initAuthProviders(rContext, ctx, rError)) return false; - // TODO: This isn't working. Figure out why. - //if (!Operation::getRelativeRepoUrl(rContext, fullRepoPath, ctx, mWcPath, rError)) - // return false; - svn_error_t* pError = NULL; - if (revision.isCommittedRevision()) + if (revision.getType() != Revision::Uncommitted) { + if (!Operation::getRepoCheckoutUrl(rContext, ctx, fullRepoPath, mWcPath, rError)) + return false; + svn_opt_revision_t startRev = revision.getSvnRevision(); svn_opt_revision_t endRev = revision.getSvnRevision(); apr_array_header_t *array = apr_array_make(rContext.getAprPool(), 1, sizeof(const char*)); - APR_ARRAY_PUSH(array, const char*) = svn_path_canonicalize(fullRepoPath.toAscii(), rContext.getAprPool()); + APR_ARRAY_PUSH(array, const char*) = fullCanonPath; pError = svn_client_log2(array, &startRev, @@ -62,9 +60,10 @@ } else { + mWcPath = fullRepoPath; + svn_opt_revision_t svnRevision = revision.getSvnRevision(); - const char* canonPath = svn_path_canonicalize(fullRepoPath.toAscii(), rContext.getAprPool()); - pError = svn_client_status2(NULL, canonPath, &svnRevision, + pError = svn_client_status2(NULL, fullCanonPath, &svnRevision, statusCallback, this, true/*recurse*/, @@ -96,8 +95,8 @@ mod.mFilePath = path; - mod.mNewRevision.setCommittedRevision(revision); - mod.mOldRevision.setCommittedRevision(revision-1); + mod.mNewRevision = Revision::committed(revision); + mod.mOldRevision = Revision::committed(revision-1); svn_log_changed_path_t *log_item = reinterpret_cast<svn_log_changed_path_t *>(val); switch (log_item->action) { @@ -122,7 +121,7 @@ } pThis->mAuthor = author; - //pThis->mDate = date; + pThis->mDate = QDateTime::fromString(date, Qt::ISODate); pThis->mLogMessage = message; return NULL; @@ -137,7 +136,9 @@ // Set old revision to base, if the file is already under version control if (status->entry) - mod.mOldRevision.setCommittedRevision(status->entry->revision); + mod.mOldRevision = Revision::base(); +// else +// mod.mOldRevision = Revision::unknown(); switch (status->text_status) { Modified: trunk/src/svn/file_access.cpp =================================================================== --- trunk/src/svn/file_access.cpp 2006-10-25 18:59:09 UTC (rev 51) +++ trunk/src/svn/file_access.cpp 2006-10-25 23:47:09 UTC (rev 52) @@ -30,14 +30,16 @@ namespace { - bool getRandomFilePath(QString dirPath, QString filePrefix, QString fileExtension, QString& rFilePath) + bool getRandomFilePath(QString dirPath, QString filePrefix, QString fileExtension, QString& rFilePath, SvnOperationContext& rContext) { QString randString; while (true) { - if (!QFile::exists(dirPath+filePrefix+randString+"."+fileExtension)) + QString testPath = dirPath + QDir::separator() + filePrefix+randString+"."+fileExtension; + testPath = svn_path_canonicalize(testPath.toAscii(), rContext.getAprPool()); + if (!QFile::exists(testPath)) { - rFilePath = dirPath+filePrefix+randString+"."+fileExtension; + rFilePath = testPath; return true; } randString.setNum(rand() % 10000); @@ -55,7 +57,7 @@ bool RepoFileAccess::getFile(SvnOperationContext& rContext, QString fullRepoPath, Revision rev, QString& rCreatedFilePath, QString& rError) { - if (!rev.isCommittedRevision()) + if (rev.getType() == Revision::Uncommitted) { rCreatedFilePath = fullRepoPath; return true; @@ -63,7 +65,7 @@ // create a new file and suppose we only want // this users to be able to read and write the file apr_file_t* pAprFile = NULL; - if (!getRandomFilePath(QDir::tempPath(), "bogus", "cpp", rCreatedFilePath) || + if (!getRandomFilePath(QDir::tempPath(), "bogus", "cpp", rCreatedFilePath, rContext) || apr_file_open(&pAprFile, rCreatedFilePath.toAscii(), APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BINARY, APR_OS_DEFAULT, rContext.getAprPool())) { rError = "Unable to create temporary file."; @@ -80,7 +82,7 @@ svn_client_ctx_t* pCtx = NULL; svn_client_create_context(&pCtx, rContext.getAprPool()); - if (!Operation::initAuthProviders(pCtx, rContext, rError)) + if (!Operation::initAuthProviders(rContext, pCtx, rError)) return false; svn_opt_revision_t svnRev = rev.getSvnRevision(); Modified: trunk/src/svn/operation.cpp =================================================================== --- trunk/src/svn/operation.cpp 2006-10-25 18:59:09 UTC (rev 51) +++ trunk/src/svn/operation.cpp 2006-10-25 23:47:09 UTC (rev 52) @@ -46,7 +46,7 @@ } -bool Operation::initAuthProviders(svn_client_ctx_t* context, SvnOperationContext& rContext, QString& /*rError*/) +bool Operation::initAuthProviders(SvnOperationContext& rContext, svn_client_ctx_t* context, QString& /*rError*/) { apr_array_header_t *providers = apr_array_make(rContext.getAprPool(), 7, sizeof(svn_auth_provider_object_t *)); @@ -83,7 +83,7 @@ class SvnInfo { public: - bool getRelativeRepoUrl(SvnOperationContext& rContext, QString fullRepoPath, svn_client_ctx_t* ctx, QString& rRelPath, QString& rError) + bool getRepoCheckoutUrl(SvnOperationContext& rContext, QString fullRepoPath, svn_client_ctx_t* ctx, QString& rRelPath, QString& rError) { svn_error_t* pError = svn_client_info(fullRepoPath.toAscii(), NULL, NULL, infoCallback, this, false, ctx, rContext.getAprPool()); if (pError) @@ -91,6 +91,7 @@ rError = pError->message; return false; } + Q_ASSERT(mRelativeRepoUrl != ""); rRelPath = mRelativeRepoUrl; return true; } @@ -115,9 +116,9 @@ }; -bool Operation::getRelativeRepoUrl(SvnOperationContext& rContext, QString fullRepoPath, svn_client_ctx_t* ctx, QString& rRelPath, QString& rError) +bool Operation::getRepoCheckoutUrl(SvnOperationContext& rContext, svn_client_ctx_t* ctx, QString& rRelPath, QString fullRepoPath, QString& rError) { SvnInfo info; - return info.getRelativeRepoUrl(rContext, fullRepoPath, ctx, rRelPath, rError); + return info.getRepoCheckoutUrl(rContext, fullRepoPath, ctx, rRelPath, rError); } Modified: trunk/src/svn/revision.cpp =================================================================== --- trunk/src/svn/revision.cpp 2006-10-25 18:59:09 UTC (rev 51) +++ trunk/src/svn/revision.cpp 2006-10-25 23:47:09 UTC (rev 52) @@ -24,48 +24,42 @@ Revision::Revision() { - mIsCommitted = false; - mCommittedRevision = -1; + mType = Uncommitted; } Revision::~Revision() { } -void Revision::setUncommittedRevision() +Revision::Type Revision::getType() { - mIsCommitted = false; + return mType; } -void Revision::setCommittedRevision(int revision) -{ - mIsCommitted = true; - mCommittedRevision = revision; -} - -bool Revision::isCommittedRevision() -{ - return mIsCommitted; -} - int Revision::getCommittedRevision() { - GSVN_ASSERT(mIsCommitted); + GSVN_ASSERT(mType == Committed); return mCommittedRevision; } svn_opt_revision_t Revision::getSvnRevision() { svn_opt_revision_t svnRev; - if (!isCommittedRevision()) + svnRev.value.number = mCommittedRevision; + switch (mType) { + case Uncommitted: svnRev.kind = svn_opt_revision_working; - svnRev.value.number = 0; - } - else - { + break; + case Committed: svnRev.kind = svn_opt_revision_number; - svnRev.value.number = getCommittedRevision(); + break; + case Base: + svnRev.kind = svn_opt_revision_base; + break; + case Head: + svnRev.kind = svn_opt_revision_head; + break; } return svnRev; } Modified: trunk/tests/svn_test.cpp =================================================================== --- trunk/tests/svn_test.cpp 2006-10-25 18:59:09 UTC (rev 51) +++ trunk/tests/svn_test.cpp 2006-10-25 23:47:09 UTC (rev 52) @@ -41,7 +41,7 @@ svn_client_create_context(&mpCtx, mpContext->getAprPool()); QString rIgnoredError; - Q_ASSERT(Operation::initAuthProviders(mpCtx, *mpContext, rIgnoredError)); + Q_ASSERT(Operation::initAuthProviders(*mpContext, mpCtx, rIgnoredError)); mpCtx->log_msg_func = logMsgCallback; mpCtx->log_msg_baton = this; @@ -58,7 +58,7 @@ { mCurrentCommitMsg = commitMessage; - svn_client_commit_info_t* pCommitInfo; + 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()); @@ -196,7 +196,7 @@ CommitSummary summary; QString rError; Revision rev; - rev.setCommittedRevision(1); + rev = Revision::committed(1); QVERIFY(summary.init(*mpContext, getWcPath(), rev, rError)); const QList<Modification>& mods = summary.modifications(); @@ -205,7 +205,7 @@ QCOMPARE(mods[0].getFilePath(), QString("/first.txt")); QCOMPARE(mods[0].getType(), Modification::Type_Add); - rev.setUncommittedRevision(); + rev = Revision::uncommitted(); QVERIFY(summary.init(*mpContext, getWcPath(), rev, rError)); QCOMPARE(mods.size(), 1); @@ -218,13 +218,13 @@ QString rError; QString filePath; Revision oldRev; - oldRev.setCommittedRevision(1); + oldRev = Revision::committed(1); QVERIFY(RepoFileAccess::getFile(*mpContext, QDir::convertSeparators(getWcPath()+"/first.txt"), oldRev, filePath, rError)); QCOMPARE(getFileContents(filePath), QString("This is the first file")); QVERIFY(filePath != getWcPath()+"/first.txt"); // We should not overwrite the WC copy! Revision newRev; - newRev.setUncommittedRevision(); + newRev = Revision::uncommitted(); QVERIFY(RepoFileAccess::getFile(*mpContext, QDir::convertSeparators(getWcPath()+"/second.txt"), newRev, filePath, rError)); QCOMPARE(filePath, getWcPath()+"/second.txt"); // We should return the WC file path directly if working on uncommitted revisions @@ -244,13 +244,13 @@ { QString rError; Revision rev; - rev.setCommittedRevision(1); + rev = Revision::committed(1); CommitSummary summary; QVERIFY(summary.init(*mpContext, getWcPath(), rev, rError)); - //QCOMPARE(summary.getCommitAuthor(), QString("billfrank")); // TODO: set when committing - //QCOMPARE(summary.getCommitDate(), bogus); // TODO: fill in + //QCOMPARE(summary.getCommitAuthor(), QString("billfrank")); + //QCOMPARE(summary.getCommitDate(), bogus); QCOMPARE(summary.getCommitLogMessage(), QString("first commit")); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-25 18:59:14
|
Revision: 51 http://svn.sourceforge.net/grandmas-svn/?rev=51&view=rev Author: matthiasmiller Date: 2006-10-25 11:59:09 -0700 (Wed, 25 Oct 2006) Log Message: ----------- Several UI tweaks: * fix title on main window * add settings button to main window * allow enter key to open diffs Modified Paths: -------------- trunk/src/dialogs/mainwindow.cpp trunk/ui/mainwindow.ui Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-25 15:20:18 UTC (rev 50) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-25 18:59:09 UTC (rev 51) @@ -96,29 +96,14 @@ #endif connect(mpUi->commitButton, SIGNAL(clicked()), this, SLOT(commit())); - connect(mpUi->changesTreeView, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(diff(const QModelIndex&))); + connect(mpUi->changesTreeView, SIGNAL(activated(const QModelIndex&)), this, SLOT(diff(const QModelIndex&))); connect(mpUi->diffButton, SIGNAL(clicked()), this, SLOT(diff())); connect(mpUi->moveButton, SIGNAL(clicked()), this, SLOT(move())); mpModificationsModel = new ModificationsModel(); mpUi->changesTreeView->setModel(mpModificationsModel); - - reload(); - - const svn_version_t* pVersion = svn_client_version(); - QString msg; - msg += QString::number(pVersion->major); - msg += "."; - msg += QString::number(pVersion->minor); - msg += "."; - msg += QString::number(pVersion->patch); - if (pVersion->tag) - { - msg += "-"; - msg += pVersion->tag; - } - setWindowTitle(tr("Grandma's SVN - ") + msg); + reload(); } MainWindow::~MainWindow() Modified: trunk/ui/mainwindow.ui =================================================================== --- trunk/ui/mainwindow.ui 2006-10-25 15:20:18 UTC (rev 50) +++ trunk/ui/mainwindow.ui 2006-10-25 18:59:09 UTC (rev 51) @@ -104,10 +104,51 @@ </font> </property> <property name="text" > - <string>grandmas-svn</string> + <string>Grandma's SVN</string> </property> </widget> </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" > + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="settingsButton" > + <property name="sizePolicy" > + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text" > + <string>&Settings</string> + </property> + </widget> + </item> </layout> </item> <item> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-25 15:21:19
|
Revision: 50 http://svn.sourceforge.net/grandmas-svn/?rev=50&view=rev Author: matthiasmiller Date: 2006-10-25 08:20:18 -0700 (Wed, 25 Oct 2006) Log Message: ----------- set svn:eol-style to native Modified Paths: -------------- trunk/mingw-install.sh Property Changed: ---------------- trunk/COPYING trunk/Doxyfile trunk/grandmas_svn.kdevelop trunk/grandmas_svn.pro trunk/include/commandline.h trunk/include/debug.h trunk/include/dialogs/commit.h trunk/include/dialogs/core/base.h trunk/include/dialogs/mainwindow.h trunk/include/dialogs/modificationsmodel.h trunk/include/dialogs/move.h trunk/include/dialogs/open.h trunk/include/dialogs/util.h trunk/include/settings/userpaths.h trunk/include/svn/commit_summary.h trunk/include/svn/file_access.h trunk/include/svn/modification.h trunk/include/svn/operation.h trunk/include/svn/operation_internal.h trunk/include/svn/revision.h trunk/include/svn/server_access.h trunk/mingw-install.sh trunk/src/commandline.cpp trunk/src/debug.cpp trunk/src/dialogs/commit.cpp trunk/src/dialogs/core/base.cpp trunk/src/dialogs/mainwindow.cpp trunk/src/dialogs/modificationsmodel.cpp trunk/src/dialogs/move.cpp trunk/src/dialogs/open.cpp trunk/src/dialogs/util.cpp trunk/src/grandmas_svn.cpp trunk/src/grandmas_svn.h trunk/src/main.cpp trunk/src/settings/userpaths.cpp trunk/src/svn/commit_summary.cpp trunk/src/svn/file_access.cpp trunk/src/svn/operation.cpp trunk/src/svn/operation_internal.cpp trunk/src/svn/revision.cpp trunk/src/svn/server_access.cpp trunk/templates/cpp trunk/templates/h trunk/tests/commandlinetest.cpp trunk/tests/commandlinetest.h trunk/tests/svn_test.cpp trunk/tests/svn_test.h trunk/tests/tests.cpp trunk/tests/tests.h trunk/ui/commit.ui trunk/ui/grandmas-svn.qrc trunk/ui/icons/win32.rc trunk/ui/logo/logo-large.svg trunk/ui/logo/logo-small.svg trunk/ui/mainwindow.ui trunk/ui/move.ui trunk/ui/open.ui Property changes on: trunk/COPYING ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/Doxyfile ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/grandmas_svn.kdevelop ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/grandmas_svn.pro ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/commandline.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/debug.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/dialogs/commit.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/dialogs/core/base.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/dialogs/mainwindow.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/dialogs/modificationsmodel.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/dialogs/move.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/dialogs/open.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/dialogs/util.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/settings/userpaths.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/svn/commit_summary.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/svn/file_access.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/svn/modification.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/svn/operation.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/svn/operation_internal.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/svn/revision.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/include/svn/server_access.h ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/mingw-install.sh =================================================================== --- trunk/mingw-install.sh 2006-10-25 13:56:57 UTC (rev 49) +++ trunk/mingw-install.sh 2006-10-25 15:20:18 UTC (rev 50) @@ -1,5 +1,5 @@ -#!/bin/sh - +#!/bin/sh + # This script is used to create a MinGW build environment for the Subversion libraries. DOWNLOAD_DIR="/tmp/svn-mingw-installer" Property changes on: trunk/mingw-install.sh ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/commandline.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/debug.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/dialogs/commit.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/dialogs/core/base.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/dialogs/mainwindow.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/dialogs/modificationsmodel.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/dialogs/move.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/dialogs/open.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/dialogs/util.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/grandmas_svn.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/grandmas_svn.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/main.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/settings/userpaths.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/svn/commit_summary.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/svn/file_access.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/svn/operation.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/svn/operation_internal.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/svn/revision.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/src/svn/server_access.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/templates/cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/templates/h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/tests/commandlinetest.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/tests/commandlinetest.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/tests/svn_test.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/tests/svn_test.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/tests/tests.cpp ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/tests/tests.h ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/ui/commit.ui ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/ui/grandmas-svn.qrc ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/ui/icons/win32.rc ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/ui/logo/logo-large.svg ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/ui/logo/logo-small.svg ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/ui/mainwindow.ui ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/ui/move.ui ___________________________________________________________________ Name: svn:eol-style + native Property changes on: trunk/ui/open.ui ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-25 13:57:11
|
Revision: 49 http://svn.sourceforge.net/grandmas-svn/?rev=49&view=rev Author: matthiasmiller Date: 2006-10-25 06:56:57 -0700 (Wed, 25 Oct 2006) Log Message: ----------- add detection for WinMerge Modified Paths: -------------- trunk/grandmas_svn.pro trunk/src/dialogs/mainwindow.cpp Modified: trunk/grandmas_svn.pro =================================================================== --- trunk/grandmas_svn.pro 2006-10-25 12:13:16 UTC (rev 48) +++ trunk/grandmas_svn.pro 2006-10-25 13:56:57 UTC (rev 49) @@ -80,6 +80,8 @@ -lssl \ -lcrypto \ -lrpcrt4 + + LIBS += -lshlwapi } TARGET = bin/grandmas-svn Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-25 12:13:16 UTC (rev 48) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-25 13:56:57 UTC (rev 49) @@ -32,7 +32,58 @@ #include <QProcess> #include <svn_client.h> +#ifdef Q_WS_WIN +#include <shlwapi.h> +namespace +{ + bool assocQueryString(ASSOCF flags, ASSOCSTR str, QString assoc, QString extra, QString& rOut) + { + // wchar_t must be the same size as QChar + enum { assert_at_compile = 1 / (sizeof(wchar_t) == sizeof(QChar) ? 1 : 0) }; + + wchar_t szOut[MAX_PATH]; + DWORD length = sizeof(szOut); + if (FAILED(AssocQueryString(flags, str, (const wchar_t*)assoc.utf16(), + (const wchar_t*)extra.utf16(), szOut, &length))) + { + return false; + } + + rOut = QString::fromUtf16((ushort *)szOut, -1); + return true; + } + + bool getWinAppForExtension(QString ext, QString& rPath) + { + QString path; + if (!assocQueryString(0, ASSOCSTR_EXECUTABLE, "." + ext, "open", path)) + return false; + + if (path.startsWith("\"")) + { + // extract text between quotes + path.remove(0,1); + + int offset = path.indexOf('"', 1); + if (offset == -1) + return false; + path = path.left(offset); + } + else + { + // extract first word + int offset = path.indexOf(' '); + if (offset != -1) + path = path.left(offset); + } + + rPath = path; + return true; + } +} +#endif + MainWindow::MainWindow(SvnOperationContext* pContext, QString path) : mpModificationsModel(NULL) { mpContext = pContext; @@ -149,7 +200,8 @@ // TODO: This should be configurable. QString app; #if defined(Q_WS_WIN) - app = "winmerge"; + if (!getWinAppForExtension("WinMerge", app)) + return false; #elif defined(Q_WS_MAC) app = "opendiff"; #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-25 12:13:18
|
Revision: 48 http://svn.sourceforge.net/grandmas-svn/?rev=48&view=rev Author: matthiasmiller Date: 2006-10-25 05:13:16 -0700 (Wed, 25 Oct 2006) Log Message: ----------- better way of launching diff utility Modified Paths: -------------- trunk/src/dialogs/mainwindow.cpp trunk/src/svn/operation.cpp Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-25 04:12:01 UTC (rev 47) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-25 12:13:16 UTC (rev 48) @@ -102,7 +102,6 @@ void MainWindow::diff() { - diff(mpUi->changesTreeView->selectionModel()->currentIndex()); } @@ -110,7 +109,7 @@ { if (!rcIndex.isValid()) return; - + // Generate each side of the diff QString error, leftPath, rightPath; Modification mod = mpModificationsModel->getModificationFromIndex(rcIndex); @@ -160,5 +159,8 @@ QStringList args; args.push_back(left); args.push_back(right); - return QProcess::execute(app, args) == 0; + + QProcess* pProcess = new QProcess(this); + pProcess->start(app, args); + return pProcess->waitForStarted(-1); } Modified: trunk/src/svn/operation.cpp =================================================================== --- trunk/src/svn/operation.cpp 2006-10-25 04:12:01 UTC (rev 47) +++ trunk/src/svn/operation.cpp 2006-10-25 12:13:16 UTC (rev 48) @@ -56,6 +56,7 @@ svn_client_get_windows_simple_provider(&provider, rContext.getAprPool()); APR_ARRAY_PUSH(providers,svn_auth_provider_object_t*) = provider; #endif + // TODO: keychain 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()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-25 04:12:05
|
Revision: 47 http://svn.sourceforge.net/grandmas-svn/?rev=47&view=rev Author: matthiasmiller Date: 2006-10-24 21:12:01 -0700 (Tue, 24 Oct 2006) Log Message: ----------- add more auth providers Modified Paths: -------------- trunk/src/svn/operation.cpp Modified: trunk/src/svn/operation.cpp =================================================================== --- trunk/src/svn/operation.cpp 2006-10-25 03:04:43 UTC (rev 46) +++ trunk/src/svn/operation.cpp 2006-10-25 04:12:01 UTC (rev 47) @@ -48,21 +48,30 @@ bool Operation::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 *)); + apr_array_header_t *providers = apr_array_make(rContext.getAprPool(), 7, sizeof(svn_auth_provider_object_t *)); svn_auth_provider_object_t *provider; +#ifdef WIN32 + svn_client_get_windows_simple_provider(&provider, rContext.getAprPool()); + APR_ARRAY_PUSH(providers,svn_auth_provider_object_t*) = provider; +#endif 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; + // The server-cert, client-cert, and client-cert-password providers. + svn_client_get_ssl_server_trust_file_provider(&provider, rContext.getAprPool()); + APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider; + svn_client_get_ssl_client_cert_file_provider(&provider, rContext.getAprPool()); + APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider; + svn_client_get_ssl_client_cert_pw_file_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()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-25 03:04:51
|
Revision: 46 http://svn.sourceforge.net/grandmas-svn/?rev=46&view=rev Author: matthiasmiller Date: 2006-10-24 20:04:43 -0700 (Tue, 24 Oct 2006) Log Message: ----------- integrate diff into the UI Modified Paths: -------------- trunk/include/dialogs/mainwindow.h trunk/include/dialogs/modificationsmodel.h trunk/include/svn/file_access.h trunk/include/svn/modification.h trunk/src/dialogs/mainwindow.cpp trunk/src/dialogs/modificationsmodel.cpp trunk/src/svn/file_access.cpp Modified: trunk/include/dialogs/mainwindow.h =================================================================== --- trunk/include/dialogs/mainwindow.h 2006-10-24 01:39:08 UTC (rev 45) +++ trunk/include/dialogs/mainwindow.h 2006-10-25 03:04:43 UTC (rev 46) @@ -27,6 +27,7 @@ class ModificationsModel; class SvnOperationContext; class Ui_MainWindow; +class QModelIndex; class MainWindow: public QMainWindow { @@ -41,10 +42,13 @@ private slots: void commit(); + void diff(); + void diff(const QModelIndex& rcIndex); void move(); private: void reload(); + bool diffFiles(QString left, QString right); Ui_MainWindow* mpUi; SvnOperationContext* mpContext; Modified: trunk/include/dialogs/modificationsmodel.h =================================================================== --- trunk/include/dialogs/modificationsmodel.h 2006-10-24 01:39:08 UTC (rev 45) +++ trunk/include/dialogs/modificationsmodel.h 2006-10-25 03:04:43 UTC (rev 46) @@ -32,6 +32,8 @@ void showError(QString error); void showModifications(const QList<Modification>& rcModifications, bool includeUnversionedMods); + Modification getModificationFromIndex(const QModelIndex& rcIndex) const; + virtual int columnCount(const QModelIndex &rcParent = QModelIndex()) const; virtual int rowCount(const QModelIndex& rcParent = QModelIndex()) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; Modified: trunk/include/svn/file_access.h =================================================================== --- trunk/include/svn/file_access.h 2006-10-24 01:39:08 UTC (rev 45) +++ trunk/include/svn/file_access.h 2006-10-25 03:04:43 UTC (rev 46) @@ -27,6 +27,7 @@ class RepoFileAccess { public: + static QString getCanonicalPath(SvnOperationContext& rContext, QString workingCopy, QString filePath); static bool getFile(SvnOperationContext& rContext, QString fullRepoPath, Revision rev, QString& rCreatedFilePath, QString& rError); static bool getDiffFiles(SvnOperationContext& rContext, QString fullRepoPath, Revision leftRevision, Revision rightRevision, QString& rLeftFilePath, QString& rRightFilePath, QString& rError); }; Modified: trunk/include/svn/modification.h =================================================================== --- trunk/include/svn/modification.h 2006-10-24 01:39:08 UTC (rev 45) +++ trunk/include/svn/modification.h 2006-10-25 03:04:43 UTC (rev 46) @@ -75,6 +75,9 @@ Q_ASSERT(mType == Type_Move); return mDestFilePath; } + + Revision getOldRevision() const { return mOldRevision; } + Revision getNewRevision() const { return mNewRevision; } private: friend class CommitSummary; Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-24 01:39:08 UTC (rev 45) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-25 03:04:43 UTC (rev 46) @@ -24,9 +24,12 @@ #include "dialogs/modificationsmodel.h" #include "dialogs/move.h" #include "svn/commit_summary.h" +#include "svn/file_access.h" #include "svn/revision.h" #include "ui_mainwindow.h" +#include <QMessageBox> +#include <QProcess> #include <svn_client.h> @@ -42,6 +45,8 @@ #endif connect(mpUi->commitButton, SIGNAL(clicked()), this, SLOT(commit())); + connect(mpUi->changesTreeView, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(diff(const QModelIndex&))); + connect(mpUi->diffButton, SIGNAL(clicked()), this, SLOT(diff())); connect(mpUi->moveButton, SIGNAL(clicked()), this, SLOT(move())); mpModificationsModel = new ModificationsModel(); @@ -95,6 +100,35 @@ dlg.exec(); } +void MainWindow::diff() +{ + + diff(mpUi->changesTreeView->selectionModel()->currentIndex()); +} + +void MainWindow::diff(const QModelIndex& rcIndex) +{ + if (!rcIndex.isValid()) + return; + + // Generate each side of the diff + QString error, leftPath, rightPath; + Modification mod = mpModificationsModel->getModificationFromIndex(rcIndex); + QString fullFilePath = RepoFileAccess::getCanonicalPath(*mpContext, mPath, mod.getFilePath()); + if (!RepoFileAccess::getDiffFiles(*mpContext, fullFilePath, mod.getOldRevision(), mod.getNewRevision(), leftPath, rightPath, error)) + { + QMessageBox::critical(this, "", error); + return; + } + + // Launch the diff + if (!diffFiles(leftPath, rightPath)) + { + QMessageBox::critical(this, tr("The differences could not be displayed."), tr("The comparison program could not be opened.")); + return; + } +} + void MainWindow::move() { MoveDialog dlg(this); @@ -110,3 +144,21 @@ else mpModificationsModel->showError(error); } + +bool MainWindow::diffFiles(QString left, QString right) +{ + // TODO: This should be configurable. + QString app; +#if defined(Q_WS_WIN) + app = "winmerge"; +#elif defined(Q_WS_MAC) + app = "opendiff"; +#else + return false; +#endif + + QStringList args; + args.push_back(left); + args.push_back(right); + return QProcess::execute(app, args) == 0; +} Modified: trunk/src/dialogs/modificationsmodel.cpp =================================================================== --- trunk/src/dialogs/modificationsmodel.cpp 2006-10-24 01:39:08 UTC (rev 45) +++ trunk/src/dialogs/modificationsmodel.cpp 2006-10-25 03:04:43 UTC (rev 46) @@ -81,6 +81,23 @@ emit layoutChanged(); } +Modification ModificationsModel::getModificationFromIndex(const QModelIndex& rcIndex) const +{ + if (!rcIndex.isValid()) + { + GSVN_ASSERT(false); + return Modification(); + } + + if (rcIndex.row() < 0 || rcIndex.row() >= mAllModifications.count()) + { + GSVN_ASSERT(false); + return Modification(); + } + + return mAllModifications.at(rcIndex.row()); +} + int ModificationsModel::columnCount(const QModelIndex &rcParent) const { Q_UNUSED(rcParent); Modified: trunk/src/svn/file_access.cpp =================================================================== --- trunk/src/svn/file_access.cpp 2006-10-24 01:39:08 UTC (rev 45) +++ trunk/src/svn/file_access.cpp 2006-10-25 03:04:43 UTC (rev 46) @@ -22,6 +22,7 @@ #include "svn/operation.h" #include <svn_client.h> +#include <svn_path.h> #include <QDir> @@ -46,6 +47,12 @@ } } +QString RepoFileAccess::getCanonicalPath(SvnOperationContext& rContext, QString workingCopy, QString filePath) +{ + QString path = workingCopy + QDir::separator() + filePath; + return svn_path_canonicalize(path.toAscii(), rContext.getAprPool()); +} + bool RepoFileAccess::getFile(SvnOperationContext& rContext, QString fullRepoPath, Revision rev, QString& rCreatedFilePath, QString& rError) { if (!rev.isCommittedRevision()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-24 01:39:13
|
Revision: 45 http://svn.sourceforge.net/grandmas-svn/?rev=45&view=rev Author: matthiasmiller Date: 2006-10-23 18:39:08 -0700 (Mon, 23 Oct 2006) Log Message: ----------- use anonymous namespaces where appropriate Modified Paths: -------------- trunk/src/debug.cpp trunk/src/main.cpp trunk/src/svn/file_access.cpp Modified: trunk/src/debug.cpp =================================================================== --- trunk/src/debug.cpp 2006-10-24 00:08:09 UTC (rev 44) +++ trunk/src/debug.cpp 2006-10-24 01:39:08 UTC (rev 45) @@ -31,5 +31,5 @@ return false; #endif - return true; + return true; } Modified: trunk/src/main.cpp =================================================================== --- trunk/src/main.cpp 2006-10-24 00:08:09 UTC (rev 44) +++ trunk/src/main.cpp 2006-10-24 01:39:08 UTC (rev 45) @@ -31,52 +31,55 @@ #include <iostream> -class QSvnOperationStatus : public SvnOperationStatus +namespace { -public: - virtual void update(QString textToAdd) + class QSvnOperationStatus : public SvnOperationStatus { - textToAdd = textToAdd; - } + public: + virtual void update(QString textToAdd) + { + textToAdd = textToAdd; + } - virtual bool shouldCancel() - { - return false; - } -}; + virtual bool shouldCancel() + { + return false; + } + }; -class QSvnAuthentication : public SvnAuthentication -{ -public: - virtual bool getAuthentication(QString& rUsername, QString& rPassword) + class QSvnAuthentication : public SvnAuthentication { - rUsername = ""; - rPassword = ""; - return false; - } -}; + public: + virtual bool getAuthentication(QString& rUsername, QString& rPassword) + { + rUsername = ""; + rPassword = ""; + return false; + } + }; -class AprPoolWrapper -{ -public: - AprPoolWrapper() + class AprPoolWrapper { - apr_pool_create(&mPool, NULL); - } - ~AprPoolWrapper() - { - apr_pool_destroy(mPool); - mPool = NULL; - } - - apr_pool_t* getPool() - { - return mPool; - } + public: + AprPoolWrapper() + { + apr_pool_create(&mPool, NULL); + } + ~AprPoolWrapper() + { + apr_pool_destroy(mPool); + mPool = NULL; + } + + apr_pool_t* getPool() + { + return mPool; + } -private: - apr_pool_t* mPool; -}; + private: + apr_pool_t* mPool; + }; +} int main(int argc, char** argv) { Modified: trunk/src/svn/file_access.cpp =================================================================== --- trunk/src/svn/file_access.cpp 2006-10-24 00:08:09 UTC (rev 44) +++ trunk/src/svn/file_access.cpp 2006-10-24 01:39:08 UTC (rev 45) @@ -27,20 +27,23 @@ #include <iostream> -bool getRandomFilePath(QString dirPath, QString filePrefix, QString fileExtension, QString& rFilePath) +namespace { - QString randString; - while (true) + bool getRandomFilePath(QString dirPath, QString filePrefix, QString fileExtension, QString& rFilePath) { - if (!QFile::exists(dirPath+filePrefix+randString+"."+fileExtension)) + QString randString; + while (true) { - rFilePath = dirPath+filePrefix+randString+"."+fileExtension; - return true; + if (!QFile::exists(dirPath+filePrefix+randString+"."+fileExtension)) + { + rFilePath = dirPath+filePrefix+randString+"."+fileExtension; + return true; + } + randString.setNum(rand() % 10000); } - randString.setNum(rand() % 10000); + + return false; } - - return false; } bool RepoFileAccess::getFile(SvnOperationContext& rContext, QString fullRepoPath, Revision rev, QString& rCreatedFilePath, QString& rError) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-24 00:08:13
|
Revision: 44 http://svn.sourceforge.net/grandmas-svn/?rev=44&view=rev Author: matthiasmiller Date: 2006-10-23 17:08:09 -0700 (Mon, 23 Oct 2006) Log Message: ----------- don't show unversioned modifications in the commit dialog Modified Paths: -------------- trunk/include/dialogs/modificationsmodel.h trunk/include/svn/modification.h trunk/src/dialogs/commit.cpp trunk/src/dialogs/mainwindow.cpp trunk/src/dialogs/modificationsmodel.cpp Modified: trunk/include/dialogs/modificationsmodel.h =================================================================== --- trunk/include/dialogs/modificationsmodel.h 2006-10-23 23:52:21 UTC (rev 43) +++ trunk/include/dialogs/modificationsmodel.h 2006-10-24 00:08:09 UTC (rev 44) @@ -30,7 +30,7 @@ virtual ~ModificationsModel(); void showError(QString error); - void showModifications(const QList<Modification>& rcModifications); + void showModifications(const QList<Modification>& rcModifications, bool includeUnversionedMods); virtual int columnCount(const QModelIndex &rcParent = QModelIndex()) const; virtual int rowCount(const QModelIndex& rcParent = QModelIndex()) const; Modified: trunk/include/svn/modification.h =================================================================== --- trunk/include/svn/modification.h 2006-10-23 23:52:21 UTC (rev 43) +++ trunk/include/svn/modification.h 2006-10-24 00:08:09 UTC (rev 44) @@ -46,6 +46,26 @@ Type_Conflicting, }; + static bool isVersionedType(Type type) + { + switch (type) + { + case Type_TextMod: + case Type_Add: + case Type_Delete: + case Type_Move: + case Type_PropMod: + case Type_Copy: + return true; + case Type_New: + case Type_Missing: + case Type_Conflicting: + return false; + default: + return false; + } + } + QString getFilePath() const { return mFilePath; } Type getType() const { return mType; } Modified: trunk/src/dialogs/commit.cpp =================================================================== --- trunk/src/dialogs/commit.cpp 2006-10-23 23:52:21 UTC (rev 43) +++ trunk/src/dialogs/commit.cpp 2006-10-24 00:08:09 UTC (rev 44) @@ -73,7 +73,7 @@ CommitSummary summary; QString error; if (summary.init(*mpContext, mPath, Revision(), error)) - mpModificationsModel->showModifications(summary.modifications()); + mpModificationsModel->showModifications(summary.modifications(), false); else mpModificationsModel->showError(error); Modified: trunk/src/dialogs/mainwindow.cpp =================================================================== --- trunk/src/dialogs/mainwindow.cpp 2006-10-23 23:52:21 UTC (rev 43) +++ trunk/src/dialogs/mainwindow.cpp 2006-10-24 00:08:09 UTC (rev 44) @@ -106,7 +106,7 @@ CommitSummary summary; QString error; if (summary.init(*mpContext, mPath, mDisplayedRevision, error)) - mpModificationsModel->showModifications(summary.modifications()); + mpModificationsModel->showModifications(summary.modifications(), true); else mpModificationsModel->showError(error); } Modified: trunk/src/dialogs/modificationsmodel.cpp =================================================================== --- trunk/src/dialogs/modificationsmodel.cpp 2006-10-23 23:52:21 UTC (rev 43) +++ trunk/src/dialogs/modificationsmodel.cpp 2006-10-24 00:08:09 UTC (rev 44) @@ -29,11 +29,11 @@ { QString mPath, mMoveDestPath; - bool operator==(const DeclinedMod& other) + bool operator==(const DeclinedMod& other) const { return mPath == other.mPath && mMoveDestPath == other.mMoveDestPath; } - bool operator!=(const DeclinedMod& other) + bool operator!=(const DeclinedMod& other) const { return !(*this == other); } @@ -62,10 +62,22 @@ emit layoutChanged(); } -void ModificationsModel::showModifications(const QList<Modification>& rcModifications) +void ModificationsModel::showModifications(const QList<Modification>& rcModifications, bool includeUnversionedMods) { mError = QString(); mAllModifications = rcModifications; + + // filter unversioned modifications + if (!includeUnversionedMods) + { + QMutableListIterator<Modification> i(mAllModifications); + while (i.hasNext()) + { + if (!Modification::isVersionedType(i.next().getType())) + i.remove(); + } + } + emit layoutChanged(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mat...@us...> - 2006-10-23 23:52:25
|
Revision: 43 http://svn.sourceforge.net/grandmas-svn/?rev=43&view=rev Author: matthiasmiller Date: 2006-10-23 16:52:21 -0700 (Mon, 23 Oct 2006) Log Message: ----------- selections in commit dialog should be maintained even if the modification type changes Modified Paths: -------------- trunk/include/dialogs/modificationsmodel.h trunk/include/svn/modification.h trunk/src/dialogs/modificationsmodel.cpp Modified: trunk/include/dialogs/modificationsmodel.h =================================================================== --- trunk/include/dialogs/modificationsmodel.h 2006-10-23 23:39:57 UTC (rev 42) +++ trunk/include/dialogs/modificationsmodel.h 2006-10-23 23:52:21 UTC (rev 43) @@ -50,8 +50,11 @@ bool isCheckboxColumn(int col) const; bool isTypeColumn(int col) const; bool isPathColumn(int col) const; - + + struct DeclinedMod; + QString mError; - QList<Modification> mAllModifications, mDeclinedModifications; + QList<Modification> mAllModifications; + QList<DeclinedMod> mDeclinedModifications; bool mAllowSelections; }; Modified: trunk/include/svn/modification.h =================================================================== --- trunk/include/svn/modification.h 2006-10-23 23:39:57 UTC (rev 42) +++ trunk/include/svn/modification.h 2006-10-23 23:52:21 UTC (rev 43) @@ -46,21 +46,6 @@ Type_Conflicting, }; - bool operator==(const Modification& rcOther) const - { - if (mType != rcOther.mType) return false; - if (mFilePath != rcOther.mFilePath) return false; - if (mDestFilePath != rcOther.mDestFilePath) return false; - if (mOldRevision != rcOther.mOldRevision) return false; - if (mNewRevision != rcOther.mNewRevision) return false; - - return true; - } - bool operator!=(const Modification& rcOther) const - { - return !(*this == rcOther); - } - QString getFilePath() const { return mFilePath; } Type getType() const { return mType; } Modified: trunk/src/dialogs/modificationsmodel.cpp =================================================================== --- trunk/src/dialogs/modificationsmodel.cpp 2006-10-23 23:39:57 UTC (rev 42) +++ trunk/src/dialogs/modificationsmodel.cpp 2006-10-23 23:52:21 UTC (rev 43) @@ -24,6 +24,28 @@ #include <QSize> + +struct ModificationsModel::DeclinedMod +{ + QString mPath, mMoveDestPath; + + bool operator==(const DeclinedMod& other) + { + return mPath == other.mPath && mMoveDestPath == other.mMoveDestPath; + } + bool operator!=(const DeclinedMod& other) + { + return !(*this == other); + } + + static DeclinedMod fromSvnMod(const Modification& mod) + { + DeclinedMod declinedMod = { mod.getFilePath(), mod.getType() == Modification::Type_Move ? mod.getMoveDestFilePath() : QString() }; + return declinedMod; + } +}; + + ModificationsModel::ModificationsModel() : mAllowSelections(false) { } @@ -136,7 +158,7 @@ { if (isCheckboxColumn(rcIndex.column())) { - if (mDeclinedModifications.contains(mod)) + if (mDeclinedModifications.contains(DeclinedMod::fromSvnMod(mod))) return Qt::Unchecked; else return Qt::Checked; @@ -153,7 +175,7 @@ if (isCheckboxColumn(rcIndex.column()) && rcValue.canConvert(QVariant::Bool) && rcIndex.isValid() && rcIndex.row() < mAllModifications.size()) { - Modification mod = mAllModifications.at(rcIndex.row()); + DeclinedMod mod = DeclinedMod::fromSvnMod(mAllModifications.at(rcIndex.row())); if (rcValue.toBool()) { // remove from list of declined mods @@ -165,7 +187,7 @@ if (!mDeclinedModifications.contains(mod)) mDeclinedModifications.push_back(mod); } - + return true; } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |