mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-23 13:31:31 -05:00
look for the palettes in various places
This commit is contained in:
parent
66aa8fa6a1
commit
c2d227b403
@ -78,14 +78,20 @@ FractoriumEmberController<T>::FractoriumEmberController(Fractorium* fractorium)
|
||||
|
||||
//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
|
||||
// returns should be "/usr/share/fractorium". It might have to be lowercased
|
||||
// to make sure.
|
||||
//
|
||||
// http://doc.qt.io/qt-5/qstandardpaths.html#StandardLocation-enum
|
||||
// Look for a palette in:
|
||||
// - the folder where the binary is, QCoreApplication::applicationDirPath()
|
||||
// - shared data folder, QStandardPaths::DataLocation()
|
||||
// - /usr/local/share/fractorium
|
||||
// - /usr/share/fractorium
|
||||
|
||||
if (!InitPaletteList(QString("/usr/share/fractorium").toLocal8Bit().data()))
|
||||
throw "No palettes found, exiting.";
|
||||
// TODO: use QStandardPaths::DataLocation too.
|
||||
|
||||
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.
|
||||
ClearUndo();
|
||||
|
Loading…
Reference in New Issue
Block a user