mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-27 16:54:15 +01:00
OP-1755 Added additional location for cloudconfigs.
This commit is contained in:
parent
3ee481fd2a
commit
a8b6e1f959
@ -169,15 +169,10 @@ bool AirframeInitialTuningPage::airframeIsCompatible(int vehicleType, int vehicl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AirframeInitialTuningPage::loadValidFiles()
|
void AirframeInitialTuningPage::loadFilesInDir(QString templateBasePath)
|
||||||
{
|
{
|
||||||
ui->templateList->clear();
|
QDir templateDir(templateBasePath);
|
||||||
foreach(QJsonObject * templ, m_templates.values()) {
|
qDebug() << "Loading templates from base path:" << templateBasePath;
|
||||||
delete templ;
|
|
||||||
}
|
|
||||||
m_templates.clear();
|
|
||||||
|
|
||||||
QDir templateDir(QString("%1/%2/").arg(Utils::PathUtils().InsertDataPath("%%DATAPATH%%cloudconfig")).arg(m_dir));
|
|
||||||
QStringList names;
|
QStringList names;
|
||||||
names << "*.optmpl";
|
names << "*.optmpl";
|
||||||
templateDir.setNameFilters(names);
|
templateDir.setNameFilters(names);
|
||||||
@ -207,6 +202,18 @@ void AirframeInitialTuningPage::loadValidFiles()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AirframeInitialTuningPage::loadValidFiles()
|
||||||
|
{
|
||||||
|
ui->templateList->clear();
|
||||||
|
foreach(QJsonObject * templ, m_templates.values()) {
|
||||||
|
delete templ;
|
||||||
|
}
|
||||||
|
m_templates.clear();
|
||||||
|
|
||||||
|
loadFilesInDir(QString("%1/%2/").arg(Utils::PathUtils().InsertDataPath("%%DATAPATH%%cloudconfig")).arg(m_dir));
|
||||||
|
loadFilesInDir(QString("%1/%2/").arg(Utils::PathUtils().InsertStoragePath("%%STOREPATH%%cloudconfig")).arg(m_dir));
|
||||||
|
}
|
||||||
|
|
||||||
void AirframeInitialTuningPage::setupTemplateList()
|
void AirframeInitialTuningPage::setupTemplateList()
|
||||||
{
|
{
|
||||||
QListWidgetItem *item;
|
QListWidgetItem *item;
|
||||||
|
@ -44,7 +44,6 @@ public:
|
|||||||
void initializePage();
|
void initializePage();
|
||||||
bool validatePage();
|
bool validatePage();
|
||||||
bool isComplete() const;
|
bool isComplete() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void templateSelectionChanged();
|
void templateSelectionChanged();
|
||||||
|
|
||||||
@ -59,6 +58,7 @@ private:
|
|||||||
QGraphicsPixmapItem *m_photoItem;
|
QGraphicsPixmapItem *m_photoItem;
|
||||||
|
|
||||||
void loadValidFiles();
|
void loadValidFiles();
|
||||||
|
void loadFilesInDir(QString templateBasePath);
|
||||||
void setupTemplateList();
|
void setupTemplateList();
|
||||||
QString getTemplateKey(QJsonObject *templ);
|
QString getTemplateKey(QJsonObject *templ);
|
||||||
void updatePhoto(QJsonObject *templ);
|
void updatePhoto(QJsonObject *templ);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user