Skip to content

Commit 640ec73

Browse files
committed
fix for new project created failed with changed project name
live query when auto complete item is highlighted
1 parent 113f0ba commit 640ec73

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

Display/CMainWindow.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ void CMainWindow::createActions()
575575
connect(&completer_, SIGNAL(activated(const QString &)),
576576
this, SLOT(queryTag(const QString&)));
577577

578+
connect(&completer_, SIGNAL(highlighted(const QString &)),
579+
this, SLOT(queryTagTop1000(const QString&)));
580+
578581
// symbol search frame
579582
connect(symbolSearchFrameShortcut, SIGNAL(activated()), this, SLOT(on_symbolSearchFrameShortcutPressed()));
580583
connect(frameSymbol_lineEdit, SIGNAL(textChanged(const QString &)),
@@ -2167,6 +2170,14 @@ void CMainWindow::queryTagRowLimit(const QString& tag, unsigned int limitSearchR
21672170
qDebug() << "queryTag full took" << timerQuery.elapsed() << "ms";
21682171
}
21692172

2173+
void CMainWindow::queryTagTop1000(const QString& tag)
2174+
{
2175+
bool bLiveSearch = confManager_->getAppSettingValue("LiveSearch", true).toBool();
2176+
if (bLiveSearch) {
2177+
queryTagRowLimit(tag, 1000);
2178+
}
2179+
2180+
}
21702181
void CMainWindow::on_searchButton_clicked()
21712182
{
21722183
QString tagToQuery;

Display/CMainWindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ private slots:
145145

146146
void queryTag(const QString& tag);
147147
void queryTagRowLimit(const QString& tag, unsigned int limitSearchRow);
148+
void queryTagTop1000(const QString& tag);
148149

149150
private:
150151
void updateProjectListWidget();

Display/CProjectDlg.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,7 @@ void CProjectDlg::on_applyButton_clicked()
8484
qDebug() << "projectItem.tagUpdateDateTime_ = " << projectItem.tagUpdateDateTime_;
8585

8686
if (projectItem.tagUpdateDateTime_ == "") { // new project
87-
if (currentProjectName_ == "") { // no project loaded yet
88-
CProjectManager::getInstance()->updateProjectItem(true, modifiedItem.name_, modifiedItem);
89-
} else {
90-
// use currentProjectName_ for updateProjectItem as name may have be changed
91-
CProjectManager::getInstance()->updateProjectItem(true, currentProjectName_, modifiedItem);
92-
}
87+
CProjectManager::getInstance()->updateProjectItem(true, modifiedItem.name_, modifiedItem);
9388
} else { // old project which has updated tag time
9489
if (currentProjectName_ == "") { // no project loaded yet
9590
CProjectManager::getInstance()->updateProjectItem(false, modifiedItem.name_, modifiedItem);

Model/CProjectManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ void CProjectManager::updateProjectItem(bool newProject, const QString& projectI
8484
QDir currentDir(QDir::currentPath());
8585

8686
if (projectItemName != newItem.name_) { // project renamed
87-
projectMap_.remove(projectItemName); // remove old one
87+
qDebug() << "newItem.name_ = " << newItem.name_;
88+
qDebug() << "projectItemName = " << projectItemName;
8889

89-
// current directory
90-
QDir currentDir(QDir::currentPath());
90+
projectMap_.remove(projectItemName); // remove old one
9191

9292
// using absoluteFilePath so relative and absolute path also possible
9393
tagDir = currentDir.absoluteFilePath(CConfigManager::getInstance()->getAppSettingValue("TagDir").toString() + "/" + projectItemName);

Resources/Forms/aboutDialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<item>
6868
<widget class="QLabel" name="label_5">
6969
<property name="text">
70-
<string>Blink v1.7.1</string>
70+
<string>Blink v1.7.2</string>
7171
</property>
7272
</widget>
7373
</item>

0 commit comments

Comments
 (0)