283 lines
10 KiB
Diff
283 lines
10 KiB
Diff
diff -Naur codelite-orig/CodeLite/cl_defs.h codelite/CodeLite/cl_defs.h
|
|
--- codelite-orig/CodeLite/cl_defs.h 2015-12-28 09:14:07.384041000 +0300
|
|
+++ codelite/CodeLite/cl_defs.h 2015-12-28 10:17:06.738122000 +0300
|
|
@@ -48,13 +48,13 @@
|
|
#else
|
|
#ifdef USE_POSIX_LAYOUT
|
|
#ifndef PLUGINS_DIR
|
|
-#define PLUGINS_DIR "/lib/codelite"
|
|
+#define PLUGINS_DIR "\\lib\\codelite"
|
|
#endif
|
|
#ifndef INSTALL_DIR
|
|
-#define INSTALL_DIR "/share/codelite"
|
|
+#define INSTALL_DIR "\\share\\codelite"
|
|
#endif
|
|
#ifndef CFGDIR
|
|
-#define CFGDIR "/share/codelite/config/cfg"
|
|
+#define CFGDIR "\\share\\codelite\\config\\cfg"
|
|
#endif
|
|
#endif
|
|
// MSW / OSX and the rest of the world
|
|
diff -Naur codelite-orig/CodeLite/cl_standard_paths.cpp codelite/CodeLite/cl_standard_paths.cpp
|
|
--- codelite-orig/CodeLite/cl_standard_paths.cpp 2015-12-28 09:14:23.533041000 +0300
|
|
+++ codelite/CodeLite/cl_standard_paths.cpp 2015-12-28 10:50:22.132984200 +0300
|
|
@@ -74,7 +74,7 @@
|
|
wxString pluginsDir = PLUGINS_DIR;
|
|
#else
|
|
#ifdef USE_POSIX_LAYOUT
|
|
- wxFileName path(GetDataDir() + wxT(PLUGINS_DIR), "");
|
|
+ wxFileName path(GetInstallDir() + wxT(PLUGINS_DIR), "");
|
|
#else
|
|
wxFileName path(GetDataDir(), "");
|
|
path.AppendDir("plugins");
|
|
@@ -84,7 +84,15 @@
|
|
return pluginsDir;
|
|
}
|
|
|
|
-wxString clStandardPaths::GetDataDir() const { return wxStandardPaths::Get().GetDataDir(); }
|
|
+wxString clStandardPaths::GetDataDir() const
|
|
+{
|
|
+#ifdef USE_POSIX_LAYOUT
|
|
+ wxFileName path(wxStandardPaths::Get().GetDataDir() + wxT(INSTALL_DIR), "");
|
|
+ return path.GetPath();
|
|
+#else
|
|
+ return wxStandardPaths::Get().GetDataDir();
|
|
+#endif
|
|
+}
|
|
|
|
wxString clStandardPaths::GetBinFolder() const
|
|
{
|
|
@@ -104,22 +112,14 @@
|
|
|
|
wxString clStandardPaths::GetLexersDir() const
|
|
{
|
|
-#ifdef USE_POSIX_LAYOUT
|
|
- wxFileName fn(GetDataDir() + wxT(INSTALL_DIR), "");
|
|
-#else
|
|
wxFileName fn(GetDataDir(), "");
|
|
-#endif
|
|
fn.AppendDir("lexers");
|
|
return fn.GetPath();
|
|
}
|
|
|
|
wxString clStandardPaths::GetProjectTemplatesDir() const
|
|
{
|
|
-#ifdef USE_POSIX_LAYOUT
|
|
- wxFileName fn(GetDataDir() + wxT(INSTALL_DIR), "");
|
|
-#else
|
|
wxFileName fn(GetDataDir(), "");
|
|
-#endif
|
|
fn.AppendDir("templates");
|
|
fn.AppendDir("projects");
|
|
return fn.GetPath();
|
|
@@ -134,11 +134,7 @@
|
|
|
|
wxString clStandardPaths::GetUserProjectTemplatesDir() const
|
|
{
|
|
-#ifdef USE_POSIX_LAYOUT
|
|
- wxFileName fn(GetUserDataDir() + wxT(INSTALL_DIR), "");
|
|
-#else
|
|
wxFileName fn(GetUserDataDir(), "");
|
|
-#endif
|
|
fn.AppendDir("templates");
|
|
fn.AppendDir("projects");
|
|
return fn.GetPath();
|
|
@@ -163,6 +159,20 @@
|
|
return path;
|
|
}
|
|
|
|
+wxString clStandardPaths::GetInstallDir() const
|
|
+{
|
|
+#ifdef __WXGTK__
|
|
+ return GetBinFolder();
|
|
+#else
|
|
+#ifdef USE_POSIX_LAYOUT
|
|
+ wxFileName path(wxStandardPaths::Get().GetDataDir(), "");
|
|
+ return path.GetPath();
|
|
+#else
|
|
+ return GetBinFolder();
|
|
+#endif
|
|
+#endif
|
|
+}
|
|
+
|
|
void clStandardPaths::IgnoreAppSubDir(const wxString & subdirPattern)
|
|
{
|
|
#ifdef USE_POSIX_LAYOUT
|
|
diff -Naur codelite-orig/CodeLite/cl_standard_paths.h codelite/CodeLite/cl_standard_paths.h
|
|
--- codelite-orig/CodeLite/cl_standard_paths.h 2015-12-28 09:14:23.150041000 +0300
|
|
+++ codelite/CodeLite/cl_standard_paths.h 2015-12-28 10:45:39.783044500 +0300
|
|
@@ -119,6 +119,11 @@
|
|
*/
|
|
wxString GetDocumentsDir() const;
|
|
|
|
+ /**
|
|
+ * @brief return the installation directory.
|
|
+ */
|
|
+ wxString GetInstallDir() const;
|
|
+
|
|
void IgnoreAppSubDir(const wxString & subdirPattern);
|
|
};
|
|
|
|
diff -Naur codelite-orig/CodeLite/macros.h codelite/CodeLite/macros.h
|
|
--- codelite-orig/CodeLite/macros.h 2015-12-28 09:14:07.436041000 +0300
|
|
+++ codelite/CodeLite/macros.h 2015-12-28 11:10:10.351039900 +0300
|
|
@@ -114,10 +114,8 @@
|
|
const wxString TERMINAL_CMD = wxT("");
|
|
#endif
|
|
|
|
-#if defined(__WXMSW__) && !defined(USE_POSIX_LAYOUT)
|
|
+#if defined(__WXMSW__)
|
|
#define PATH_SEP wxT("\\")
|
|
-#else
|
|
-#define PATH_SEP wxT("/")
|
|
#endif
|
|
|
|
#define ID_MENU_CUSTOM_TARGET_FIRST 15000
|
|
diff -Naur codelite-orig/codelitephp/PHPParser/php_utils.cpp codelite/codelitephp/PHPParser/php_utils.cpp
|
|
--- codelite-orig/codelitephp/PHPParser/php_utils.cpp 2015-12-28 09:14:12.524041000 +0300
|
|
+++ codelite/codelitephp/PHPParser/php_utils.cpp 2015-12-28 10:30:14.036438700 +0300
|
|
@@ -82,7 +82,7 @@
|
|
fn.AppendDir("resources");
|
|
#else
|
|
#ifdef USE_POSIX_LAYOUT
|
|
- fn = wxFileName(clStandardPaths::Get().GetDataDir() + wxT(PLUGINS_DIR));
|
|
+ fn = wxFileName(clStandardPaths::Get().GetPluginsDirectory());
|
|
#else
|
|
fn = wxFileName(clStandardPaths::Get().GetExecutablePath());
|
|
fn.AppendDir("plugins");
|
|
diff -Naur codelite-orig/Interfaces/plugin.h codelite/Interfaces/plugin.h
|
|
--- codelite-orig/Interfaces/plugin.h 2015-12-28 09:14:07.724041000 +0300
|
|
+++ codelite/Interfaces/plugin.h 2015-12-28 10:38:29.711044500 +0300
|
|
@@ -162,7 +162,7 @@
|
|
wxString pluginsDir = clStandardPaths::Get().GetDataDir();
|
|
#else
|
|
#ifdef USE_POSIX_LAYOUT
|
|
- wxString pluginsDir(clStandardPaths::Get().GetDataDir() + wxT(PLUGINS_DIR));
|
|
+ wxString pluginsDir(clStandardPaths::Get().GetDataDir());
|
|
#else
|
|
wxString pluginsDir(m_mgr->GetInstallDirectory() + wxT("/plugins"));
|
|
#endif
|
|
diff -Naur codelite-orig/LiteEditor/app.cpp codelite/LiteEditor/app.cpp
|
|
--- codelite-orig/LiteEditor/app.cpp 2015-12-28 09:14:07.841041000 +0300
|
|
+++ codelite/LiteEditor/app.cpp 2015-12-28 10:54:34.309806000 +0300
|
|
@@ -328,10 +328,6 @@
|
|
// EnableDebugPriv();
|
|
#endif
|
|
|
|
-#ifdef USE_POSIX_LAYOUT
|
|
- clStandardPaths::Get().IgnoreAppSubDir("bin");
|
|
-#endif
|
|
-
|
|
// Init resources and add the PNG handler
|
|
wxSystemOptions::SetOption(_T("msw.remap"), 0);
|
|
wxSystemOptions::SetOption("msw.notebook.themed-background", 1);
|
|
@@ -486,7 +482,7 @@
|
|
#else //__WXMSW__
|
|
if(homeDir.IsEmpty()) { // did we got a basedir from user?
|
|
#ifdef USE_POSIX_LAYOUT
|
|
- homeDir = clStandardPaths::Get().GetDataDir() + wxT(INSTALL_DIR);
|
|
+ homeDir = clStandardPaths::Get().GetDataDir();
|
|
#else
|
|
homeDir = ::wxGetCwd();
|
|
#endif
|
|
@@ -642,7 +638,7 @@
|
|
|
|
#elif defined(__WXMSW__)
|
|
#ifdef USE_POSIX_LAYOUT
|
|
- wxLocale::AddCatalogLookupPathPrefix(clStandardPaths::Get().GetDataDir() + wxT("/share/locale"));
|
|
+ wxLocale::AddCatalogLookupPathPrefix(clStandardPaths::Get().GetInstallDir() + wxT("\\share\\locale"));
|
|
#else
|
|
wxLocale::AddCatalogLookupPathPrefix(ManagerST::Get()->GetInstallDir() + wxT("\\locale"));
|
|
#endif
|
|
@@ -933,13 +929,8 @@
|
|
#ifdef __WXGTK__
|
|
printersInstallDir = wxFileName(wxString(INSTALL_DIR, wxConvUTF8), "gdb_printers");
|
|
#else
|
|
-#ifdef USE_POSIX_LAYOUT
|
|
- wxString commdir(clStandardPaths::Get().GetDataDir() + wxT(INSTALL_DIR));
|
|
- printersInstallDir = wxFileName(commdir, "gdb_printers");
|
|
-#else
|
|
printersInstallDir = wxFileName(clStandardPaths::Get().GetDataDir(), "gdb_printers");
|
|
#endif
|
|
-#endif
|
|
|
|
// copy the files to ~/.codelite/gdb_printers
|
|
wxLogNull nolog;
|
|
diff -Naur codelite-orig/LiteEditor/frame.cpp codelite/LiteEditor/frame.cpp
|
|
--- codelite-orig/LiteEditor/frame.cpp 2015-12-28 09:14:08.030041000 +0300
|
|
+++ codelite/LiteEditor/frame.cpp 2015-12-28 10:53:38.446392900 +0300
|
|
@@ -3661,7 +3661,7 @@
|
|
|
|
// Load debuggers (*must* be after the plugins)
|
|
#ifdef USE_POSIX_LAYOUT
|
|
- wxString plugdir(clStandardPaths::Get().GetDataDir() + wxT(PLUGINS_DIR));
|
|
+ wxString plugdir(clStandardPaths::Get().GetPluginsDirectory());
|
|
DebuggerMgr::Get().Initialize(this, EnvironmentConfig::Instance(), plugdir);
|
|
#else
|
|
DebuggerMgr::Get().Initialize(this, EnvironmentConfig::Instance(), ManagerST::Get()->GetInstallDir());
|
|
diff -Naur codelite-orig/Plugin/bitmap_loader.cpp codelite/Plugin/bitmap_loader.cpp
|
|
--- codelite-orig/Plugin/bitmap_loader.cpp 2015-12-28 09:14:08.426041000 +0300
|
|
+++ codelite/Plugin/bitmap_loader.cpp 2015-12-28 10:56:16.813554600 +0300
|
|
@@ -64,13 +64,8 @@
|
|
wxString bitmapPath = wxString(INSTALL_DIR, wxConvUTF8);
|
|
fn = wxFileName(bitmapPath, zipname);
|
|
#else
|
|
-#ifdef USE_POSIX_LAYOUT
|
|
- wxString bitmapPath(clStandardPaths::Get().GetDataDir() + wxT(INSTALL_DIR));
|
|
- fn = wxFileName(bitmapPath, zipname);
|
|
-#else
|
|
fn = wxFileName(clStandardPaths::Get().GetDataDir(), zipname);
|
|
#endif
|
|
-#endif
|
|
|
|
if(m_manifest.empty() || m_toolbarsBitmaps.empty()) {
|
|
m_zipPath = fn;
|
|
diff -Naur codelite-orig/Plugin/ColoursAndFontsManager.cpp codelite/Plugin/ColoursAndFontsManager.cpp
|
|
--- codelite-orig/Plugin/ColoursAndFontsManager.cpp 2015-12-28 09:14:08.351041000 +0300
|
|
+++ codelite/Plugin/ColoursAndFontsManager.cpp 2015-12-28 10:57:09.064051300 +0300
|
|
@@ -543,12 +543,9 @@
|
|
wxFileName fnUserLexers(clStandardPaths::Get().GetUserDataDir(), "lexers.json");
|
|
fnUserLexers.AppendDir("lexers");
|
|
|
|
-// Default installation lexers
|
|
-#ifdef USE_POSIX_LAYOUT
|
|
- wxFileName defaultLexersFileName(clStandardPaths::Get().GetDataDir() + wxT(INSTALL_DIR), "");
|
|
-#else
|
|
+ // Default installation lexers
|
|
wxFileName defaultLexersFileName(clStandardPaths::Get().GetDataDir(), "");
|
|
-#endif
|
|
+
|
|
defaultLexersFileName.AppendDir("lexers");
|
|
defaultLexersFileName.SetFullName("lexers.json");
|
|
|
|
diff -Naur codelite-orig/Plugin/debuggermanager.cpp codelite/Plugin/debuggermanager.cpp
|
|
--- codelite-orig/Plugin/debuggermanager.cpp 2015-12-28 09:14:08.516041000 +0300
|
|
+++ codelite/Plugin/debuggermanager.cpp 2015-12-28 11:04:22.364565400 +0300
|
|
@@ -103,7 +103,11 @@
|
|
wxString debuggersPath(PLUGINS_DIR, wxConvUTF8);
|
|
debuggersPath += wxT("/debuggers");
|
|
#elif defined(__WXMSW__)
|
|
+#ifdef USE_POSIX_LAYOUT
|
|
+ wxString debuggersPath(clStandardPaths::Get().GetPluginsDirectory() + wxT("/debuggers"));
|
|
+#else
|
|
wxString debuggersPath(m_baseDir + wxT("/debuggers"));
|
|
+#endif
|
|
#else
|
|
// OSX
|
|
wxFileName debuggersFolder(clStandardPaths::Get().GetDataDir(), "");
|
|
diff -Naur codelite-orig/SpellChecker/spellcheckeroptions.cpp codelite/SpellChecker/spellcheckeroptions.cpp
|
|
--- codelite-orig/SpellChecker/spellcheckeroptions.cpp 2015-12-28 09:14:09.378041000 +0300
|
|
+++ codelite/SpellChecker/spellcheckeroptions.cpp 2015-12-28 11:06:19.093039900 +0300
|
|
@@ -46,11 +46,7 @@
|
|
m_scanD2 = false;
|
|
|
|
wxString defaultDicsDir;
|
|
-#ifdef USE_POSIX_LAYOUT
|
|
- defaultDicsDir << clStandardPaths::Get().GetDataDir() << wxT(INSTALL_DIR) << wxFILE_SEP_PATH << "dics";
|
|
-#else
|
|
defaultDicsDir << clStandardPaths::Get().GetDataDir() << wxFILE_SEP_PATH << "dics";
|
|
-#endif
|
|
m_dictionaryPath = defaultDicsDir;
|
|
}
|
|
|