· 8 years ago · Nov 23, 2017, 10:12 AM
1#3015426 main() function disappears after adding second project.
2
3diff -r dabad893d55f -r d78e7873c3ea CodeLite/istorage.h
4--- a/CodeLite/istorage.h Sun Sep 11 13:34:11 2011 +0300
5+++ b/CodeLite/istorage.h Mon Sep 12 20:17:40 2011 +0300
6@@ -251,7 +251,7 @@
7 * @param path
8 * @return TagOk or TagError
9 */
10- virtual int DeleteTagEntry ( const wxString &kind, const wxString &signature, const wxString &path ) = 0;
11+ virtual int DeleteTagEntry ( const wxString &kind, const wxString &signature, const wxString &path, const wxString &file ) = 0;
12
13 /**
14 * Return a result set of tags according to file name.
15diff -r dabad893d55f -r d78e7873c3ea CodeLite/parse_thread.cpp
16--- a/CodeLite/parse_thread.cpp Sun Sep 11 13:34:11 2011 +0300
17+++ b/CodeLite/parse_thread.cpp Mon Sep 12 20:17:40 2011 +0300
18@@ -260,7 +260,7 @@
19
20 // remove all the 'deleted' items from the database
21 for (i=0; i<deletedItems.size(); i++) {
22- m_pDb->DeleteTagEntry(deletedItems[i].second.GetKind(), deletedItems[i].second.GetSignature(), deletedItems[i].second.GetPath());
23+ m_pDb->DeleteTagEntry(deletedItems[i].second.GetKind(), deletedItems[i].second.GetSignature(), deletedItems[i].second.GetPath(), deletedItems[i].second.GetFile());
24 }
25
26 // insert all new items to database
27diff -r dabad893d55f -r d78e7873c3ea CodeLite/tags_storage_sqlite3.cpp
28--- a/CodeLite/tags_storage_sqlite3.cpp Sun Sep 11 13:34:11 2011 +0300
29+++ b/CodeLite/tags_storage_sqlite3.cpp Mon Sep 12 20:17:40 2011 +0300
30@@ -123,7 +123,7 @@
31 m_db->ExecuteUpdate(sql);
32
33 // Create unique index on tags table
34- sql = wxT("CREATE UNIQUE INDEX IF NOT EXISTS TAGS_UNIQ on tags(kind, path, signature);");
35+ sql = wxT("CREATE UNIQUE INDEX IF NOT EXISTS TAGS_UNIQ on tags(kind, path, signature, file);");
36 m_db->ExecuteUpdate(sql);
37
38 sql = wxT("CREATE INDEX IF NOT EXISTS KIND_IDX on tags(kind);");
39@@ -826,15 +826,16 @@
40 return TagOk;
41 }
42
43-int TagsStorageSQLite::DeleteTagEntry(const wxString& kind, const wxString& signature, const wxString& path)
44+int TagsStorageSQLite::DeleteTagEntry(const wxString& kind, const wxString& signature, const wxString& path, const wxString& file)
45 {
46 // Delete this record from database.
47 // Delete is done using the index
48 try {
49- wxSQLite3Statement statement = m_db->GetPrepareStatement(wxT("DELETE FROM TAGS WHERE Kind=? AND Signature=? AND Path=?"));
50+ wxSQLite3Statement statement = m_db->GetPrepareStatement(wxT("DELETE FROM TAGS WHERE Kind=? AND Signature=? AND Path=? AND File=?"));
51 statement.Bind(1, kind); // Kind
52 statement.Bind(2, signature); // Signature
53 statement.Bind(3, path); // Path
54+ statement.Bind(4, file); // Path
55 statement.ExecuteUpdate();
56 } catch (wxSQLite3Exception& exc) {
57 wxUnusedVar(exc);
58@@ -881,7 +882,7 @@
59 return TagOk;
60
61 try {
62- wxSQLite3Statement statement = m_db->GetPrepareStatement(wxT("UPDATE OR REPLACE TAGS SET Name=?, File=?, Line=?, Access=?, Pattern=?, Parent=?, Inherits=?, Typeref=?, Scope=?, Return_Value=? WHERE Kind=? AND Signature=? AND Path=?"));
63+ wxSQLite3Statement statement = m_db->GetPrepareStatement(wxT("UPDATE OR REPLACE TAGS SET Name=?, File=?, Line=?, Access=?, Pattern=?, Parent=?, Inherits=?, Typeref=?, Scope=?, Return_Value=? WHERE Kind=? AND Signature=? AND Path=? AND File=?"));
64 // update
65 statement.Bind(1, tag.GetName());
66 statement.Bind(2, tag.GetFile());
67@@ -898,6 +899,7 @@
68 statement.Bind(11, tag.GetKind());
69 statement.Bind(12, tag.GetSignature());
70 statement.Bind(13, tag.GetPath());
71+ statement.Bind(14, tag.GetFile());
72
73 statement.ExecuteUpdate();
74 } catch (wxSQLite3Exception& exc) {
75diff -r dabad893d55f -r d78e7873c3ea CodeLite/tags_storage_sqlite3.h
76--- a/CodeLite/tags_storage_sqlite3.h Sun Sep 11 13:34:11 2011 +0300
77+++ b/CodeLite/tags_storage_sqlite3.h Mon Sep 12 20:17:40 2011 +0300
78@@ -503,7 +503,7 @@
79 * @param path
80 * @return TagOk or TagError
81 */
82- virtual int DeleteTagEntry ( const wxString &kind, const wxString &signature, const wxString &path );
83+ virtual int DeleteTagEntry ( const wxString &kind, const wxString &signature, const wxString &path, const wxString &file );
84
85 /**
86 * @brief return true if type exist under a given scope.