diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-07-21 11:14:48 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-07-21 11:14:48 +0200 |
commit | 9e2f12c73780f5eaf1a11d0d903e9c3c0bae4b68 (patch) | |
tree | 970b7670aa8e5fc6d50e3c12e4805303e0f594ce /src/plugins/git | |
parent | 8908c33398b2ce7e1e15f404cafb7865fd6c5543 (diff) | |
download | qt-creator-9e2f12c73780f5eaf1a11d0d903e9c3c0bae4b68.tar.gz |
VCSBase: Add common functionality, make checkout use page lists.
Move GitClient::filterUntrackedFilesOfProject into submit editor.
Make checkout wizards use page lists for greater flexibility.
Diffstat (limited to 'src/plugins/git')
-rw-r--r-- | src/plugins/git/clonewizard.cpp | 10 | ||||
-rw-r--r-- | src/plugins/git/clonewizard.h | 4 | ||||
-rw-r--r-- | src/plugins/git/gitclient.cpp | 21 |
3 files changed, 9 insertions, 26 deletions
diff --git a/src/plugins/git/clonewizard.cpp b/src/plugins/git/clonewizard.cpp index 80d3112504..03903aa4ff 100644 --- a/src/plugins/git/clonewizard.cpp +++ b/src/plugins/git/clonewizard.cpp @@ -60,18 +60,20 @@ QString CloneWizard::name() const return tr("Git Repository Clone"); } -QWizardPage *CloneWizard::createParameterPage(const QString &path) +QList<QWizardPage*> CloneWizard::createParameterPages(const QString &path) { CloneWizardPage *cwp = new CloneWizardPage; cwp->setPath(path); - return cwp; + QList<QWizardPage*> rc; + rc.push_back(cwp); + return rc; } -QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizard::createJob(const QWizardPage *parameterPage, +QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage*> ¶meterPages, QString *checkoutPath) { // Collect parameters for the clone command. - const CloneWizardPage *cwp = qobject_cast<const CloneWizardPage *>(parameterPage); + const CloneWizardPage *cwp = qobject_cast<const CloneWizardPage *>(parameterPages.front()); QTC_ASSERT(cwp, return QSharedPointer<VCSBase::AbstractCheckoutJob>()) const GitClient *client = GitPlugin::instance()->gitClient(); QStringList args = client->binary(); diff --git a/src/plugins/git/clonewizard.h b/src/plugins/git/clonewizard.h index 2a1c0ff3b5..241be32d75 100644 --- a/src/plugins/git/clonewizard.h +++ b/src/plugins/git/clonewizard.h @@ -47,8 +47,8 @@ public: protected: // BaseCheckoutWizard - virtual QWizardPage *createParameterPage(const QString &path); - virtual QSharedPointer<VCSBase::AbstractCheckoutJob> createJob(const QWizardPage *parameterPage, + virtual QList<QWizardPage*> createParameterPages(const QString &path); + virtual QSharedPointer<VCSBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPages, QString *checkoutPath); }; diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 6b900a5d8f..5c50e52ffd 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -684,25 +684,6 @@ GitClient::StatusResult GitClient::gitStatus(const QString &workingDirectory, return StatusChanged; } -// Filter out untracked files that are not part of the project -static void filterUntrackedFilesOfProject(const QString &repoDir, QStringList *l) -{ - if (l->empty()) - return; - const QStringList nativeProjectFiles = VCSBase::VCSBaseSubmitEditor::currentProjectFiles(true); - if (nativeProjectFiles.empty()) - return; - const QDir repoDirectory(repoDir); - for (QStringList::iterator it = l->begin(); it != l->end(); ) { - const QString path = QDir::toNativeSeparators(repoDirectory.absoluteFilePath(*it)); - if (nativeProjectFiles.contains(path)) { - ++it; - } else { - it = l->erase(it); - } - } -} - bool GitClient::getCommitData(const QString &workingDirectory, QString *commitTemplate, CommitData *d, @@ -771,7 +752,7 @@ bool GitClient::getCommitData(const QString &workingDirectory, return false; } // Filter out untracked files that are not part of the project - filterUntrackedFilesOfProject(repoDirectory, &d->untrackedFiles); + VCSBase::VCSBaseSubmitEditor::filterUntrackedFilesOfProject(repoDirectory, &d->untrackedFiles); if (d->filesEmpty()) { *errorMessage = msgNoChangedFiles(); return false; |