Look for flam3-palettes.xml in executable dir, not working dir

This commit is contained in:
Simon Detheridge 2015-07-24 11:10:18 +01:00
parent fd5e177df7
commit 26bc0d1b72
2 changed files with 5 additions and 3 deletions

View File

@ -72,12 +72,14 @@ FractoriumEmberController<T>::FractoriumEmberController(Fractorium* fractorium)
{
m_PreviewRun = false;
m_PreviewRunning = false;
m_SheepTools = unique_ptr<SheepTools<T, T>>(new SheepTools<T, T>("flam3-palettes.xml", new EmberNs::Renderer<T, T>()));
m_SheepTools = unique_ptr<SheepTools<T, T>>(new SheepTools<T, T>(
QString(QApplication::applicationDirPath() + "flam3-palettes.xml").toLocal8Bit().data(),
new EmberNs::Renderer<T, T>()));
m_GLController = unique_ptr<GLEmberController<T>>(new GLEmberController<T>(fractorium, fractorium->ui.GLDisplay, this));
m_PreviewRenderer = unique_ptr<EmberNs::Renderer<T, T>>(new EmberNs::Renderer<T, T>());
//Initial combo change event to fill the palette table will be called automatically later.
if (!InitPaletteList("./"))
if (!InitPaletteList(QCoreApplication::applicationDirPath().toLocal8Bit().data()))
throw "No palettes found, exiting.";
BackgroundChanged(QColor(0, 0, 0));//Default to black.

View File

@ -92,7 +92,7 @@ bool FractoriumEmberController<T>::FillPaletteTable(const string& s)
QTableWidget* paletteTable = m_Fractorium->ui.PaletteListTable;
QTableWidget* palettePreviewTable = m_Fractorium->ui.PalettePreviewTable;
m_CurrentPaletteFilePath = m_Fractorium->ui.PaletteFilenameCombo->property("path").toString().toStdString() + s;
m_CurrentPaletteFilePath = m_Fractorium->ui.PaletteFilenameCombo->property("path").toString().toStdString() + "/" + s;
if (size_t paletteSize = m_PaletteList.Size(m_CurrentPaletteFilePath))
{