diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2020-06-19 11:17:50 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-06-04 18:41:41 +0200 |
commit | 881339e9d9054c46f2621119246de7a13c83761a (patch) | |
tree | 77db7d7188c4ac61cab939c2ccd7a9610d4a01f4 /src/core/profile_qt.cpp | |
parent | 4d67b9f639114ddec0521980495ba27921800e39 (diff) |
Replace FaviconManager with Chromium's Favicon Component
Task-number: QTBUG-51184
Change-Id: Ie050cb23f2c86841a66ec384bfbcdf0713cffa7c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/profile_qt.cpp')
-rw-r--r-- | src/core/profile_qt.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp index 36303605f..ae1169558 100644 --- a/src/core/profile_qt.cpp +++ b/src/core/profile_qt.cpp @@ -58,6 +58,7 @@ #include "content/public/browser/storage_partition.h" #include "base/base_paths.h" +#include "base/files/file_util.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/prefs/pref_member.h" #include "components/prefs/pref_service.h" @@ -298,4 +299,21 @@ content::PlatformNotificationService *ProfileQt::platformNotificationService() return m_platformNotificationService.get(); } +bool ProfileQt::ensureDirectoryExists() +{ + const base::FilePath &path = GetPath(); + + if (base::PathExists(path)) + return true; + + base::File::Error error; + if (base::CreateDirectoryAndGetError(path, &error)) + return true; + + std::string errorstr = base::File::ErrorToString(error); + qWarning("Cannot create directory %s. Error: %s.", path.AsUTF8Unsafe().c_str(), + errorstr.c_str()); + return false; +} + } // namespace QtWebEngineCore |