forked from qt-creator/qt-creator
Gitorious wizard: Import CMake projects, look in src directory.
Remove unused code.
This commit is contained in:
@@ -46,8 +46,6 @@
|
||||
|
||||
enum { debug = 0 };
|
||||
|
||||
enum { NewDummyEntryRole = Qt::UserRole + 1 };
|
||||
|
||||
namespace Gitorious {
|
||||
namespace Internal {
|
||||
|
||||
@@ -164,9 +162,7 @@ void GitoriousHostWidget::selectRow(int r)
|
||||
void GitoriousHostWidget::appendNewDummyEntry()
|
||||
{
|
||||
// Append a new entry where a host name is editable
|
||||
const QList<QStandardItem *> dummyRow = hostEntry(m_newHost, 0, QString(), true);
|
||||
dummyRow.front()->setData(QVariant(true), NewDummyEntryRole);
|
||||
m_model->appendRow(dummyRow);
|
||||
m_model->appendRow(hostEntry(m_newHost, 0, QString(), true));
|
||||
}
|
||||
|
||||
void GitoriousHostWidget::slotItemEdited(QStandardItem *item)
|
||||
@@ -180,7 +176,6 @@ void GitoriousHostWidget::slotItemEdited(QStandardItem *item)
|
||||
case HostNameColumn:
|
||||
if (isDummyEntry) {
|
||||
Gitorious::instance().addHost(item->text(), m_model->item(row, DescriptionColumn)->text());
|
||||
item->setData(QVariant(false), NewDummyEntryRole);
|
||||
m_isHostListDirty = true;
|
||||
appendNewDummyEntry();
|
||||
selectRow(row);
|
||||
|
||||
@@ -68,11 +68,12 @@ void GitoriousProjectWizardPage::initializePage()
|
||||
{
|
||||
// Try to find the page by hostindex
|
||||
const int hostIndex = m_hostPage->selectedHostIndex();
|
||||
const int existingStackIndex = hostIndexToStackIndex(hostIndex);
|
||||
const QString hostName = Gitorious::instance().hostName(hostIndex);
|
||||
const int existingStackIndex = stackIndexOf(hostName);
|
||||
// Found? - pop up that page
|
||||
if (existingStackIndex != -1) {
|
||||
m_stackedWidget->setCurrentIndex(existingStackIndex);
|
||||
setSubTitle(msgChooseProject(selectedHostName()));
|
||||
setSubTitle(msgChooseProject(hostName));
|
||||
return;
|
||||
}
|
||||
// Add a new page
|
||||
@@ -119,12 +120,12 @@ GitoriousProjectWidget *GitoriousProjectWizardPage::currentProjectWidget() const
|
||||
return projectWidgetAt(index);
|
||||
}
|
||||
|
||||
// Convert a host index to a stack index.
|
||||
int GitoriousProjectWizardPage::hostIndexToStackIndex(int hostIndex) const
|
||||
// Convert a host name to a stack index.
|
||||
int GitoriousProjectWizardPage::stackIndexOf(const QString &hostName) const
|
||||
{
|
||||
const int count = m_stackedWidget->count();
|
||||
for(int i = 0; i < count; i++)
|
||||
if (projectWidgetAt(i)->hostIndex() == hostIndex)
|
||||
if (projectWidgetAt(i)->hostName() == hostName)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ private slots:
|
||||
private:
|
||||
GitoriousProjectWidget *projectWidgetAt(int index) const;
|
||||
GitoriousProjectWidget *currentProjectWidget() const;
|
||||
int hostIndexToStackIndex(int hostIndex) const;
|
||||
int stackIndexOf(const QString &hostName) const;
|
||||
|
||||
const GitoriousHostWizardPage *m_hostPage;
|
||||
QStackedWidget *m_stackedWidget;
|
||||
|
||||
Reference in New Issue
Block a user