mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
SetIniFile with NULL forces reload, MSSQL schema files create primary keys, Updater fixed
git-svn-id: svn://ultimatepp.org/upp/trunk@827 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
b8931c0a16
commit
78e391fbb0
4 changed files with 12 additions and 6 deletions
|
|
@ -362,16 +362,17 @@ VectorMap<String, String> LoadIniFile(const char *filename) {
|
|||
}
|
||||
|
||||
const char *sIniFile;
|
||||
static bool s_ini_loaded;
|
||||
|
||||
void SetIniFile(const char *name) {
|
||||
sIniFile = name;
|
||||
s_ini_loaded = false;
|
||||
}
|
||||
|
||||
String GetIniKey(const char *name) {
|
||||
static bool loaded;
|
||||
static VectorMap<String, String> key;
|
||||
if(!loaded) {
|
||||
loaded = true;
|
||||
if(!s_ini_loaded) {
|
||||
s_ini_loaded = true;
|
||||
key = LoadIniFile(sIniFile ? sIniFile : ~ConfigFile("q.ini"));
|
||||
#ifdef PLATFORM_WIN32
|
||||
if(key.GetCount() == 0)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public:
|
|||
|
||||
void SetAssertFailedHook(void (*h)(const char *));
|
||||
|
||||
void SetIniFile(const char *name);
|
||||
void SetIniFile(const char *name = NULL);
|
||||
String GetIniKey(const char *name);
|
||||
VectorMap<String, String> LoadIniFile(const char *filename);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,12 @@
|
|||
#define LONGRAW(x) COLUMN("varbinary(max)", String, x, 0, 0)
|
||||
#define LONGRAW_(x) COLUMN_("varbinary(max)", String, x, 0, 0)
|
||||
|
||||
#define PRIMARY_KEY INLINE_ATTRIBUTE("primary key")
|
||||
#define PRIMARY_KEY INLINE_ATTRIBUTE("primary key")\
|
||||
ATTRIBUTE("alter table @t add constraint PK_@x primary key "\
|
||||
"(@c)",\
|
||||
"alter table @t drop constraint PK_@x;")\
|
||||
ATTRIBUTE("create index PKX_@x on @t(@c);", \
|
||||
"drop index PKX_@x;")
|
||||
#define KEY INLINE_ATTRIBUTE("key")
|
||||
#define NOT_NULL INLINE_ATTRIBUTE("not null")
|
||||
#define IDENTITY INLINE_ATTRIBUTE("identity")
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ GUI_APP_MAIN
|
|||
String name = cmdline[0];
|
||||
UpdateFile(name);
|
||||
String exec = GetExeDirFile(name);
|
||||
for(i = 1; i < cmdline.GetCount(); i++)
|
||||
for(int i = 1; i < cmdline.GetCount(); i++)
|
||||
if(cmdline[i].Find(' ') >= 0)
|
||||
exec << " \"" << cmdline[i] << "\"";
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue