projects
/
ardour.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dff83c7
)
fix novice-level mistake that causes localedir to point to random, reusable (typicall...
author
Paul Davis
<paul@linuxaudiosystems.com>
Fri, 17 Apr 2015 15:00:33 +0000
(11:00 -0400)
committer
Paul Davis
<paul@linuxaudiosystems.com>
Fri, 17 Apr 2015 15:00:33 +0000
(11:00 -0400)
gtk2_ardour/bundle_env.h
patch
|
blob
|
history
gtk2_ardour/bundle_env_cocoa.cc
patch
|
blob
|
history
gtk2_ardour/bundle_env_linux.cc
patch
|
blob
|
history
gtk2_ardour/bundle_env_mingw.cc
patch
|
blob
|
history
gtk2_ardour/bundle_env_msvc.cc
patch
|
blob
|
history
gtk2_ardour/main.cc
patch
|
blob
|
history
diff --git
a/gtk2_ardour/bundle_env.h
b/gtk2_ardour/bundle_env.h
index 3a2ca4c54d4bb762dc8438485362a117213f2b69..95a26962311ef4bf401bd18653498de36872712d 100644
(file)
--- a/
gtk2_ardour/bundle_env.h
+++ b/
gtk2_ardour/bundle_env.h
@@
-20,11
+20,13
@@
#ifndef __gtk2_ardour_bundle_env_h__
#define __gtk2_ardour_bundle_env_h__
#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.
*/
/** 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.
/** Load any fonts required by the GTK2 version of ardour, on a per-platform
* basis.
diff --git
a/gtk2_ardour/bundle_env_cocoa.cc
b/gtk2_ardour/bundle_env_cocoa.cc
index 316bc8dce3b2a0a3198b6d33eca0c6ffc786be32..1f55b10954e11478ceb522a28a4459e832bced17 100644
(file)
--- a/
gtk2_ardour/bundle_env_cocoa.cc
+++ b/
gtk2_ardour/bundle_env_cocoa.cc
@@
-52,7
+52,7
@@
using namespace std;
extern void set_language_preference (); // cocoacarbon.mm
void
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;
{
if (!g_getenv ("ARDOUR_BUNDLED")) {
return;
@@
-84,7
+84,7
@@
fixup_bundle_environment (int, char* [], const char** localedir)
lpath.push_back (bundle_dir);
lpath.push_back ("Resources");
lpath.push_back ("locale");
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
}
#endif
diff --git
a/gtk2_ardour/bundle_env_linux.cc
b/gtk2_ardour/bundle_env_linux.cc
index 54404b14fb7fa83ae5376432edb54965926ee54e..1766021da115a2ff7618ab048348cc0819c95122 100644
(file)
--- a/
gtk2_ardour/bundle_env_linux.cc
+++ b/
gtk2_ardour/bundle_env_linux.cc
@@
-46,7
+46,7
@@
using namespace ARDOUR;
using namespace std;
void
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 '/'.
{
/* THIS IS FOR LINUX - its just about the only place where its
* acceptable to build paths directly using '/'.
@@
-63,14
+63,14
@@
fixup_bundle_environment (int /*argc*/, char* argv[], const char** localedir)
#ifdef ENABLE_NLS
if (!ARDOUR::translations_are_enabled ()) {
#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");
} 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
}
#endif
diff --git
a/gtk2_ardour/bundle_env_mingw.cc
b/gtk2_ardour/bundle_env_mingw.cc
index 312d56def7c73ed76a12a11176cd0d3bb23da8e5..e97bc0bd996b9f93b04e6a66a2a034cfe9efe42d 100644
(file)
--- a/
gtk2_ardour/bundle_env_mingw.cc
+++ b/
gtk2_ardour/bundle_env_mingw.cc
@@
-18,6
+18,7
@@
*/
#include <stdlib.h>
*/
#include <stdlib.h>
+#inc;ude <string>
#include "bundle_env.h"
#include "i18n.h"
#include "bundle_env.h"
#include "i18n.h"
@@
-84,7
+85,7
@@
get_install_path ()
void
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 ? */
{
EnvironmentalProtectionAgency::set_global_epa (new EnvironmentalProtectionAgency (true));
/* what to do ? */
@@
-103,7
+104,7
@@
fixup_bundle_environment (int, char* [], const char** localedir)
Glib::setenv ("GTK_LOCALEDIR", path, true);
// and return the same path to our caller
Glib::setenv ("GTK_LOCALEDIR", path, true);
// and return the same path to our caller
-
(*localedir) = strdup (path.c_str())
;
+
localedir = path
;
}
const char *cstr;
}
const char *cstr;
diff --git
a/gtk2_ardour/bundle_env_msvc.cc
b/gtk2_ardour/bundle_env_msvc.cc
index 08087fa0d1525c6817ac50ffcb85940a6dc346ab..7189892f5f106fb8ceab3099dbd8ee895cacf7dd 100644
(file)
--- a/
gtk2_ardour/bundle_env_msvc.cc
+++ b/
gtk2_ardour/bundle_env_msvc.cc
@@
-341,7
+341,7
@@
string clearlooks_la_file;
}
void
}
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);
{
std::string exec_path = argv[0];
std::string dir_path = Glib::path_get_dirname (exec_path);
@@
-450,7
+450,7
@@
fixup_bundle_environment (int argc, char* argv[], const char** localedir)
Glib::setenv ("GTK_LOCALEDIR", path, true);
// and return the same path to our caller
Glib::setenv ("GTK_LOCALEDIR", path, true);
// and return the same path to our caller
-
(*localedir) = strdup (path.c_str())
;
+
localedir = path
;
}
}
diff --git
a/gtk2_ardour/main.cc
b/gtk2_ardour/main.cc
index 5cf43700f1d1781800a64911716bbf6febf4d900..abdfa35877a8e461b925664e20f252b2d408bf74 100644
(file)
--- a/
gtk2_ardour/main.cc
+++ b/
gtk2_ardour/main.cc
@@
-74,7
+74,7
@@
TextReceiver text_receiver ("ardour");
extern int curvetest (string);
static ARDOUR_UI *ui = 0;
extern int curvetest (string);
static ARDOUR_UI *ui = 0;
-static
const char* localedir = LOCALEDIR
;
+static
string localedir (LOCALEDIR)
;
void
gui_jack_error ()
void
gui_jack_error ()
@@
-253,7
+253,7
@@
int main (int argc, char *argv[])
{
ARDOUR::check_for_old_configuration_files();
{
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 */
load_custom_fonts(); /* needs to happen before any gtk and pango init calls */
@@
-277,7
+277,7
@@
int main (int argc, char *argv[])
#ifdef ENABLE_NLS
cerr << "bind txt domain [" << PACKAGE << "] to " << localedir << endl;
#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.
/* 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.
@@
-330,7
+330,7
@@
int main (int argc, char *argv[])
<< endl;
}
<< 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);
}
error << string_compose (_("could not initialize %1."), PROGRAM_NAME) << endmsg;
exit (1);
}
@@
-346,7
+346,7
@@
int main (int argc, char *argv[])
#endif
try {
#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);
} catch (failed_constructor& err) {
error << string_compose (_("could not create %1 GUI"), PROGRAM_NAME) << endmsg;
exit (1);