look for the palettes in various places

This commit is contained in:
Gambhiro 2015-12-09 18:08:21 +00:00
parent 66aa8fa6a1
commit c2d227b403

View File

@ -78,14 +78,20 @@ FractoriumEmberController<T>::FractoriumEmberController(Fractorium* fractorium)
//Initial combo change event to fill the palette table will be called automatically later. //Initial combo change event to fill the palette table will be called automatically later.
// TODO: Use QStandardPaths::DataLocation(), on linux one of the paths it // Look for a palette in:
// returns should be "/usr/share/fractorium". It might have to be lowercased // - the folder where the binary is, QCoreApplication::applicationDirPath()
// to make sure. // - shared data folder, QStandardPaths::DataLocation()
// // - /usr/local/share/fractorium
// http://doc.qt.io/qt-5/qstandardpaths.html#StandardLocation-enum // - /usr/share/fractorium
if (!InitPaletteList(QString("/usr/share/fractorium").toLocal8Bit().data())) // TODO: use QStandardPaths::DataLocation too.
throw "No palettes found, exiting.";
if ( ! (InitPaletteList(QCoreApplication::applicationDirPath().toLocal8Bit().data()) ||
InitPaletteList(QString("/usr/local/share/fractorium").toLocal8Bit().data()) ||
InitPaletteList(QString("/usr/share/fractorium").toLocal8Bit().data())) )
{
throw "No palettes found, exiting.";
}
BackgroundChanged(QColor(0, 0, 0));//Default to black. BackgroundChanged(QColor(0, 0, 0));//Default to black.
ClearUndo(); ClearUndo();