add windows override path and cleanup linux
This commit is contained in:
parent
e096b5ce83
commit
e81cf74b39
1 changed files with 14 additions and 10 deletions
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "brightray/browser/browser_main_parts.h"
|
#include "brightray/browser/browser_main_parts.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/feature_list.h"
|
#include "base/feature_list.h"
|
||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
|
@ -90,19 +92,21 @@ void OverrideLinuxAppDataPath() {
|
||||||
PathService::Override(DIR_APP_DATA, path);
|
PathService::Override(DIR_APP_DATA, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// void OverrideWinAppLogsPath() {
|
void OverrideWinAppLogsPath() {
|
||||||
// base::FilePath path;
|
std::string appName = GetApplicationName();
|
||||||
// // should be in c:\program files\myapp\logs ?
|
std::string logPath = "%systemdrive%%homepath%\AppData\Roaming\\";
|
||||||
// PathService::Override(DIR_APP_DATA, path);
|
std::string appLogPath = logPath + appName + "\logs";
|
||||||
// }
|
|
||||||
|
PathService::Override(DIR_APP_LOGS, base::FilePath(appLogPath));
|
||||||
|
}
|
||||||
|
|
||||||
void OverrideLinuxAppLogsPath() {
|
void OverrideLinuxAppLogsPath() {
|
||||||
std::string appName = GetApplicationName();
|
std::string appName = GetApplicationName();
|
||||||
std::string logPath = "/var/log";
|
std::string logPath = "/var/log/";
|
||||||
|
|
||||||
std::string appLogPath = logPath + appName;
|
std::string appLogPath = logPath + appName;
|
||||||
|
|
||||||
PathService::Override(DIR_APP_LOGS base::FilePath(appLogPath));
|
PathService::Override(DIR_APP_LOGS, base::FilePath(appLogPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) {
|
int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) {
|
||||||
|
@ -184,9 +188,9 @@ void BrowserMainParts::PreEarlyInitialization() {
|
||||||
#if defined(OS_LINUX)
|
#if defined(OS_LINUX)
|
||||||
OverrideLinuxAppLogsPath();
|
OverrideLinuxAppLogsPath();
|
||||||
#endif
|
#endif
|
||||||
// #if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
// OverrideWinAppLogsPath();
|
OverrideWinAppLogsPath();
|
||||||
// #endif
|
#endif
|
||||||
#if defined(USE_X11)
|
#if defined(USE_X11)
|
||||||
views::LinuxUI::SetInstance(BuildGtkUi());
|
views::LinuxUI::SetInstance(BuildGtkUi());
|
||||||
OverrideLinuxAppDataPath();
|
OverrideLinuxAppDataPath();
|
||||||
|
|
Loading…
Add table
Reference in a new issue