forked from qt-creator/qt-creator
RemoteLinux: Take adavantage of new proParsingDone() signal.
Change-Id: I81aada97401a1f100f5e6c8376c297c8f2f86688 Reviewed-on: http://codereview.qt-project.org/5141 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
@@ -53,8 +53,6 @@ public:
|
|||||||
|
|
||||||
QList<DeployableFilesPerProFile *> listModels;
|
QList<DeployableFilesPerProFile *> listModels;
|
||||||
const Qt4ProjectManager::Qt4BaseTarget * const target;
|
const Qt4ProjectManager::Qt4BaseTarget * const target;
|
||||||
QTimer updateTimer;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
@@ -62,12 +60,7 @@ using namespace Internal;
|
|||||||
|
|
||||||
DeploymentInfo::DeploymentInfo(const Qt4BaseTarget *target) : d(new DeploymentInfoPrivate(target))
|
DeploymentInfo::DeploymentInfo(const Qt4BaseTarget *target) : d(new DeploymentInfoPrivate(target))
|
||||||
{
|
{
|
||||||
Qt4Project * const pro = d->target->qt4Project();
|
connect (d->target->qt4Project(), SIGNAL(proParsingDone()), SLOT(createModels()));
|
||||||
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
|
||||||
SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
|
|
||||||
d->updateTimer.setInterval(1500);
|
|
||||||
d->updateTimer.setSingleShot(true);
|
|
||||||
connect(&d->updateTimer, SIGNAL(timeout()), this, SLOT(createModels()));
|
|
||||||
createModels();
|
createModels();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,13 +69,6 @@ DeploymentInfo::~DeploymentInfo()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeploymentInfo::startTimer(Qt4ProjectManager::Qt4ProFileNode*, bool success, bool parseInProgress)
|
|
||||||
{
|
|
||||||
Q_UNUSED(success)
|
|
||||||
if (!parseInProgress)
|
|
||||||
d->updateTimer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DeploymentInfo::createModels()
|
void DeploymentInfo::createModels()
|
||||||
{
|
{
|
||||||
if (d->target->project()->activeTarget() != d->target)
|
if (d->target->project()->activeTarget() != d->target)
|
||||||
@@ -99,18 +85,13 @@ void DeploymentInfo::createModels()
|
|||||||
= d->target->qt4Project()->rootQt4ProjectNode();
|
= d->target->qt4Project()->rootQt4ProjectNode();
|
||||||
if (!rootNode || rootNode->parseInProgress()) // Can be null right after project creation by wizard.
|
if (!rootNode || rootNode->parseInProgress()) // Can be null right after project creation by wizard.
|
||||||
return;
|
return;
|
||||||
d->updateTimer.stop();
|
disconnect(d->target->qt4Project(), SIGNAL(proParsingDone()), this, SLOT(createModels()));
|
||||||
disconnect(d->target->qt4Project(),
|
|
||||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
|
||||||
this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
|
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
qDeleteAll(d->listModels);
|
qDeleteAll(d->listModels);
|
||||||
d->listModels.clear();
|
d->listModels.clear();
|
||||||
createModels(rootNode);
|
createModels(rootNode);
|
||||||
endResetModel();
|
endResetModel();
|
||||||
connect(d->target->qt4Project(),
|
connect (d->target->qt4Project(), SIGNAL(proParsingDone()), SLOT(createModels()));
|
||||||
SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
|
|
||||||
this, SLOT(startTimer(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeploymentInfo::createModels(const Qt4ProFileNode *proFileNode)
|
void DeploymentInfo::createModels(const Qt4ProFileNode *proFileNode)
|
||||||
|
|||||||
@@ -65,13 +65,12 @@ public:
|
|||||||
DeployableFilesPerProFile *modelAt(int i) const;
|
DeployableFilesPerProFile *modelAt(int i) const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void startTimer(Qt4ProjectManager::Qt4ProFileNode *, bool success, bool parseInProgress);
|
void createModels();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual int rowCount(const QModelIndex &parent) const;
|
virtual int rowCount(const QModelIndex &parent) const;
|
||||||
virtual QVariant data(const QModelIndex &index, int role) const;
|
virtual QVariant data(const QModelIndex &index, int role) const;
|
||||||
|
|
||||||
Q_SLOT void createModels();
|
|
||||||
void createModels(const Qt4ProjectManager::Qt4ProFileNode *proFileNode);
|
void createModels(const Qt4ProjectManager::Qt4ProFileNode *proFileNode);
|
||||||
|
|
||||||
Internal::DeploymentInfoPrivate * const d;
|
Internal::DeploymentInfoPrivate * const d;
|
||||||
|
|||||||
Reference in New Issue
Block a user