src: fixes for FilePath refactoring on clang
This commit is contained in:
@@ -2074,9 +2074,9 @@ void PersistentStorage::buildFilePathMaps()
|
|||||||
|
|
||||||
for (StorageFile file: m_sqliteIndexStorage.getAll<StorageFile>())
|
for (StorageFile file: m_sqliteIndexStorage.getAll<StorageFile>())
|
||||||
{
|
{
|
||||||
m_fileNodeIds.emplace(file.filePath, file.id);
|
m_fileNodeIds.emplace(FilePath(file.filePath), file.id);
|
||||||
m_fileNodePaths.emplace(file.id, file.filePath);
|
m_fileNodePaths.emplace(file.id, FilePath(file.filePath));
|
||||||
m_fileNodeComplete.emplace(file.filePath, file.complete);
|
m_fileNodeComplete.emplace(FilePath(file.filePath), file.complete);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ void setupPlatform(int argc, char *argv[])
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Makes the mac bundle copy the user files to the Application Support folder
|
// Makes the mac bundle copy the user files to the Application Support folder
|
||||||
QString dataPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
|
QString dataPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
|
||||||
QString oldDataPath = QString::fromStdString(ResourcePaths::getFallbackPath());
|
QString oldDataPath = QString::fromStdString(ResourcePaths::getFallbackPath().str());
|
||||||
|
|
||||||
QDir dataDir(dataPath);
|
QDir dataDir(dataPath);
|
||||||
if (!dataDir.exists())
|
if (!dataDir.exists())
|
||||||
@@ -78,7 +78,7 @@ void setupPlatform(int argc, char *argv[])
|
|||||||
|
|
||||||
utility::copyNewFilesFromDirectory(oldDataPath, dataPath);
|
utility::copyNewFilesFromDirectory(oldDataPath, dataPath);
|
||||||
|
|
||||||
UserPaths::setUserDataPath(dataPath.toStdString() + "/");
|
UserPaths::setUserDataPath(FilePath(dataPath.toStdString() + "/"));
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
appIsMacBundle = true;
|
appIsMacBundle = true;
|
||||||
@@ -91,11 +91,11 @@ void setupApp(int argc, char *argv[])
|
|||||||
|
|
||||||
if (!appIsMacBundle)
|
if (!appIsMacBundle)
|
||||||
{
|
{
|
||||||
UserPaths::setUserDataPath(path.absolute().str() + "/user/");
|
UserPaths::setUserDataPath(FilePath(path.absolute().str() + "/user/"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UserPaths::setSampleProjectsPath(path.absolute().str() + "/data/");
|
UserPaths::setSampleProjectsPath(FilePath(path.absolute().str() + "/data/"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
extensions.push_back(".cpp");
|
extensions.push_back(".cpp");
|
||||||
|
|
||||||
std::vector<FilePath> directoryPaths;
|
std::vector<FilePath> directoryPaths;
|
||||||
directoryPaths.push_back("./data/FileSystemTestSuite/src");
|
directoryPaths.push_back(FilePath("./data/FileSystemTestSuite/src"));
|
||||||
|
|
||||||
std::vector<FileInfo> files = FileSystem::getFileInfosFromPaths(directoryPaths, extensions, false);
|
std::vector<FileInfo> files = FileSystem::getFileInfosFromPaths(directoryPaths, extensions, false);
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
extensions.push_back(".cpp");
|
extensions.push_back(".cpp");
|
||||||
|
|
||||||
std::vector<FilePath> directoryPaths;
|
std::vector<FilePath> directoryPaths;
|
||||||
directoryPaths.push_back("./data/FileSystemTestSuite/src");
|
directoryPaths.push_back(FilePath("./data/FileSystemTestSuite/src"));
|
||||||
|
|
||||||
std::vector<FileInfo> files = FileSystem::getFileInfosFromPaths(directoryPaths, extensions, true);
|
std::vector<FileInfo> files = FileSystem::getFileInfosFromPaths(directoryPaths, extensions, true);
|
||||||
|
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ public:
|
|||||||
void test_add_bookmarks()
|
void test_add_bookmarks()
|
||||||
{
|
{
|
||||||
FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite");
|
FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite");
|
||||||
int bookmarkCount = 4;
|
size_t bookmarkCount = 4;
|
||||||
int result = -1;
|
int result = -1;
|
||||||
{
|
{
|
||||||
boost::filesystem::remove(databasePath.path());
|
boost::filesystem::remove(databasePath.path());
|
||||||
SqliteBookmarkStorage storage(databasePath);
|
SqliteBookmarkStorage storage(databasePath);
|
||||||
storage.setup();
|
storage.setup();
|
||||||
|
|
||||||
for (unsigned int i = 0; i < bookmarkCount; i++)
|
for (size_t i = 0; i < bookmarkCount; i++)
|
||||||
{
|
{
|
||||||
const Id categoryId = storage.addBookmarkCategory("test category");
|
const Id categoryId = storage.addBookmarkCategory("test category");
|
||||||
storage.addBookmark("test bookmark", "test comment", TimePoint::now().toString(), categoryId);
|
storage.addBookmark("test bookmark", "test comment", TimePoint::now().toString(), categoryId);
|
||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
void test_add_bookmarked_node()
|
void test_add_bookmarked_node()
|
||||||
{
|
{
|
||||||
FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite");
|
FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite");
|
||||||
int bookmarkCount = 4;
|
size_t bookmarkCount = 4;
|
||||||
int result = -1;
|
int result = -1;
|
||||||
{
|
{
|
||||||
boost::filesystem::remove(databasePath.path());
|
boost::filesystem::remove(databasePath.path());
|
||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
const Id categoryId = storage.addBookmarkCategory("test category");
|
const Id categoryId = storage.addBookmarkCategory("test category");
|
||||||
const Id bookmarkId = storage.addBookmark("test bookmark", "test comment", TimePoint::now().toString(), categoryId);
|
const Id bookmarkId = storage.addBookmark("test bookmark", "test comment", TimePoint::now().toString(), categoryId);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < bookmarkCount; i++)
|
for (size_t i = 0; i < bookmarkCount; i++)
|
||||||
{
|
{
|
||||||
storage.addBookmarkedNode(bookmarkId, "test name");
|
storage.addBookmarkedNode(bookmarkId, "test name");
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,6 @@ public:
|
|||||||
void test_remove_bookmark_also_removes_bookmarked_node()
|
void test_remove_bookmark_also_removes_bookmarked_node()
|
||||||
{
|
{
|
||||||
FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite");
|
FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite");
|
||||||
int bookmarkCount = 4;
|
|
||||||
int result = -1;
|
int result = -1;
|
||||||
{
|
{
|
||||||
boost::filesystem::remove(databasePath.path());
|
boost::filesystem::remove(databasePath.path());
|
||||||
@@ -71,7 +70,7 @@ public:
|
|||||||
|
|
||||||
const Id categoryId = storage.addBookmarkCategory("test category");
|
const Id categoryId = storage.addBookmarkCategory("test category");
|
||||||
const Id bookmarkId = storage.addBookmark("test bookmark", "test comment", TimePoint::now().toString(), categoryId);
|
const Id bookmarkId = storage.addBookmark("test bookmark", "test comment", TimePoint::now().toString(), categoryId);
|
||||||
const Id bookmarkedNodeId = storage.addBookmarkedNode(bookmarkId, "test name");
|
storage.addBookmarkedNode(bookmarkId, "test name");
|
||||||
|
|
||||||
storage.removeBookmark(bookmarkId);
|
storage.removeBookmark(bookmarkId);
|
||||||
|
|
||||||
@@ -98,7 +97,7 @@ public:
|
|||||||
|
|
||||||
const Id categoryId = storage.addBookmarkCategory("test category");
|
const Id categoryId = storage.addBookmarkCategory("test category");
|
||||||
const Id bookmarkId = storage.addBookmark("test bookmark", "test comment", TimePoint::now().toString(), categoryId);
|
const Id bookmarkId = storage.addBookmark("test bookmark", "test comment", TimePoint::now().toString(), categoryId);
|
||||||
const Id bookmarkedNodeId = storage.addBookmarkedNode(bookmarkId, "test name");
|
storage.addBookmarkedNode(bookmarkId, "test name");
|
||||||
|
|
||||||
storage.updateBookmark(bookmarkId, updatedName, updatedComment, categoryId);
|
storage.updateBookmark(bookmarkId, updatedName, updatedComment, categoryId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user