/[svn]/linuxsampler/trunk/src/db/InstrumentsDb.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/db/InstrumentsDb.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1910 by senoner, Fri Jun 5 14:22:20 2009 UTC revision 1911 by senoner, Sat Jun 6 13:50:36 2009 UTC
# Line 121  namespace LinuxSampler { Line 121  namespace LinuxSampler {
121      sqlite3* InstrumentsDb::GetDb() {      sqlite3* InstrumentsDb::GetDb() {
122          if ( db != NULL) return db;          if ( db != NULL) return db;
123    
124          if (DbFile.empty()) DbFile = CONFIG_DEFAULT_INSTRUMENTS_DB_LOCATION;          if (DbFile.empty()) {
125                        #ifndef WIN32
126                        DbFile = CONFIG_DEFAULT_INSTRUMENTS_DB_LOCATION;
127                            #else
128                            char *userprofile = getenv("USERPROFILE");
129                            if(userprofile) {
130                                DbFile = userprofile;
131                                    DbFile += "\\.linuxsampler\\instruments.db";
132                        }
133                            else {
134                                // in case USERPROFILE is not set (which should not occur)
135                                DbFile = "instruments.db";
136                            }
137                            #endif
138                }
139                  #if defined(__APPLE__)  /* 20071224 Toshi Nagata  */                  #if defined(__APPLE__)  /* 20071224 Toshi Nagata  */
140                  if (DbFile.find("~") == 0)                  if (DbFile.find("~") == 0)
141                          DbFile.replace(0, 1, getenv("HOME"));                          DbFile.replace(0, 1, getenv("HOME"));

Legend:
Removed from v.1910  
changed lines
  Added in v.1911

  ViewVC Help
Powered by ViewVC