#ifndef __gtk2_ardour_bundle_env_h__
#define __gtk2_ardour_bundle_env_h__
+#include <string>
+
/** This function must do whatever is necessary to create the right runtime
* environment for the GTK2 version of ardour, on a per-platform basis.
*/
-void fixup_bundle_environment (int, char* [], const char** localedir);
+void fixup_bundle_environment (int, char* [], std::string & localedir);
/** Load any fonts required by the GTK2 version of ardour, on a per-platform
* basis.
extern void set_language_preference (); // cocoacarbon.mm
void
-fixup_bundle_environment (int, char* [], const char** localedir)
+fixup_bundle_environment (int, char* [], string & localedir)
{
if (!g_getenv ("ARDOUR_BUNDLED")) {
return;
lpath.push_back (bundle_dir);
lpath.push_back ("Resources");
lpath.push_back ("locale");
- (*localedir) = strdup (Glib::build_filename (lpath).c_str());
+ localedir = strdup (Glib::build_filename (lpath).c_str());
}
#endif
using namespace std;
void
-fixup_bundle_environment (int /*argc*/, char* argv[], const char** localedir)
+fixup_bundle_environment (int /*argc*/, char* argv[], string & localedir)
{
/* THIS IS FOR LINUX - its just about the only place where its
* acceptable to build paths directly using '/'.
#ifdef ENABLE_NLS
if (!ARDOUR::translations_are_enabled ()) {
- (*localedir) = "/this/cannot/exist";
+ localedir = "/this/cannot/exist";
} else {
/* force localedir into the bundle */
vector<string> lpath;
lpath.push_back (dir_path);
lpath.push_back ("share");
lpath.push_back ("locale");
- (*localedir) = canonical_path (Glib::build_filename (lpath)).c_str();
+ localedir = canonical_path (Glib::build_filename (lpath)).c_str();
}
#endif
*/
#include <stdlib.h>
+#inc;ude <string>
#include "bundle_env.h"
#include "i18n.h"
void
-fixup_bundle_environment (int, char* [], const char** localedir)
+fixup_bundle_environment (int, char* [], string & localedir)
{
EnvironmentalProtectionAgency::set_global_epa (new EnvironmentalProtectionAgency (true));
/* what to do ? */
Glib::setenv ("GTK_LOCALEDIR", path, true);
// and return the same path to our caller
- (*localedir) = strdup (path.c_str());
+ localedir = path;
}
const char *cstr;
}
void
-fixup_bundle_environment (int argc, char* argv[], const char** localedir)
+fixup_bundle_environment (int argc, char* argv[], string & localedir)
{
std::string exec_path = argv[0];
std::string dir_path = Glib::path_get_dirname (exec_path);
Glib::setenv ("GTK_LOCALEDIR", path, true);
// and return the same path to our caller
- (*localedir) = strdup (path.c_str());
+ localedir = path;
}
extern int curvetest (string);
static ARDOUR_UI *ui = 0;
-static const char* localedir = LOCALEDIR;
+static string localedir (LOCALEDIR);
void
gui_jack_error ()
{
ARDOUR::check_for_old_configuration_files();
- fixup_bundle_environment (argc, argv, &localedir);
+ fixup_bundle_environment (argc, argv, localedir);
load_custom_fonts(); /* needs to happen before any gtk and pango init calls */
#ifdef ENABLE_NLS
cerr << "bind txt domain [" << PACKAGE << "] to " << localedir << endl;
- (void) bindtextdomain (PACKAGE, localedir);
+ (void) bindtextdomain (PACKAGE, localedir.c_str());
/* our i18n translations are all in UTF-8, so make sure
that even if the user locale doesn't specify UTF-8,
we use that when handling them.
<< endl;
}
- if (!ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization, localedir)) {
+ if (!ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization, localedir.c_str())) {
error << string_compose (_("could not initialize %1."), PROGRAM_NAME) << endmsg;
exit (1);
}
#endif
try {
- ui = new ARDOUR_UI (&argc, &argv, localedir);
+ ui = new ARDOUR_UI (&argc, &argv, localedir.c_str());
} catch (failed_constructor& err) {
error << string_compose (_("could not create %1 GUI"), PROGRAM_NAME) << endmsg;
exit (1);