commit 734b210f8b0c70d5df040826dff43d7d426b0b61
parent d5c64bbf4581f2dd745dd2af92da2758f6d60668
Author: cfillion <cfillion@users.noreply.github.com>
Date: Mon, 15 Feb 2016 19:32:29 -0800
fix windows build and a bit of refactoring
Diffstat:
4 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/about.cpp b/src/about.cpp
@@ -184,8 +184,8 @@ void About::populate()
string aboutText = m_index->aboutText();
if(m_index->name() == "ReaPack") {
- boost::replace_all(aboutText, "[[REAPACK_VERSION]]", REAPACK_VERSION);
- boost::replace_all(aboutText, "[[REAPACK_BUILDTIME]]", REAPACK_BUILDTIME);
+ boost::replace_all(aboutText, "[[REAPACK_VERSION]]", ReaPack::VERSION);
+ boost::replace_all(aboutText, "[[REAPACK_BUILDTIME]]", ReaPack::BUILDTIME);
}
if(!m_about->setRichText(aboutText)) {
diff --git a/src/main.cpp b/src/main.cpp
@@ -89,8 +89,10 @@ static void menuHook(const char *name, HMENU handle, int f)
menu.addSeparator();
- menu.addAction(AUTO_STR("About ReaPack v") AUTO_STR(REAPACK_VERSION),
- NamedCommandLookup("_REAPACK_ABOUT"));
+ auto_char aboutLabel[255] = {};
+ auto_snprintf(aboutLabel, sizeof(aboutLabel),
+ AUTO_STR("About ReaPack v%s"), make_autostring(ReaPack::VERSION).c_str());
+ menu.addAction(aboutLabel, NamedCommandLookup("_REAPACK_ABOUT"));
}
static bool checkLocation(REAPER_PLUGIN_HINSTANCE module)
diff --git a/src/reapack.cpp b/src/reapack.cpp
@@ -31,6 +31,9 @@
using namespace std;
+const string ReaPack::VERSION = "0.8-beta";
+const string ReaPack::BUILDTIME = __DATE__ " " __TIME__;
+
#ifdef _WIN32
// Removes temporary files that could not be removed by an installation task
// (eg. extensions dll that were in use by REAPER).
@@ -354,7 +357,7 @@ void ReaPack::registerSelf()
RemoteIndex ri("ReaPack");
Category cat("Extensions", &ri);
Package pkg(Package::ExtensionType, "ReaPack.ext", &cat);
- Version ver(REAPACK_VERSION, &pkg);
+ Version ver(VERSION, &pkg);
ver.addSource(new Source(Source::GenericPlatform,
REAPACK_FILE, "dummy url", &ver));
@@ -366,7 +369,7 @@ void ReaPack::registerSelf()
catch(const reapack_error &e) {
char msg[4096] = {};
sprintf(msg,
- "ReaPack could not register itself! Please report this.\n\n"
+ "ReaPack could not register itself! Please report this issue.\n\n"
"Error description: %s", e.what());
ShowMessageBox(msg, "ReaPack", MB_OK);
}
diff --git a/src/reapack.hpp b/src/reapack.hpp
@@ -27,9 +27,6 @@
typedef std::function<void()> ActionCallback;
-#define REAPACK_VERSION "0.8-beta"
-#define REAPACK_BUILDTIME __DATE__ " " __TIME__
-
class Config;
class Import;
class Manager;
@@ -39,6 +36,9 @@ class Transaction;
class ReaPack {
public:
+ static const std::string VERSION;
+ static const std::string BUILDTIME;
+
gaccel_register_t syncAction;
gaccel_register_t importAction;
gaccel_register_t configAction;