src: fixes for FilePath refactoring on clang

This commit is contained in:
Eberhard Graether
2017-05-04 11:54:45 +02:00
parent f46e9866fb
commit 74da2c7de9
4 changed files with 15 additions and 16 deletions
+3 -3
View File
@@ -2074,9 +2074,9 @@ void PersistentStorage::buildFilePathMaps()
for (StorageFile file: m_sqliteIndexStorage.getAll<StorageFile>())
{
m_fileNodeIds.emplace(file.filePath, file.id);
m_fileNodePaths.emplace(file.id, file.filePath);
m_fileNodeComplete.emplace(file.filePath, file.complete);
m_fileNodeIds.emplace(FilePath(file.filePath), file.id);
m_fileNodePaths.emplace(file.id, FilePath(file.filePath));
m_fileNodeComplete.emplace(FilePath(file.filePath), file.complete);
}
}
+4 -4
View File
@@ -56,7 +56,7 @@ void setupPlatform(int argc, char *argv[])
// ----------------------------------------------------------------------------
// Makes the mac bundle copy the user files to the Application Support folder
QString dataPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
QString oldDataPath = QString::fromStdString(ResourcePaths::getFallbackPath());
QString oldDataPath = QString::fromStdString(ResourcePaths::getFallbackPath().str());
QDir dataDir(dataPath);
if (!dataDir.exists())
@@ -78,7 +78,7 @@ void setupPlatform(int argc, char *argv[])
utility::copyNewFilesFromDirectory(oldDataPath, dataPath);
UserPaths::setUserDataPath(dataPath.toStdString() + "/");
UserPaths::setUserDataPath(FilePath(dataPath.toStdString() + "/"));
// ----------------------------------------------------------------------------
appIsMacBundle = true;
@@ -91,11 +91,11 @@ void setupApp(int argc, char *argv[])
if (!appIsMacBundle)
{
UserPaths::setUserDataPath(path.absolute().str() + "/user/");
UserPaths::setUserDataPath(FilePath(path.absolute().str() + "/user/"));
}
else
{
UserPaths::setSampleProjectsPath(path.absolute().str() + "/data/");
UserPaths::setSampleProjectsPath(FilePath(path.absolute().str() + "/data/"));
}
}
+2 -2
View File
@@ -61,7 +61,7 @@ public:
extensions.push_back(".cpp");
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);
@@ -80,7 +80,7 @@ public:
extensions.push_back(".cpp");
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);
+6 -7
View File
@@ -12,14 +12,14 @@ public:
void test_add_bookmarks()
{
FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite");
int bookmarkCount = 4;
size_t bookmarkCount = 4;
int result = -1;
{
boost::filesystem::remove(databasePath.path());
SqliteBookmarkStorage storage(databasePath);
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");
storage.addBookmark("test bookmark", "test comment", TimePoint::now().toString(), categoryId);
@@ -36,7 +36,7 @@ public:
void test_add_bookmarked_node()
{
FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite");
int bookmarkCount = 4;
size_t bookmarkCount = 4;
int result = -1;
{
boost::filesystem::remove(databasePath.path());
@@ -46,7 +46,7 @@ public:
const Id categoryId = storage.addBookmarkCategory("test category");
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");
}
@@ -62,7 +62,6 @@ public:
void test_remove_bookmark_also_removes_bookmarked_node()
{
FilePath databasePath("data/SQLiteTestSuite/bookmarkTest.sqlite");
int bookmarkCount = 4;
int result = -1;
{
boost::filesystem::remove(databasePath.path());
@@ -71,7 +70,7 @@ public:
const Id categoryId = storage.addBookmarkCategory("test category");
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);
@@ -98,7 +97,7 @@ public:
const Id categoryId = storage.addBookmarkCategory("test category");
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);