Gitorious wizard: Import CMake projects, look in src directory.

Remove unused code.
This commit is contained in:
Friedemann Kleint
2009-07-27 09:22:26 +02:00
parent f3a04e7ef6
commit 96940fa949
4 changed files with 41 additions and 20 deletions

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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;