logic: fixes all over the place

* fixed refreshing to send another ui refresh message after parsing
* keepContent field for MessageBase so that views won't update
* fixed searchmatching to only weigh uppercase letters next to lowercase ones
* fixed file not jumping back to snippets when activating edge
* clicking into empty space deselects active edge
* clear file manager files on every fetch
* added db transaction for file clearing
* use zooming instead of changing font size
This commit is contained in:
Eberhard Graether
2015-10-02 17:07:03 +02:00
parent a855e14ebf
commit acfbe510fb
26 changed files with 253 additions and 90 deletions
+3 -17
View File
@@ -20,36 +20,22 @@ const std::vector<FilePath>& FileManager::getSourcePaths() const
return m_sourcePaths;
}
const std::vector<FilePath>& FileManager::getIncludePaths() const
{
return m_includePaths;
}
void FileManager::setPaths(
std::vector<FilePath> sourcePaths,
std::vector<FilePath> includePaths,
std::vector<std::string> sourceExtensions,
std::vector<std::string> includeExtensions
){
m_sourcePaths = sourcePaths;
m_includePaths = includePaths;
m_sourceExtensions = sourceExtensions;
m_includeExtensions = includeExtensions;
}
void FileManager::clear()
{
m_files.clear();
m_addedFiles.clear();
m_updatedFiles.clear();
m_removedFiles.clear();
}
void FileManager::fetchFilePaths(const std::vector<FileInfo>& oldFileInfos)
{
m_files.clear();
for (FileInfo oldFileInfo: oldFileInfos)
{
m_files[oldFileInfo.path] = oldFileInfo;
m_files.emplace(oldFileInfo.path, oldFileInfo);
}
m_addedFiles.clear();
@@ -135,7 +121,7 @@ std::vector<FileInfo> FileManager::getFileInfosInProject() const
std::vector<FileInfo> fileInfos;
std::vector<std::pair<std::vector<FilePath>, std::vector<std::string>>> pathsExtensionsPairs;
pathsExtensionsPairs.push_back(std::make_pair(m_includePaths, m_includeExtensions));
pathsExtensionsPairs.push_back(std::make_pair(m_sourcePaths, m_includeExtensions));
pathsExtensionsPairs.push_back(std::make_pair(m_sourcePaths, m_sourceExtensions));
for (size_t i = 0; i < pathsExtensionsPairs.size(); i++)
-3
View File
@@ -14,11 +14,9 @@ public:
virtual ~FileManager();
const std::vector<FilePath>& getSourcePaths() const;
const std::vector<FilePath>& getIncludePaths() const;
void setPaths(
std::vector<FilePath> sourcePaths,
std::vector<FilePath> includePaths,
std::vector<std::string> sourceExtensions,
std::vector<std::string> includeExtensions
);
@@ -42,7 +40,6 @@ private:
std::map<FilePath, FileInfo> m_files;
std::vector<FilePath> m_sourcePaths;
std::vector<FilePath> m_includePaths;
std::vector<std::string> m_sourceExtensions;
std::vector<std::string> m_includeExtensions;
-1
View File
@@ -63,7 +63,6 @@ FileInfo FileSystem::getFileInfoForPath(FilePath filePath)
return FileInfo();
}
std::vector<FileInfo> FileSystem::getFileInfosFromPaths(
const std::vector<FilePath>& paths, const std::vector<std::string>& fileExtensions
){
+12
View File
@@ -17,6 +17,7 @@ public:
MessageBase()
: undoRedoType(UNDOTYPE_NORMAL)
, m_sendAsTask(true)
, m_keepContent(false)
{
}
@@ -47,10 +48,21 @@ public:
return (undoRedoType == UNDOTYPE_IGNORE);
}
void setKeepContent(bool keepContent)
{
m_keepContent = keepContent;
}
bool keepContent() const
{
return m_keepContent;
}
UndoType undoRedoType;
private:
bool m_sendAsTask;
bool m_keepContent;
};
#endif // MESSAGE_BASE_H
@@ -17,6 +17,7 @@ public:
, fromNameHierarchy(fromName)
, toNameHierarchy(toName)
{
setKeepContent(true);
}
static const std::string getStaticType()
@@ -0,0 +1,20 @@
#ifndef MESSAGE_DEACTIVATE_EDGE_H
#define MESSAGE_DEACTIVATE_EDGE_H
#include "utility/messaging/Message.h"
class MessageDeactivateEdge
: public Message<MessageDeactivateEdge>
{
public:
MessageDeactivateEdge()
{
}
static const std::string getStaticType()
{
return "MessageDeactivateEdge";
}
};
#endif // MESSAGE_DEACTIVATE_EDGE_H