1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

Uncrustify

This commit is contained in:
Oleg Semyonov 2013-06-22 14:24:47 +03:00
parent 54eb5d8894
commit 8325cc3be7
8 changed files with 23 additions and 28 deletions

View File

@ -195,7 +195,8 @@ void ConfigStabilizationWidget::processLinkedWidgets(QWidget *widget)
void ConfigStabilizationWidget::onBoardConnected()
{
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
UAVObjectUtilManager *utilMngr = pm->getObject<UAVObjectUtilManager>();
Q_ASSERT(utilMngr);
// If Revolution board enable misc tab, otherwise disable it

View File

@ -39,7 +39,6 @@ class QWidget;
QT_END_NAMESPACE
namespace Core {
class CORE_EXPORT IOptionsPage : public QObject {
Q_OBJECT
@ -89,13 +88,11 @@ public:
public slots:
virtual void updateState()
{
};
{};
private:
QIcon m_icon;
};
} // namespace Core
#endif // IOPTIONSPAGE_H

View File

@ -177,8 +177,9 @@ Q_DECLARE_METATYPE(::PageData) SettingsDialog::SettingsDialog(QWidget *parent, c
QTreeWidgetItem *initialItem = 0;
// add plugin pages
foreach(IOptionsPage *page, pluginPages) {
foreach(IOptionsPage * page, pluginPages) {
QTreeWidgetItem *item = addPage(page);
// automatically expand all plugin categories
item->parent()->setExpanded(true);
if (page->id() == initialPage && page->category() == initialCategory) {
@ -289,6 +290,7 @@ QTreeWidgetItem *SettingsDialog::addPage(IOptionsPage *page)
void SettingsDialog::onItemSelected()
{
QTreeWidgetItem *item = pageTree->currentItem();
if (!item) {
return;
}
@ -297,8 +299,7 @@ void SettingsDialog::onItemSelected()
if (item->childCount() == 1) {
// single child : category will not be expanded
item = item->child(0);
}
else if (item->childCount() > 1) {
} else if (item->childCount() > 1) {
// multiple children : expand category and select 1st child
emit categoryItemSelected();
return;
@ -331,6 +332,7 @@ void SettingsDialog::onItemSelected()
void SettingsDialog::onCategorySelected()
{
QTreeWidgetItem *item = pageTree->currentItem();
if (item->childCount() > 1) {
item->setExpanded(true);
pageTree->setCurrentItem(item->child(0), 0, QItemSelectionModel::SelectCurrent);

View File

@ -41,7 +41,6 @@ class PluginManager;
}
namespace Core {
namespace Internal {
class SettingsDialog;
}
@ -120,7 +119,6 @@ private:
void readConfigs_1_1_0(QSettings *qs);
void readConfigs_1_2_0(QSettings *qs);
};
} // namespace Core
#endif // UAVGADGETINSTANCEMANAGER_H

View File

@ -51,7 +51,7 @@ UAVGadgetOptionsPageDecorator::UAVGadgetOptionsPageDecorator(IOptionsPage *page,
QWidget *UAVGadgetOptionsPageDecorator::createPage(QWidget *parent)
{
m_page = new Ui_TopOptionsPage();
QWidget *w = new QWidget(parent);
QWidget *w = new QWidget(parent);
m_page->setupUi(w);
QWidget *wi = m_optionsPage->createPage(w);
@ -91,7 +91,7 @@ void UAVGadgetOptionsPageDecorator::updateState()
m_page->lockCheckBox->hide();
m_page->nameLineEdit->setDisabled(true);
}
switch(m_instanceManager->canDeleteConfiguration(m_config)) {
switch (m_instanceManager->canDeleteConfiguration(m_config)) {
case UAVGadgetInstanceManager::OK:
m_page->deleteButton->setEnabled(true);
m_page->deleteButton->setToolTip(tr("Delete this configuration"));

View File

@ -35,13 +35,12 @@ PfdQmlGadgetConfiguration::PfdQmlGadgetConfiguration(QString classId, QSettings
m_speedFactor(1.0),
m_altitudeFactor(1.0)
{
m_speedMap[1.0] = "m/s";
m_speedMap[3.6] = "km/h";
m_speedMap[2.2369] = "mph";
m_speedMap[1.9438] = "knots";
m_speedMap[1.0] = "m/s";
m_speedMap[3.6] = "km/h";
m_speedMap[2.2369] = "mph";
m_speedMap[1.9438] = "knots";
m_altitudeMap[1.0] = "m";
m_altitudeMap[1.0] = "m";
m_altitudeMap[3.2808] = "ft";
// if a saved configuration exists load it

View File

@ -119,7 +119,7 @@ public:
QString speedUnit() const
{
return m_speedMap[m_speedFactor];
return m_speedMap[m_speedFactor];
}
QString altitudeUnit() const

View File

@ -62,20 +62,18 @@ QWidget *PfdQmlGadgetOptionsPage::createPage(QWidget *parent)
options_page->altitude->setText(QString::number(m_config->altitude()));
options_page->useOnlyCache->setChecked(m_config->cacheOnly());
//Setup units combos
// Setup units combos
QMapIterator<double, QString> iter = m_config->speedMapIterator();
while(iter.hasNext())
{
iter.next();
options_page->speedUnitCombo->addItem(iter.value(), iter.key());
while (iter.hasNext()) {
iter.next();
options_page->speedUnitCombo->addItem(iter.value(), iter.key());
}
options_page->speedUnitCombo->setCurrentIndex(options_page->speedUnitCombo->findData(m_config->speedFactor()));
iter = m_config->altitudeMapIterator();
while(iter.hasNext())
{
iter.next();
options_page->altUnitCombo->addItem(iter.value(), iter.key());
while (iter.hasNext()) {
iter.next();
options_page->altUnitCombo->addItem(iter.value(), iter.key());
}
options_page->altUnitCombo->setCurrentIndex(options_page->altUnitCombo->findData(m_config->altitudeFactor()));