mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 21:49:51 +00:00
f439fef46d
in the gtk frontend. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8699 a592a061-630c-0410-9148-cb99ea01b6c8
47 lines
1.0 KiB
C
47 lines
1.0 KiB
C
/**
|
|
* \file ghelpers.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Angus Leeming
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "ghelpers.h"
|
|
|
|
#include "debug.h"
|
|
|
|
#include "support/filetools.h"
|
|
#include "support/path_defines.h"
|
|
|
|
using std::string;
|
|
|
|
string const findGladeFile(string const & name)
|
|
{
|
|
// First, search in the installation directories.
|
|
|
|
string filename =
|
|
lyx::support::LibFileSearch("glade", name, "glade");
|
|
|
|
if (!filename.empty())
|
|
return filename;
|
|
|
|
// Second, search in the src tree.
|
|
string const dir =
|
|
lyx::support::AddPath(lyx::support::top_srcdir(),
|
|
"src/frontends/gtk/glade");
|
|
|
|
filename = lyx::support::ChangeExtension(name, ".glade");
|
|
filename = lyx::support::AddName(dir, filename);
|
|
|
|
if (!lyx::support::IsFileReadable(filename)) {
|
|
lyxerr << "Unable to find glade file \"" << name
|
|
<< "\". libglade is going to crash..." << std::endl;
|
|
}
|
|
|
|
return filename;
|
|
}
|