forked from qt-creator/qt-creator
Vcs: Use Utils::FileName where possible in the CheckoutWizards
Change-Id: I7e90f2c3468099229620d6713b39b69d8dbe8ff0 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -51,7 +51,7 @@ CloneWizardFactory::CloneWizardFactory()
|
|||||||
setDisplayName(tr("Bazaar Clone (Or Branch)"));
|
setDisplayName(tr("Bazaar Clone (Or Branch)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *CloneWizardFactory::create(const QString &path, QWidget *parent) const
|
VcsBase::BaseCheckoutWizard *CloneWizardFactory::create(const Utils::FileName &path, QWidget *parent) const
|
||||||
{
|
{
|
||||||
return new CloneWizard(path, parent);
|
return new CloneWizard(path, parent);
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ VcsBase::BaseCheckoutWizard *CloneWizardFactory::create(const QString &path, QWi
|
|||||||
// CloneWizard:
|
// CloneWizard:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
CloneWizard::CloneWizard(const QString &path, QWidget *parent) :
|
CloneWizard::CloneWizard(const Utils::FileName &path, QWidget *parent) :
|
||||||
VcsBase::BaseCheckoutWizard(path, parent)
|
VcsBase::BaseCheckoutWizard(path, parent)
|
||||||
{
|
{
|
||||||
setTitle(tr("Cloning"));
|
setTitle(tr("Cloning"));
|
||||||
@@ -70,11 +70,11 @@ CloneWizard::CloneWizard(const QString &path, QWidget *parent) :
|
|||||||
if (!vc->isConfigured())
|
if (!vc->isConfigured())
|
||||||
addPage(new VcsBase::VcsConfigurationPage(vc));
|
addPage(new VcsBase::VcsConfigurationPage(vc));
|
||||||
CloneWizardPage *page = new CloneWizardPage;
|
CloneWizardPage *page = new CloneWizardPage;
|
||||||
page->setPath(path);
|
page->setPath(path.toString());
|
||||||
addPage(page);
|
addPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::Command *CloneWizard::createCommand(QString *checkoutDir)
|
VcsBase::Command *CloneWizard::createCommand(Utils::FileName *checkoutDir)
|
||||||
{
|
{
|
||||||
const CloneWizardPage *cwp = 0;
|
const CloneWizardPage *cwp = 0;
|
||||||
foreach (int pageId, pageIds()) {
|
foreach (int pageId, pageIds()) {
|
||||||
@@ -86,7 +86,7 @@ VcsBase::Command *CloneWizard::createCommand(QString *checkoutDir)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const BazaarSettings &settings = BazaarPlugin::instance()->settings();
|
const BazaarSettings &settings = BazaarPlugin::instance()->settings();
|
||||||
*checkoutDir = cwp->path() + QLatin1Char('/') + cwp->directory();
|
*checkoutDir = Utils::FileName::fromString(cwp->path() + QLatin1Char('/') + cwp->directory());
|
||||||
|
|
||||||
const CloneOptionsPanel *panel = cwp->cloneOptionsPanel();
|
const CloneOptionsPanel *panel = cwp->cloneOptionsPanel();
|
||||||
QStringList extraOptions;
|
QStringList extraOptions;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class CloneWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
|||||||
public:
|
public:
|
||||||
CloneWizardFactory();
|
CloneWizardFactory();
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *create(const QString &path, QWidget *parent = 0) const;
|
VcsBase::BaseCheckoutWizard *create(const Utils::FileName &path, QWidget *parent = 0) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
||||||
@@ -53,10 +53,10 @@ class CloneWizard : public VcsBase::BaseCheckoutWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CloneWizard(const QString &path, QWidget *parent = 0);
|
CloneWizard(const Utils::FileName &path, QWidget *parent = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
VcsBase::Command *createCommand(QString *checkoutDir);
|
VcsBase::Command *createCommand(Utils::FileName *checkoutDir);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ CheckoutWizardFactory::CheckoutWizardFactory()
|
|||||||
setDisplayName(tr("CVS Checkout"));
|
setDisplayName(tr("CVS Checkout"));
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *CheckoutWizardFactory::create(const QString &path, QWidget *parent) const
|
VcsBase::BaseCheckoutWizard *CheckoutWizardFactory::create(const Utils::FileName &path, QWidget *parent) const
|
||||||
{
|
{
|
||||||
return new CheckoutWizard(path, parent);
|
return new CheckoutWizard(path, parent);
|
||||||
}
|
}
|
||||||
@@ -57,18 +57,18 @@ VcsBase::BaseCheckoutWizard *CheckoutWizardFactory::create(const QString &path,
|
|||||||
// CheckoutWizard:
|
// CheckoutWizard:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
CheckoutWizard::CheckoutWizard(const QString &path, QWidget *parent) :
|
CheckoutWizard::CheckoutWizard(const Utils::FileName &path, QWidget *parent) :
|
||||||
VcsBase::BaseCheckoutWizard(path, parent)
|
VcsBase::BaseCheckoutWizard(path, parent)
|
||||||
{
|
{
|
||||||
const Core::IVersionControl *vc = CvsPlugin::instance()->versionControl();
|
const Core::IVersionControl *vc = CvsPlugin::instance()->versionControl();
|
||||||
if (!vc->isConfigured())
|
if (!vc->isConfigured())
|
||||||
addPage(new VcsBase::VcsConfigurationPage(vc));
|
addPage(new VcsBase::VcsConfigurationPage(vc));
|
||||||
CheckoutWizardPage *cwp = new CheckoutWizardPage;
|
CheckoutWizardPage *cwp = new CheckoutWizardPage;
|
||||||
cwp->setPath(path);
|
cwp->setPath(path.toString());
|
||||||
addPage(cwp);
|
addPage(cwp);
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::Command *CheckoutWizard::createCommand(QString *checkoutDir)
|
VcsBase::Command *CheckoutWizard::createCommand(Utils::FileName *checkoutDir)
|
||||||
{
|
{
|
||||||
// Collect parameters for the checkout command.
|
// Collect parameters for the checkout command.
|
||||||
// CVS does not allow for checking out into a different directory.
|
// CVS does not allow for checking out into a different directory.
|
||||||
@@ -86,7 +86,7 @@ VcsBase::Command *CheckoutWizard::createCommand(QString *checkoutDir)
|
|||||||
const QString repository = cwp->repository();
|
const QString repository = cwp->repository();
|
||||||
args << QLatin1String("checkout") << repository;
|
args << QLatin1String("checkout") << repository;
|
||||||
const QString workingDirectory = cwp->path();
|
const QString workingDirectory = cwp->path();
|
||||||
*checkoutDir = workingDirectory + QLatin1Char('/') + repository;
|
*checkoutDir = Utils::FileName::fromString(workingDirectory + QLatin1Char('/') + repository);
|
||||||
|
|
||||||
VcsBase::Command *command = new VcsBase::Command(binary, workingDirectory,
|
VcsBase::Command *command = new VcsBase::Command(binary, workingDirectory,
|
||||||
QProcessEnvironment::systemEnvironment());
|
QProcessEnvironment::systemEnvironment());
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class CheckoutWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
|||||||
public:
|
public:
|
||||||
CheckoutWizardFactory();
|
CheckoutWizardFactory();
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *create(const QString &path, QWidget *parent = 0) const;
|
VcsBase::BaseCheckoutWizard *create(const Utils::FileName &path, QWidget *parent = 0) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
||||||
@@ -51,10 +51,10 @@ class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CheckoutWizard(const QString &path, QWidget *parent = 0);
|
CheckoutWizard(const Utils::FileName &path, QWidget *parent = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
VcsBase::Command *createCommand(QString *checkoutDir);
|
VcsBase::Command *createCommand(Utils::FileName *checkoutDir);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ CloneWizardFactory::CloneWizardFactory()
|
|||||||
setDisplayName(tr("Git Repository Clone"));
|
setDisplayName(tr("Git Repository Clone"));
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *CloneWizardFactory::create(const QString &path, QWidget *parent) const
|
VcsBase::BaseCheckoutWizard *CloneWizardFactory::create(const Utils::FileName &path, QWidget *parent) const
|
||||||
{
|
{
|
||||||
return new CloneWizard(path, parent);
|
return new CloneWizard(path, parent);
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ VcsBase::BaseCheckoutWizard *CloneWizardFactory::create(const QString &path, QWi
|
|||||||
// CloneWizard:
|
// CloneWizard:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
CloneWizard::CloneWizard(const QString &path, QWidget *parent) :
|
CloneWizard::CloneWizard(const Utils::FileName &path, QWidget *parent) :
|
||||||
VcsBase::BaseCheckoutWizard(path, parent)
|
VcsBase::BaseCheckoutWizard(path, parent)
|
||||||
{
|
{
|
||||||
setTitle(tr("Cloning"));
|
setTitle(tr("Cloning"));
|
||||||
@@ -67,11 +67,11 @@ CloneWizard::CloneWizard(const QString &path, QWidget *parent) :
|
|||||||
if (!vc->isConfigured())
|
if (!vc->isConfigured())
|
||||||
addPage(new VcsBase::VcsConfigurationPage(vc));
|
addPage(new VcsBase::VcsConfigurationPage(vc));
|
||||||
CloneWizardPage *cwp = new CloneWizardPage;
|
CloneWizardPage *cwp = new CloneWizardPage;
|
||||||
cwp->setPath(path);
|
cwp->setPath(path.toString());
|
||||||
addPage(cwp);
|
addPage(cwp);
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::Command *CloneWizard::createCommand(QString *checkoutDir)
|
VcsBase::Command *CloneWizard::createCommand(Utils::FileName *checkoutDir)
|
||||||
{
|
{
|
||||||
// Collect parameters for the clone command.
|
// Collect parameters for the clone command.
|
||||||
const CloneWizardPage *cwp = 0;
|
const CloneWizardPage *cwp = 0;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class CloneWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
|||||||
public:
|
public:
|
||||||
CloneWizardFactory();
|
CloneWizardFactory();
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *create(const QString &path, QWidget *parent = 0) const;
|
VcsBase::BaseCheckoutWizard *create(const Utils::FileName &path, QWidget *parent = 0) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
class CloneWizard : public VcsBase::BaseCheckoutWizard
|
||||||
@@ -51,10 +51,10 @@ class CloneWizard : public VcsBase::BaseCheckoutWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CloneWizard(const QString &path, QWidget *parent = 0);
|
CloneWizard(const Utils::FileName &path, QWidget *parent = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
VcsBase::Command *createCommand(QString *checkoutDir);
|
VcsBase::Command *createCommand(Utils::FileName *checkoutDir);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -118,12 +118,12 @@ QString CloneWizardPage::directoryFromRepository(const QString &urlIn) const
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::Command *CloneWizardPage::createCheckoutJob(QString *checkoutPath) const
|
VcsBase::Command *CloneWizardPage::createCheckoutJob(Utils::FileName *checkoutPath) const
|
||||||
{
|
{
|
||||||
const Internal::GitClient *client = Internal::GitPlugin::instance()->gitClient();
|
const Internal::GitClient *client = Internal::GitPlugin::instance()->gitClient();
|
||||||
const QString workingDirectory = path();
|
const QString workingDirectory = path();
|
||||||
const QString checkoutDir = directory();
|
const QString checkoutDir = directory();
|
||||||
*checkoutPath = workingDirectory + QLatin1Char('/') + checkoutDir;
|
*checkoutPath = Utils::FileName::fromString(workingDirectory + QLatin1Char('/') + checkoutDir);
|
||||||
|
|
||||||
const QString checkoutBranch = branch();
|
const QString checkoutBranch = branch();
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include <vcsbase/basecheckoutwizardpage.h>
|
#include <vcsbase/basecheckoutwizardpage.h>
|
||||||
|
|
||||||
#include <QSharedPointer>
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
namespace VcsBase { class Command; }
|
namespace VcsBase { class Command; }
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ public:
|
|||||||
explicit CloneWizardPage(QWidget *parent = 0);
|
explicit CloneWizardPage(QWidget *parent = 0);
|
||||||
~CloneWizardPage();
|
~CloneWizardPage();
|
||||||
|
|
||||||
VcsBase::Command *createCheckoutJob(QString *checkoutPath) const;
|
VcsBase::Command *createCheckoutJob(Utils::FileName *checkoutPath) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QString directoryFromRepository(const QString &r) const;
|
QString directoryFromRepository(const QString &r) const;
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ GitoriousCloneWizardFactory::GitoriousCloneWizardFactory()
|
|||||||
setDisplayName(tr("Gitorious Repository Clone"));
|
setDisplayName(tr("Gitorious Repository Clone"));
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *GitoriousCloneWizardFactory::create(const QString &path, QWidget *parent) const
|
VcsBase::BaseCheckoutWizard *GitoriousCloneWizardFactory::create(const Utils::FileName &path, QWidget *parent) const
|
||||||
{
|
{
|
||||||
return new GitoriousCloneWizard(path, parent);
|
return new GitoriousCloneWizard(path, parent);
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ VcsBase::BaseCheckoutWizard *GitoriousCloneWizardFactory::create(const QString &
|
|||||||
// GitoriousCloneWizard:
|
// GitoriousCloneWizard:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
GitoriousCloneWizard::GitoriousCloneWizard(const QString &path, QWidget *parent) :
|
GitoriousCloneWizard::GitoriousCloneWizard(const Utils::FileName &path, QWidget *parent) :
|
||||||
VcsBase::BaseCheckoutWizard(path, parent)
|
VcsBase::BaseCheckoutWizard(path, parent)
|
||||||
{
|
{
|
||||||
setTitle(tr("Cloning"));
|
setTitle(tr("Cloning"));
|
||||||
@@ -100,7 +100,7 @@ GitoriousCloneWizard::GitoriousCloneWizard(const QString &path, QWidget *parent)
|
|||||||
GitoriousProjectWizardPage *projectPage = new GitoriousProjectWizardPage(hostPage);
|
GitoriousProjectWizardPage *projectPage = new GitoriousProjectWizardPage(hostPage);
|
||||||
GitoriousRepositoryWizardPage *repoPage = new GitoriousRepositoryWizardPage(projectPage);
|
GitoriousRepositoryWizardPage *repoPage = new GitoriousRepositoryWizardPage(projectPage);
|
||||||
GitoriousCloneWizardPage *clonePage = new GitoriousCloneWizardPage(repoPage);
|
GitoriousCloneWizardPage *clonePage = new GitoriousCloneWizardPage(repoPage);
|
||||||
clonePage->setPath(path);
|
clonePage->setPath(path.toString());
|
||||||
|
|
||||||
addPage(hostPage);
|
addPage(hostPage);
|
||||||
addPage(projectPage);
|
addPage(projectPage);
|
||||||
@@ -108,7 +108,7 @@ GitoriousCloneWizard::GitoriousCloneWizard(const QString &path, QWidget *parent)
|
|||||||
addPage(clonePage);
|
addPage(clonePage);
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::Command *GitoriousCloneWizard::createCommand(QString *checkoutDir)
|
VcsBase::Command *GitoriousCloneWizard::createCommand(Utils::FileName *checkoutDir)
|
||||||
{
|
{
|
||||||
const Git::CloneWizardPage *cwp = 0;
|
const Git::CloneWizardPage *cwp = 0;
|
||||||
foreach (int pageId, pageIds()) {
|
foreach (int pageId, pageIds()) {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class GitoriousCloneWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
|||||||
public:
|
public:
|
||||||
GitoriousCloneWizardFactory();
|
GitoriousCloneWizardFactory();
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *create(const QString &path, QWidget *parent = 0) const;
|
VcsBase::BaseCheckoutWizard *create(const Utils::FileName &path, QWidget *parent = 0) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GitoriousCloneWizard : public VcsBase::BaseCheckoutWizard
|
class GitoriousCloneWizard : public VcsBase::BaseCheckoutWizard
|
||||||
@@ -53,10 +53,10 @@ class GitoriousCloneWizard : public VcsBase::BaseCheckoutWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GitoriousCloneWizard(const QString &path, QWidget *parent = 0);
|
GitoriousCloneWizard(const Utils::FileName &path, QWidget *parent = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
VcsBase::Command *createCommand(QString *checkoutDir);
|
VcsBase::Command *createCommand(Utils::FileName *checkoutDir);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ CloneWizardFactory::CloneWizardFactory()
|
|||||||
setDisplayName(tr("Mercurial Clone"));
|
setDisplayName(tr("Mercurial Clone"));
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseCheckoutWizard *CloneWizardFactory::create(const QString &path, QWidget *parent) const
|
BaseCheckoutWizard *CloneWizardFactory::create(const Utils::FileName &path, QWidget *parent) const
|
||||||
{
|
{
|
||||||
return new CloneWizard(path, parent);
|
return new CloneWizard(path, parent);
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@ BaseCheckoutWizard *CloneWizardFactory::create(const QString &path, QWidget *par
|
|||||||
// CloneWizard:
|
// CloneWizard:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
CloneWizard::CloneWizard(const QString &path, QWidget *parent) :
|
CloneWizard::CloneWizard(const Utils::FileName &path, QWidget *parent) :
|
||||||
VcsBase::BaseCheckoutWizard(path, parent)
|
VcsBase::BaseCheckoutWizard(path, parent)
|
||||||
{
|
{
|
||||||
setTitle(tr("Cloning"));
|
setTitle(tr("Cloning"));
|
||||||
@@ -67,11 +67,11 @@ CloneWizard::CloneWizard(const QString &path, QWidget *parent) :
|
|||||||
if (!vc->isConfigured())
|
if (!vc->isConfigured())
|
||||||
addPage(new VcsConfigurationPage(vc));
|
addPage(new VcsConfigurationPage(vc));
|
||||||
CloneWizardPage *page = new CloneWizardPage;
|
CloneWizardPage *page = new CloneWizardPage;
|
||||||
page->setPath(path);
|
page->setPath(path.toString());
|
||||||
addPage(page);
|
addPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
Command *CloneWizard::createCommand(QString *checkoutDir)
|
Command *CloneWizard::createCommand(Utils::FileName *checkoutDir)
|
||||||
{
|
{
|
||||||
const CloneWizardPage *cwp = 0;
|
const CloneWizardPage *cwp = 0;
|
||||||
foreach (int pageId, pageIds()) {
|
foreach (int pageId, pageIds()) {
|
||||||
@@ -89,7 +89,7 @@ Command *CloneWizard::createCommand(QString *checkoutDir)
|
|||||||
|
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("clone") << cwp->repository() << directory;
|
args << QLatin1String("clone") << cwp->repository() << directory;
|
||||||
*checkoutDir = path + QLatin1Char('/') + directory;
|
*checkoutDir = Utils::FileName::fromString(path + QLatin1Char('/') + directory);
|
||||||
VcsBase::Command *command = new VcsBase::Command(settings.binaryPath(), path,
|
VcsBase::Command *command = new VcsBase::Command(settings.binaryPath(), path,
|
||||||
QProcessEnvironment::systemEnvironment());
|
QProcessEnvironment::systemEnvironment());
|
||||||
command->addJob(args, -1);
|
command->addJob(args, -1);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class CloneWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
|||||||
public:
|
public:
|
||||||
CloneWizardFactory();
|
CloneWizardFactory();
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *create(const QString &path, QWidget *parent = 0) const;
|
VcsBase::BaseCheckoutWizard *create(const Utils::FileName &path, QWidget *parent = 0) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QIcon m_icon;
|
const QIcon m_icon;
|
||||||
@@ -56,10 +56,10 @@ class CloneWizard : public VcsBase::BaseCheckoutWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CloneWizard(const QString &path, QWidget *parent = 0);
|
CloneWizard(const Utils::FileName &path, QWidget *parent = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
VcsBase::Command *createCommand(QString *checkoutDir);
|
VcsBase::Command *createCommand(Utils::FileName *checkoutDir);
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace Internal
|
} //namespace Internal
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ CheckoutWizardFactory::CheckoutWizardFactory()
|
|||||||
setDisplayName(tr("Subversion Checkout"));
|
setDisplayName(tr("Subversion Checkout"));
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *CheckoutWizardFactory::create(const QString &path, QWidget *parent) const
|
VcsBase::BaseCheckoutWizard *CheckoutWizardFactory::create(const Utils::FileName &path, QWidget *parent) const
|
||||||
{
|
{
|
||||||
return new CheckoutWizard(path, parent);
|
return new CheckoutWizard(path, parent);
|
||||||
}
|
}
|
||||||
@@ -60,18 +60,18 @@ VcsBase::BaseCheckoutWizard *CheckoutWizardFactory::create(const QString &path,
|
|||||||
// CheckoutWizard:
|
// CheckoutWizard:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
CheckoutWizard::CheckoutWizard(const QString &path, QWidget *parent) :
|
CheckoutWizard::CheckoutWizard(const Utils::FileName &path, QWidget *parent) :
|
||||||
VcsBase::BaseCheckoutWizard(path, parent)
|
VcsBase::BaseCheckoutWizard(path, parent)
|
||||||
{
|
{
|
||||||
const Core::IVersionControl *vc = SubversionPlugin::instance()->versionControl();
|
const Core::IVersionControl *vc = SubversionPlugin::instance()->versionControl();
|
||||||
if (!vc->isConfigured())
|
if (!vc->isConfigured())
|
||||||
addPage(new VcsBase::VcsConfigurationPage(vc));
|
addPage(new VcsBase::VcsConfigurationPage(vc));
|
||||||
CheckoutWizardPage *cwp = new CheckoutWizardPage;
|
CheckoutWizardPage *cwp = new CheckoutWizardPage;
|
||||||
cwp->setPath(path);
|
cwp->setPath(path.toString());
|
||||||
addPage(cwp);
|
addPage(cwp);
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsBase::Command *CheckoutWizard::createCommand(QString *checkoutDir)
|
VcsBase::Command *CheckoutWizard::createCommand(Utils::FileName *checkoutDir)
|
||||||
{
|
{
|
||||||
// Collect parameters for the checkout command.
|
// Collect parameters for the checkout command.
|
||||||
const CheckoutWizardPage *cwp = 0;
|
const CheckoutWizardPage *cwp = 0;
|
||||||
@@ -88,7 +88,7 @@ VcsBase::Command *CheckoutWizard::createCommand(QString *checkoutDir)
|
|||||||
args << QLatin1String("checkout") << cwp->repository() << directory;
|
args << QLatin1String("checkout") << cwp->repository() << directory;
|
||||||
const QString workingDirectory = cwp->path();
|
const QString workingDirectory = cwp->path();
|
||||||
|
|
||||||
*checkoutDir = workingDirectory + QLatin1Char('/') + directory;
|
*checkoutDir = Utils::FileName::fromString(workingDirectory + QLatin1Char('/') + directory);
|
||||||
|
|
||||||
if (settings.hasAuthentication()) {
|
if (settings.hasAuthentication()) {
|
||||||
const QString user = settings.stringValue(SubversionSettings::userKey);
|
const QString user = settings.stringValue(SubversionSettings::userKey);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class CheckoutWizardFactory : public VcsBase::BaseCheckoutWizardFactory
|
|||||||
public:
|
public:
|
||||||
CheckoutWizardFactory();
|
CheckoutWizardFactory();
|
||||||
|
|
||||||
VcsBase::BaseCheckoutWizard *create(const QString &path, QWidget *parent = 0) const;
|
VcsBase::BaseCheckoutWizard *create(const Utils::FileName &path, QWidget *parent = 0) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
||||||
@@ -51,10 +51,10 @@ class CheckoutWizard : public VcsBase::BaseCheckoutWizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CheckoutWizard(const QString &path, QWidget *parent = 0);
|
CheckoutWizard(const Utils::FileName &path, QWidget *parent = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
VcsBase::Command *createCommand(QString *checkoutDir);
|
VcsBase::Command *createCommand(Utils::FileName *checkoutDir);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
namespace VcsBase {
|
namespace VcsBase {
|
||||||
|
|
||||||
BaseCheckoutWizard::BaseCheckoutWizard(const QString &path, QWidget *parent) :
|
BaseCheckoutWizard::BaseCheckoutWizard(const Utils::FileName &path, QWidget *parent) :
|
||||||
Utils::Wizard(parent),
|
Utils::Wizard(parent),
|
||||||
m_progressPage(new Internal::CheckoutProgressWizardPage),
|
m_progressPage(new Internal::CheckoutProgressWizardPage),
|
||||||
m_progressPageId(-1)
|
m_progressPageId(-1)
|
||||||
@@ -86,13 +86,13 @@ void BaseCheckoutWizard::slotTerminated(bool success)
|
|||||||
button(QWizard::BackButton)->setEnabled(true);
|
button(QWizard::BackButton)->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BaseCheckoutWizard::run()
|
Utils::FileName BaseCheckoutWizard::run()
|
||||||
{
|
{
|
||||||
m_progressPageId = addPage(m_progressPage);
|
m_progressPageId = addPage(m_progressPage);
|
||||||
if (Utils::Wizard::exec() == QDialog::Accepted)
|
if (Utils::Wizard::exec() == QDialog::Accepted)
|
||||||
return m_checkoutDir;
|
return m_checkoutDir;
|
||||||
else
|
else
|
||||||
return QString();
|
return Utils::FileName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseCheckoutWizard::reject()
|
void BaseCheckoutWizard::reject()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "vcsbase_global.h"
|
#include "vcsbase_global.h"
|
||||||
|
|
||||||
#include <QList>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/wizard.h>
|
#include <utils/wizard.h>
|
||||||
|
|
||||||
namespace VcsBase {
|
namespace VcsBase {
|
||||||
@@ -45,15 +45,15 @@ class VCSBASE_EXPORT BaseCheckoutWizard : public Utils::Wizard
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BaseCheckoutWizard(const QString &path, QWidget *parent = 0);
|
explicit BaseCheckoutWizard(const Utils::FileName &path, QWidget *parent = 0);
|
||||||
|
|
||||||
void setTitle(const QString &title);
|
void setTitle(const QString &title);
|
||||||
void setStartedStatus(const QString &title);
|
void setStartedStatus(const QString &title);
|
||||||
|
|
||||||
QString run();
|
Utils::FileName run();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual VcsBase::Command *createCommand(QString *checkoutDir) = 0;
|
virtual VcsBase::Command *createCommand(Utils::FileName *checkoutDir) = 0;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotPageChanged(int id);
|
void slotPageChanged(int id);
|
||||||
@@ -63,7 +63,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
Internal::CheckoutProgressWizardPage *m_progressPage;
|
Internal::CheckoutProgressWizardPage *m_progressPage;
|
||||||
int m_progressPageId;
|
int m_progressPageId;
|
||||||
QString m_checkoutDir;
|
Utils::FileName m_checkoutDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace VcsBase
|
} // namespace VcsBase
|
||||||
|
|||||||
@@ -34,11 +34,13 @@
|
|||||||
|
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
|
||||||
|
#include <utils/fileutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QScopedPointer>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class VcsBase::BaseCheckoutWizard
|
\class VcsBase::BaseCheckoutWizard
|
||||||
@@ -79,9 +81,9 @@ void BaseCheckoutWizardFactory::runWizard(const QString &path, QWidget *parent,
|
|||||||
Q_UNUSED(extraValues);
|
Q_UNUSED(extraValues);
|
||||||
// Create dialog and launch
|
// Create dialog and launch
|
||||||
|
|
||||||
QString checkoutPath;
|
Utils::FileName checkoutPath;
|
||||||
{
|
{
|
||||||
QScopedPointer<BaseCheckoutWizard> wizard(create(path, parent));
|
QScopedPointer<BaseCheckoutWizard> wizard(create(Utils::FileName::fromString(path), parent));
|
||||||
wizard->setWindowTitle(displayName());
|
wizard->setWindowTitle(displayName());
|
||||||
checkoutPath = wizard->run();
|
checkoutPath = wizard->run();
|
||||||
}
|
}
|
||||||
@@ -94,7 +96,7 @@ void BaseCheckoutWizardFactory::runWizard(const QString &path, QWidget *parent,
|
|||||||
const QString projectFile = openProject(checkoutPath, &errorMessage);
|
const QString projectFile = openProject(checkoutPath, &errorMessage);
|
||||||
if (projectFile.isEmpty()) {
|
if (projectFile.isEmpty()) {
|
||||||
QMessageBox msgBox(QMessageBox::Warning, tr("Cannot Open Project"),
|
QMessageBox msgBox(QMessageBox::Warning, tr("Cannot Open Project"),
|
||||||
tr("Failed to open project in \"%1\".").arg(QDir::toNativeSeparators(checkoutPath)));
|
tr("Failed to open project in \"%1\".").arg(checkoutPath.toUserOutput()));
|
||||||
msgBox.setDetailedText(errorMessage);
|
msgBox.setDetailedText(errorMessage);
|
||||||
msgBox.addButton(QMessageBox::Ok);
|
msgBox.addButton(QMessageBox::Ok);
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
@@ -129,13 +131,13 @@ static QFileInfoList findProjectFiles(const QDir &projectDir, QString *errorMess
|
|||||||
return projectFiles;
|
return projectFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString BaseCheckoutWizardFactory::openProject(const QString &path, QString *errorMessage)
|
QString BaseCheckoutWizardFactory::openProject(const Utils::FileName &path, QString *errorMessage)
|
||||||
{
|
{
|
||||||
// Search the directory for project files
|
// Search the directory for project files
|
||||||
const QDir dir(path);
|
const QDir dir(path.toString());
|
||||||
if (!dir.exists()) {
|
if (!dir.exists()) {
|
||||||
*errorMessage = tr("\"%1\" does not exist.").
|
*errorMessage = tr("\"%1\" does not exist.").
|
||||||
arg(QDir::toNativeSeparators(path)); // Should not happen
|
arg(path.toUserOutput()); // Should not happen
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
QFileInfoList projectFiles = findProjectFiles(dir, errorMessage);
|
QFileInfoList projectFiles = findProjectFiles(dir, errorMessage);
|
||||||
|
|||||||
@@ -33,12 +33,7 @@
|
|||||||
#include "vcsbase_global.h"
|
#include "vcsbase_global.h"
|
||||||
#include <coreplugin/iwizardfactory.h>
|
#include <coreplugin/iwizardfactory.h>
|
||||||
|
|
||||||
#include <QSharedPointer>
|
#include <utils/fileutils.h>
|
||||||
#include <QList>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QWizardPage;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace VcsBase {
|
namespace VcsBase {
|
||||||
class BaseCheckoutWizard;
|
class BaseCheckoutWizard;
|
||||||
@@ -53,9 +48,9 @@ public:
|
|||||||
|
|
||||||
void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
|
||||||
|
|
||||||
static QString openProject(const QString &path, QString *errorMessage);
|
static QString openProject(const Utils::FileName &path, QString *errorMessage);
|
||||||
|
|
||||||
virtual BaseCheckoutWizard *create(const QString &path, QWidget *parent = 0) const = 0;
|
virtual BaseCheckoutWizard *create(const Utils::FileName &path, QWidget *parent = 0) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace VcsBase
|
} // namespace VcsBase
|
||||||
|
|||||||
Reference in New Issue
Block a user