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();
|
||||
foreach(QJsonObject * templ, m_templates.values()) {
|
||||
delete templ;
|
||||
}
|
||||
m_templates.clear();
|
||||
|
||||
QDir templateDir(QString("%1/%2/").arg(Utils::PathUtils().InsertDataPath("%%DATAPATH%%cloudconfig")).arg(m_dir));
|
||||
QDir templateDir(templateBasePath);
|
||||
qDebug() << "Loading templates from base path:" << templateBasePath;
|
||||
QStringList names;
|
||||
names << "*.optmpl";
|
||||
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()
|
||||
{
|
||||
QListWidgetItem *item;
|
||||
|
@ -44,7 +44,6 @@ public:
|
||||
void initializePage();
|
||||
bool validatePage();
|
||||
bool isComplete() const;
|
||||
|
||||
public slots:
|
||||
void templateSelectionChanged();
|
||||
|
||||
@ -59,6 +58,7 @@ private:
|
||||
QGraphicsPixmapItem *m_photoItem;
|
||||
|
||||
void loadValidFiles();
|
||||
void loadFilesInDir(QString templateBasePath);
|
||||
void setupTemplateList();
|
||||
QString getTemplateKey(QJsonObject *templ);
|
||||
void updatePhoto(QJsonObject *templ);
|
||||
|
Loading…
x
Reference in New Issue
Block a user